@txdfe/at-exceed
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports.AtExceed=t():e.AtExceed=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([function(e,t,n){"use strict";var r=n(1),o=n(12),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function a(e){return null!==e&&"object"===typeof e}function u(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:o,isFormData:function(e){return"undefined"!==typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"===typeof e},isNumber:function(e){return"number"===typeof e},isObject:a,isUndefined:function(e){return"undefined"===typeof e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)},forEach:c,merge:function e(){var t={};function n(n,r){"object"===typeof t[r]&&"object"===typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return t},deepMerge:function e(){var t={};function n(n,r){"object"===typeof t[r]&&"object"===typeof n?t[r]=e(t[r],n):t[r]="object"===typeof n?e({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,function(t,o){e[o]=n&&"function"===typeof t?r(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(0);function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,function(e,t){null!==e&&"undefined"!==typeof e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))}))}),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(0),o=n(18),i={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a={adapter:function(){var e;return"undefined"!==typeof t&&"[object process]"===Object.prototype.toString.call(t)?e=n(5):"undefined"!==typeof XMLHttpRequest&&(e=n(5)),e}(),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){a.headers[e]={}}),r.forEach(["post","put","patch"],function(e){a.headers[e]=r.merge(i)}),e.exports=a}).call(this,n(17))},function(e,t,n){"use strict";var r=n(0),o=n(19),i=n(2),s=n(21),a=n(22),u=n(6);e.exports=function(e){return new Promise(function(t,c){var f=e.data,p=e.headers;r.isFormData(f)&&delete p["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",d=e.auth.password||"";p.Authorization="Basic "+btoa(h+":"+d)}if(l.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?s(l.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:e,request:l};o(t,c,r),l=null}},l.onabort=function(){l&&(c(u("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){c(u("Network Error",e,null,l)),l=null},l.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var m=n(23),y=(e.withCredentials||a(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;y&&(p[e.xsrfHeaderName]=y)}if("setRequestHeader"in l&&r.forEach(p,function(e,t){"undefined"===typeof f&&"content-type"===t.toLowerCase()?delete p[t]:l.setRequestHeader(t,e)}),e.withCredentials&&(l.withCredentials=!0),e.responseType)try{l.responseType=e.responseType}catch(v){if("json"!==e.responseType)throw v}"function"===typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),c(e),l=null)}),void 0===f&&(f=null),l.send(f)})}},function(e,t,n){"use strict";var r=n(20);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){t=t||{};var n={};return r.forEach(["url","method","params","data"],function(e){"undefined"!==typeof t[e]&&(n[e]=t[e])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):"undefined"!==typeof t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):"undefined"!==typeof e[o]&&(n[o]=e[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])}),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";n.r(t);var r=n(9),o=n.n(r);function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=n(28),a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t=t||{};n.ENV=n.ENV||"production",n.validateStatus=n.validateStatus||function(e){return e>=200&&e<300||401===e||400===e},this.config=n,this.apimap=[],this.axios=o.a.create({timeout:n.timeout||3e3,withCredentials:!0,validateStatus:n.validateStatus}),this.interceptors=this.axios.interceptors}var t,n,r;return t=e,(n=[{key:"use",value:function(e){e instanceof Array?this.apimap=e:console&&console.warn&&console.warn("can not found ENV:".concat(this.config.ENV," in your apimap"))}},{key:"fetch",value:function(e){var t,n=this;return"string"===typeof e&&(e={api:e}),this.apimap.forEach(function(r){if(r.id===e.api){if(e.params){var o=r.urls[n.config.ENV];r.url=s.render(o,e.params)}else r.url=r.urls[n.config.ENV];t=r}}),t||console&&console.warn&&console.warn("can not found API:".concat(e.api," in your current environment")),t.url||console.warn("API url is null, please check the APIMAP"),e.data&&(t.data=e.data),t.data=t.data||{},("get"===t.method||"GET"===t.method)&&Object.keys(t.data).forEach(function(e,n){0===n&&-1===t.url.indexOf("?")?t.url+="?".concat(e,"=").concat(t.data[e]):t.url+="&".concat(e,"=").concat(t.data[e])}),-1===t.url.indexOf("?")?t.url+="?":t.url+="&",t.url+="_input_charset=utf-8",this.axios.request(t)}}])&&i(t.prototype,n),r&&i(t,r),e}();t.default=a},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(13),s=n(7);function a(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var u=a(n(4));u.Axios=i,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=n(8),u.CancelToken=n(26),u.isCancel=n(3),u.all=function(e){return Promise.all(e)},u.spread=n(27),e.exports=u,e.exports.default=u},function(e,t){ | ||
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports.AtExceed=t():e.AtExceed=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}([function(e,t,n){"use strict";var r=n(1),o=n(12),i=Object.prototype.toString;function s(e){return"[object Array]"===i.call(e)}function a(e){return null!==e&&"object"===typeof e}function u(e){return"[object Function]"===i.call(e)}function c(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:o,isFormData:function(e){return"undefined"!==typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"===typeof e},isNumber:function(e){return"number"===typeof e},isObject:a,isUndefined:function(e){return"undefined"===typeof e},isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)},forEach:c,merge:function e(){var t={};function n(n,r){"object"===typeof t[r]&&"object"===typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return t},deepMerge:function e(){var t={};function n(n,r){"object"===typeof t[r]&&"object"===typeof n?t[r]=e(t[r],n):t[r]="object"===typeof n?e({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,function(t,o){e[o]=n&&"function"===typeof t?r(t,n):t}),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(0);function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,function(e,t){null!==e&&"undefined"!==typeof e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))}))}),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(0),o=n(18),i={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a={adapter:function(){var e;return"undefined"!==typeof t&&"[object process]"===Object.prototype.toString.call(t)?e=n(5):"undefined"!==typeof XMLHttpRequest&&(e=n(5)),e}(),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){a.headers[e]={}}),r.forEach(["post","put","patch"],function(e){a.headers[e]=r.merge(i)}),e.exports=a}).call(this,n(17))},function(e,t,n){"use strict";var r=n(0),o=n(19),i=n(2),s=n(21),a=n(22),u=n(6);e.exports=function(e){return new Promise(function(t,c){var f=e.data,p=e.headers;r.isFormData(f)&&delete p["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",d=e.auth.password||"";p.Authorization="Basic "+btoa(h+":"+d)}if(l.open(e.method.toUpperCase(),i(e.url,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in l?s(l.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:n,config:e,request:l};o(t,c,r),l=null}},l.onabort=function(){l&&(c(u("Request aborted",e,"ECONNABORTED",l)),l=null)},l.onerror=function(){c(u("Network Error",e,null,l)),l=null},l.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",l)),l=null},r.isStandardBrowserEnv()){var m=n(23),y=(e.withCredentials||a(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;y&&(p[e.xsrfHeaderName]=y)}if("setRequestHeader"in l&&r.forEach(p,function(e,t){"undefined"===typeof f&&"content-type"===t.toLowerCase()?delete p[t]:l.setRequestHeader(t,e)}),e.withCredentials&&(l.withCredentials=!0),e.responseType)try{l.responseType=e.responseType}catch(v){if("json"!==e.responseType)throw v}"function"===typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){l&&(l.abort(),c(e),l=null)}),void 0===f&&(f=null),l.send(f)})}},function(e,t,n){"use strict";var r=n(20);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){t=t||{};var n={};return r.forEach(["url","method","params","data"],function(e){"undefined"!==typeof t[e]&&(n[e]=t[e])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):"undefined"!==typeof t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):"undefined"!==typeof e[o]&&(n[o]=e[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])}),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";n.r(t);var r=n(9),o=n.n(r);function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=n(28),u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t=t||{};n.ENV=n.ENV||"production",n.validateStatus=n.validateStatus||function(e){return e>=200&&e<300||401===e||400===e},this.config=n,this.apimap=[],this.axios=o.a.create({timeout:n.timeout||3e3,withCredentials:!0,validateStatus:n.validateStatus}),this.interceptors=this.axios.interceptors}var t,n,r;return t=e,(n=[{key:"use",value:function(e){e instanceof Array?this.apimap=e:console&&console.warn&&console.warn("can not found ENV:".concat(this.config.ENV," in your apimap"))}},{key:"fetch",value:function(e){var t,n=this;return"string"===typeof e&&(e={api:e}),this.apimap.forEach(function(r){if(r.id===e.api){if(e.params){var o=r.urls[n.config.ENV];r.url=a.render(o,e.params)}else r.url=r.urls[n.config.ENV];t=r}}),t||console&&console.warn&&console.warn("can not found API:".concat(e.api," in your current environment")),t.url||console.warn("API url is null, please check the APIMAP"),e.data&&(t.data=e.data),t.data=t.data||{},("get"===t.method||"GET"===t.method)&&Object.keys(t.data).forEach(function(e,n){0===n&&-1===t.url.indexOf("?")?t.url+="?".concat(e,"=").concat(t.data[e]):t.url+="&".concat(e,"=").concat(t.data[e])}),-1===t.url.indexOf("?")?t.url+="?":t.url+="&",t.url+="_input_charset=utf-8","get"===t.method&&t.contentType&&-1===t.contentType.indexOf("application/json")&&(t.headers=i({},t.headers,{"content-type":t.contentType})),this.axios.request(t)}}])&&s(t.prototype,n),r&&s(t,r),e}();t.default=u},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(13),s=n(7);function a(e){var t=new i(e),n=o(i.prototype.request,t);return r.extend(n,i.prototype,t),r.extend(n,t),n}var u=a(n(4));u.Axios=i,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=n(8),u.CancelToken=n(26),u.isCancel=n(3),u.all=function(e){return Promise.all(e)},u.spread=n(27),e.exports=u,e.exports.default=u},function(e,t){ | ||
/*! | ||
@@ -17,3 +17,3 @@ * Determine if an object is a Buffer | ||
*/ | ||
s=function(e){var t=Object.prototype.toString,n=Array.isArray||function(e){return"[object Array]"===t.call(e)};function r(e){return"function"===typeof e}function o(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"===typeof e&&t in e}var s=RegExp.prototype.test,a=/\S/;function u(e){return!function(e,t){return s.call(e,t)}(a,e)}var c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},f=/\s*/,p=/\s+/,l=/\s*=/,h=/\s*\}/,d=/#|\^|\/|>|\{|&|=|!/;function m(e){this.string=e,this.tail=e,this.pos=0}function y(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function v(){this.cache={}}m.prototype.eos=function(){return""===this.tail},m.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},m.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},y.prototype.push=function(e){return new y(e,this)},y.prototype.lookup=function(e){var t,n,o,s=this.cache;if(s.hasOwnProperty(e))t=s[e];else{for(var a,u,c,f=this,p=!1;f;){if(e.indexOf(".")>0)for(a=f.view,u=e.split("."),c=0;null!=a&&c<u.length;)c===u.length-1&&(p=i(a,u[c])||(n=a,o=u[c],null!=n&&"object"!==typeof n&&n.hasOwnProperty&&n.hasOwnProperty(o))),a=a[u[c++]];else a=f.view[e],p=i(f.view,e);if(p){t=a;break}f=f.parent}s[e]=t}return r(t)&&(t=t.call(this.view)),t},v.prototype.clearCache=function(){this.cache={}},v.prototype.parse=function(t,r){var i=this.cache,s=t+":"+(r||e.tags).join(":"),a=i[s];return null==a&&(a=i[s]=function(t,r){if(!t)return[];var i,s,a,c=[],y=[],v=[],g=!1,w=!1;function x(){if(g&&!w)for(;v.length;)delete y[v.pop()];else v=[];g=!1,w=!1}function b(e){if("string"===typeof e&&(e=e.split(p,2)),!n(e)||2!==e.length)throw new Error("Invalid tags: "+e);i=new RegExp(o(e[0])+"\\s*"),s=new RegExp("\\s*"+o(e[1])),a=new RegExp("\\s*"+o("}"+e[1]))}b(r||e.tags);for(var E,T,S,j,A,k,C=new m(t);!C.eos();){if(E=C.pos,S=C.scanUntil(i))for(var O=0,R=S.length;O<R;++O)u(j=S.charAt(O))?v.push(y.length):w=!0,y.push(["text",j,E,E+1]),E+=1,"\n"===j&&x();if(!C.scan(i))break;if(g=!0,T=C.scan(d)||"name",C.scan(f),"="===T?(S=C.scanUntil(l),C.scan(l),C.scanUntil(s)):"{"===T?(S=C.scanUntil(a),C.scan(h),C.scanUntil(s),T="&"):S=C.scanUntil(s),!C.scan(s))throw new Error("Unclosed tag at "+C.pos);if(A=[T,S,E,C.pos],y.push(A),"#"===T||"^"===T)c.push(A);else if("/"===T){if(!(k=c.pop()))throw new Error('Unopened section "'+S+'" at '+E);if(k[1]!==S)throw new Error('Unclosed section "'+k[1]+'" at '+E)}else"name"===T||"{"===T||"&"===T?w=!0:"="===T&&b(S)}if(k=c.pop())throw new Error('Unclosed section "'+k[1]+'" at '+C.pos);return function(e){for(var t,n=[],r=n,o=[],i=0,s=e.length;i<s;++i)switch((t=e[i])[0]){case"#":case"^":r.push(t),o.push(t),r=t[4]=[];break;case"/":o.pop()[5]=t[2],r=o.length>0?o[o.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],o=0,i=e.length;o<i;++o)(t=e[o])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}(y))}(t,r)),a},v.prototype.render=function(e,t,n,r){var o=this.parse(e,r),i=t instanceof y?t:new y(t);return this.renderTokens(o,i,n,e,r)},v.prototype.renderTokens=function(e,t,n,r,o){for(var i,s,a,u="",c=0,f=e.length;c<f;++c)a=void 0,"#"===(s=(i=e[c])[0])?a=this.renderSection(i,t,n,r):"^"===s?a=this.renderInverted(i,t,n,r):">"===s?a=this.renderPartial(i,t,n,o):"&"===s?a=this.unescapedValue(i,t):"name"===s?a=this.escapedValue(i,t):"text"===s&&(a=this.rawValue(i)),void 0!==a&&(u+=a);return u},v.prototype.renderSection=function(e,t,o,i){var s=this,a="",u=t.lookup(e[1]);if(u){if(n(u))for(var c=0,f=u.length;c<f;++c)a+=this.renderTokens(e[4],t.push(u[c]),o,i);else if("object"===typeof u||"string"===typeof u||"number"===typeof u)a+=this.renderTokens(e[4],t.push(u),o,i);else if(r(u)){if("string"!==typeof i)throw new Error("Cannot use higher-order sections without the original template");null!=(u=u.call(t.view,i.slice(e[3],e[5]),function(e){return s.render(e,t,o)}))&&(a+=u)}else a+=this.renderTokens(e[4],t,o,i);return a}},v.prototype.renderInverted=function(e,t,r,o){var i=t.lookup(e[1]);if(!i||n(i)&&0===i.length)return this.renderTokens(e[4],t,r,o)},v.prototype.renderPartial=function(e,t,n,o){if(n){var i=r(n)?n(e[1]):n[e[1]];return null!=i?this.renderTokens(this.parse(i,o),t,n,i):void 0}},v.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},v.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);if(null!=r)return e.escape(r)},v.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="3.0.1",e.tags=["{{","}}"];var g=new v;return e.clearCache=function(){return g.clearCache()},e.parse=function(e,t){return g.parse(e,t)},e.render=function(e,t,r,o){if("string"!==typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(n(i=e)?"array":typeof i)+'" was given as the first argument for mustache#render(template, view, partials)');var i;return g.render(e,t,r,o)},e.to_html=function(t,n,o,i){var s=e.render(t,n,o);if(!r(i))return s;i(s)},e.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return c[e]})},e.Scanner=m,e.Context=y,e.Writer=v,e},t&&"string"!==typeof t.nodeName?s(t):(o=[t],void 0===(i="function"===typeof(r=s)?r.apply(t,o):r)||(e.exports=i))}])}); | ||
s=function(e){var t=Object.prototype.toString,n=Array.isArray||function(e){return"[object Array]"===t.call(e)};function r(e){return"function"===typeof e}function o(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"===typeof e&&t in e}var s=RegExp.prototype.test,a=/\S/;function u(e){return!function(e,t){return s.call(e,t)}(a,e)}var c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},f=/\s*/,p=/\s+/,l=/\s*=/,h=/\s*\}/,d=/#|\^|\/|>|\{|&|=|!/;function m(e){this.string=e,this.tail=e,this.pos=0}function y(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function v(){this.cache={}}m.prototype.eos=function(){return""===this.tail},m.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},m.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},y.prototype.push=function(e){return new y(e,this)},y.prototype.lookup=function(e){var t,n,o,s=this.cache;if(s.hasOwnProperty(e))t=s[e];else{for(var a,u,c,f=this,p=!1;f;){if(e.indexOf(".")>0)for(a=f.view,u=e.split("."),c=0;null!=a&&c<u.length;)c===u.length-1&&(p=i(a,u[c])||(n=a,o=u[c],null!=n&&"object"!==typeof n&&n.hasOwnProperty&&n.hasOwnProperty(o))),a=a[u[c++]];else a=f.view[e],p=i(f.view,e);if(p){t=a;break}f=f.parent}s[e]=t}return r(t)&&(t=t.call(this.view)),t},v.prototype.clearCache=function(){this.cache={}},v.prototype.parse=function(t,r){var i=this.cache,s=t+":"+(r||e.tags).join(":"),a=i[s];return null==a&&(a=i[s]=function(t,r){if(!t)return[];var i,s,a,c=[],y=[],v=[],g=!1,w=!1;function b(){if(g&&!w)for(;v.length;)delete y[v.pop()];else v=[];g=!1,w=!1}function x(e){if("string"===typeof e&&(e=e.split(p,2)),!n(e)||2!==e.length)throw new Error("Invalid tags: "+e);i=new RegExp(o(e[0])+"\\s*"),s=new RegExp("\\s*"+o(e[1])),a=new RegExp("\\s*"+o("}"+e[1]))}x(r||e.tags);for(var E,T,j,S,O,A,k=new m(t);!k.eos();){if(E=k.pos,j=k.scanUntil(i))for(var C=0,R=j.length;C<R;++C)u(S=j.charAt(C))?v.push(y.length):w=!0,y.push(["text",S,E,E+1]),E+=1,"\n"===S&&b();if(!k.scan(i))break;if(g=!0,T=k.scan(d)||"name",k.scan(f),"="===T?(j=k.scanUntil(l),k.scan(l),k.scanUntil(s)):"{"===T?(j=k.scanUntil(a),k.scan(h),k.scanUntil(s),T="&"):j=k.scanUntil(s),!k.scan(s))throw new Error("Unclosed tag at "+k.pos);if(O=[T,j,E,k.pos],y.push(O),"#"===T||"^"===T)c.push(O);else if("/"===T){if(!(A=c.pop()))throw new Error('Unopened section "'+j+'" at '+E);if(A[1]!==j)throw new Error('Unclosed section "'+A[1]+'" at '+E)}else"name"===T||"{"===T||"&"===T?w=!0:"="===T&&x(j)}if(A=c.pop())throw new Error('Unclosed section "'+A[1]+'" at '+k.pos);return function(e){for(var t,n=[],r=n,o=[],i=0,s=e.length;i<s;++i)switch((t=e[i])[0]){case"#":case"^":r.push(t),o.push(t),r=t[4]=[];break;case"/":o.pop()[5]=t[2],r=o.length>0?o[o.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],o=0,i=e.length;o<i;++o)(t=e[o])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}(y))}(t,r)),a},v.prototype.render=function(e,t,n,r){var o=this.parse(e,r),i=t instanceof y?t:new y(t);return this.renderTokens(o,i,n,e,r)},v.prototype.renderTokens=function(e,t,n,r,o){for(var i,s,a,u="",c=0,f=e.length;c<f;++c)a=void 0,"#"===(s=(i=e[c])[0])?a=this.renderSection(i,t,n,r):"^"===s?a=this.renderInverted(i,t,n,r):">"===s?a=this.renderPartial(i,t,n,o):"&"===s?a=this.unescapedValue(i,t):"name"===s?a=this.escapedValue(i,t):"text"===s&&(a=this.rawValue(i)),void 0!==a&&(u+=a);return u},v.prototype.renderSection=function(e,t,o,i){var s=this,a="",u=t.lookup(e[1]);if(u){if(n(u))for(var c=0,f=u.length;c<f;++c)a+=this.renderTokens(e[4],t.push(u[c]),o,i);else if("object"===typeof u||"string"===typeof u||"number"===typeof u)a+=this.renderTokens(e[4],t.push(u),o,i);else if(r(u)){if("string"!==typeof i)throw new Error("Cannot use higher-order sections without the original template");null!=(u=u.call(t.view,i.slice(e[3],e[5]),function(e){return s.render(e,t,o)}))&&(a+=u)}else a+=this.renderTokens(e[4],t,o,i);return a}},v.prototype.renderInverted=function(e,t,r,o){var i=t.lookup(e[1]);if(!i||n(i)&&0===i.length)return this.renderTokens(e[4],t,r,o)},v.prototype.renderPartial=function(e,t,n,o){if(n){var i=r(n)?n(e[1]):n[e[1]];return null!=i?this.renderTokens(this.parse(i,o),t,n,i):void 0}},v.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},v.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);if(null!=r)return e.escape(r)},v.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="3.0.1",e.tags=["{{","}}"];var g=new v;return e.clearCache=function(){return g.clearCache()},e.parse=function(e,t){return g.parse(e,t)},e.render=function(e,t,r,o){if("string"!==typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(n(i=e)?"array":typeof i)+'" was given as the first argument for mustache#render(template, view, partials)');var i;return g.render(e,t,r,o)},e.to_html=function(t,n,o,i){var s=e.render(t,n,o);if(!r(i))return s;i(s)},e.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return c[e]})},e.Scanner=m,e.Context=y,e.Writer=v,e},t&&"string"!==typeof t.nodeName?s(t):(o=[t],void 0===(i="function"===typeof(r=s)?r.apply(t,o):r)||(e.exports=i))}])}); | ||
//# sourceMappingURL=index.min.js.map |
@@ -12,2 +12,4 @@ "use strict"; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -116,2 +118,9 @@ | ||
requestParams.url += '_input_charset=utf-8'; | ||
if (requestParams.method === 'get' && requestParams.contentType && requestParams.contentType.indexOf('application/json') === -1) { | ||
requestParams.headers = _extends({}, requestParams.headers, { | ||
'content-type': requestParams.contentType | ||
}); | ||
} | ||
return this.axios.request(requestParams); | ||
@@ -118,0 +127,0 @@ } |
{ | ||
"name": "@txdfe/at-exceed", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "axios", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -97,2 +97,11 @@ import axios from 'axios'; | ||
if (requestParams.method === 'get' && requestParams.contentType && requestParams.contentType.indexOf('application/json') === -1) { | ||
requestParams.headers = Object.assign({}, | ||
requestParams.headers, | ||
{ | ||
'content-type': requestParams.contentType | ||
} | ||
); | ||
} | ||
return this.axios.request(requestParams); | ||
@@ -99,0 +108,0 @@ } |
Sorry, the diff of this file is not supported yet
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
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
144906
292