Socket
Socket
Sign inDemoInstall

xior

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xior - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

12

dist/index.esm.d.ts

@@ -105,4 +105,6 @@ export { merge } from 'ts-deepmerge';

constructor(options?: XiorRequestConfig);
requestInterceptors: ((config: XiorInterceptorRequestConfig) => Promise<XiorInterceptorRequestConfig> | XiorInterceptorRequestConfig)[];
responseInterceptors: {
/** request interceptors */
REQI: ((config: XiorInterceptorRequestConfig) => Promise<XiorInterceptorRequestConfig> | XiorInterceptorRequestConfig)[];
/** response interceptors */
RESI: {
fn: (config: {

@@ -178,5 +180,5 @@ data: any;

request<T>(options?: XiorRequestConfig | string): Promise<XiorResponse<T>>;
handlerFetch<T>(requestConfig: XiorRequestConfig): Promise<XiorResponse<T>>;
createGetHandler<T>(method: string): (url: string, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
createPostHandler<T>(method: string): (url: string, data?: any, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
fetch<T>(requestConfig: XiorRequestConfig): Promise<XiorResponse<T>>;
createGet<T>(method: string): (url: string, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
createPost<T>(method: string): (url: string, data?: any, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
get<T = any>(url: string, options?: XiorRequestConfig): Promise<XiorResponse<T>>;

@@ -183,0 +185,0 @@ head<T = any>(url: string, options?: XiorRequestConfig): Promise<XiorResponse<T>>;

@@ -1,1 +0,1 @@

import{merge as e}from"ts-deepmerge";export{merge}from"ts-deepmerge";function t(e,t){let r=new globalThis.AbortController;function n(e){r.abort(e),o()}let s=[];for(let t of e){if((null==t?void 0:t.aborted)===!0){n(t.reason);break}if((null==t?void 0:t.addEventListener)!=null){let e=()=>{n(t.reason)};s.push(()=>{(null==t?void 0:t.removeEventListener)!=null&&t.removeEventListener("abort",e)}),t.addEventListener("abort",e)}}function o(){s.forEach(e=>{e()}),null==t||t()}let i=r.signal;return i.clear=o,i}function r(e,t,r){let n=t?r(t):"";n&&(n=e+(e.includes("?")?"&"+n:"?"+n));let[s,o]=n.split("?");if(o){let e=o.split("&");return`${s}?${e.sort().join("&")}`}return n||e}function n(e){return new Promise(t=>{setTimeout(()=>{t("ok")},e)})}function s(e,t=!0,r=null){if(null==e)return"";let n=[],o=t?encodeURIComponent:e=>e;for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let a=e[i],l=r?`${r}[${o(i)}]`:o(i);if("object"==typeof a){let e=s(a,t,l);""!==e&&n.push(e)}else Array.isArray(a)?a.forEach((e,t)=>{let r=`${l}[${t}]`;n.push(`${o(r)}=${o(e)}`)}):n.push(`${o(l)}=${o(a)}`)}return n.join("&")}function o(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function i(e,t){return t?(e.endsWith("/")?e:e+"/")+(t.startsWith("/")?t.slice(1):t):e}class a extends Error{constructor(e,t,r){super(e),this.name="XiorError",this.request=t,this.config=t,this.response=r}}class l extends a{constructor(e,t,r){super(e),this.name="XiorTimeoutError",this.request=t,this.config=t,this.response=r}}function u(e){return"XiorError"===e.name||"XiorTimeoutError"===e.name}function c(e,t,r,n,s,o,i){try{var a=e[o](i),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,s)}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let h="application/x-www-form-urlencoded",d="application/json";function f(e="GET"){return["HEAD","GET","DELETE","OPTIONS"].includes(e)}function m(e){return v.apply(this,arguments)}function v(){var t;return t=function*(t){let r=t.encode||t.paramsSerializer||s,n=!1!==t.encodeURI,o=t.method?t.method.toUpperCase():"GET",i=t.url||"",a=i,l=t.data,u=l,c=!1,m=(null==t?void 0:t.headers)||{};if(l&&!(l instanceof FormData)){let s="";if(null==t?void 0:t.headers){let e=Object.keys(t.headers).find(e=>"content-type"===e.toLowerCase());e&&(s=t.headers[e])}if(s||(s=f(o)?h:d,m["Content-Type"]=s),s===h&&("object"==typeof l||t.params)){c=!0;let s=r(e(l||{},t.params||{}),n);s&&(i+=i.includes("?")?`&${s}`:`?${s}`)}else s===d&&(u=JSON.stringify(l))}return!c&&t.params&&Object.keys(t.params).length>0&&(i+=i.includes("?")?`&${r(t.params,n)}`:`?${r(t.params,n)}`),p({},t,{data:l,_data:u,url:a,_url:i,method:o,headers:m,encode:r,paramsSerializer:r})},(v=function(){var e=this,r=arguments;return new Promise(function(n,s){var o=t.apply(e,r);function i(e){c(o,n,s,i,a,"next",e)}function a(e){c(o,n,s,i,a,"throw",e)}i(void 0)})}).apply(this,arguments)}function y(e,t,r,n,s,o,i){try{var a=e[o](i),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,s)}function g(e){return function(){var t=this,r=arguments;return new Promise(function(n,s){var o=e.apply(t,r);function i(e){y(o,n,s,i,a,"next",e)}function a(e){y(o,n,s,i,a,"throw",e)}i(void 0)})}}function E(){return(E=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let b="undefined"!=typeof AbortController;class O{static create(e){return new O(e)}get interceptors(){return{request:{use:(e,t)=>(this.requestInterceptors.push(e),e),eject:e=>{this.requestInterceptors=this.requestInterceptors.filter(t=>t!==e)},clear:()=>{this.requestInterceptors=[this.requestInterceptors[0]]}},response:{use:(e,t)=>(this.responseInterceptors.push({fn:e,onRejected:t}),e),eject:e=>{this.responseInterceptors=this.responseInterceptors.filter(t=>t.fn!==e)},clear:()=>{this.responseInterceptors=[]}}}}get plugins(){return{use:e=>(this._plugins.push(e),e),eject:e=>{this._plugins=this._plugins.filter(t=>t!==e)},clear:()=>{this._plugins=[]}}}request(t){var r=this;return g(function*(){let n=e({},r.config||{},r.defaults||{},"string"==typeof t?{url:t}:t||{},{headers:{},params:{}});for(let e of r.requestInterceptors)n=yield e(n);let s=r.handlerFetch.bind(r);return r._plugins.forEach(e=>{s=e(s)}),s(n)})()}handlerFetch(e){var r=this;return g(function*(){var n,s;let u,c;if(r._plugins.length>0)for(let t of r.requestInterceptors.slice(1))e=yield t(e);let{url:p,method:h,headers:d,timeout:m,signal:v,data:y,_data:g}=e,O=function(e,t){if(null==e)return{};var r,n,s={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(s[r]=e[r]);return s}(e,["url","method","headers","timeout","signal","data","_data"]),j=[];if(m&&b){let t=new AbortController;c=setTimeout(()=>{t.abort(new l(`timeout of ${m}ms exceeded`,e))},m),j.push(t.signal)}v&&j.push(v),u=j[0],j.length>1&&(u=t(j,()=>{clearTimeout(c)}));let I=e._url||p||"";e.baseURL&&!o(I)&&(I=i(e.baseURL,I));let T=yield fetch(I,E({body:f(e.method)?void 0:g},O,{signal:u,method:h,headers:d}));c&&clearTimeout(c),null==u||null==(n=u.clear)||n.call(u);let w={response:T,config:e,status:T.status,statusText:T.statusText,headers:T.headers};if(!T.ok){let t;try{(t=yield T.text())&&(t=JSON.parse(t))}catch(e){}let n=new a(T.status?`Request failed with status code ${T.status}`:"Network error",e,E({data:t},w));for(let e of r.responseInterceptors)if(e.onRejected){let t=yield e.onRejected(n);if(null==t?void 0:null==(s=t.response)?void 0:s.ok)return t}throw n}if("HEAD"===e.method)return E({data:void 0,request:e},w);let{responseType:q}=e;if(!q||"json"===q||"text"===q){let t;try{(t=yield T.text())&&"text"!==q&&(t=JSON.parse(t))}catch(e){}let n={data:t,request:e,response:T};for(let e of r.responseInterceptors)n=yield e.fn(n);return E({data:n.data,request:e},w)}return E({data:void 0,request:e},w)})()}createGetHandler(e){return(t,r)=>this.request(r?E({},r,{method:e,url:t}):{method:e,url:t})}createPostHandler(e){return(t,r,n)=>this.request(n?E({},n,{method:e,url:t,data:r}):{method:e,url:t,data:r})}get(e,t){return this.createGetHandler("GET")(e,t)}head(e,t){return this.createGetHandler("HEAD")(e,t)}post(e,t,r){return this.createPostHandler("POST")(e,t,r)}put(e,t,r){return this.createPostHandler("PUT")(e,t,r)}patch(e,t,r){return this.createPostHandler("PATCH")(e,t,r)}delete(e,t){return this.createGetHandler("DELETE")(e,t)}options(e,t){return this.createGetHandler("OPTIONS")(e,t)}constructor(e){this.requestInterceptors=[m],this.responseInterceptors=[],this._plugins=[],this.config=e,this.defaults={params:{},headers:{}}}}O.VERSION="0.2.5";let j=Object.assign(O.create(),{create:O.create,VERSION:O.VERSION});export{a as XiorError,l as XiorTimeoutError,t as anySignal,r as buildSortedURL,j as default,n as delay,s as encodeParams,o as isAbsoluteURL,u as isXiorError,i as joinPath,O as xior};
import{merge as e}from"ts-deepmerge";export{merge}from"ts-deepmerge";function t(e,t){let r=new globalThis.AbortController;function n(e){r.abort(e),i()}let s=[];for(let t of e){if((null==t?void 0:t.aborted)===!0){n(t.reason);break}if((null==t?void 0:t.addEventListener)!=null){let e=()=>{n(t.reason)};s.push(()=>{(null==t?void 0:t.removeEventListener)!=null&&t.removeEventListener("abort",e)}),t.addEventListener("abort",e)}}function i(){s.forEach(e=>{e()}),null==t||t()}let o=r.signal;return o.clear=i,o}function r(e,t,r){let n=t?r(t):"";n&&(n=e+(e.includes("?")?"&"+n:"?"+n));let[s,i]=n.split("?");if(i){let e=i.split("&");return`${s}?${e.sort().join("&")}`}return n||e}function n(e){return new Promise(t=>{setTimeout(()=>{t("ok")},e)})}function s(e,t=!0,r=null){if(null==e)return"";let n=[],i=t?encodeURIComponent:e=>e;for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o)){let a=e[o],l=r?`${r}[${i(o)}]`:i(o);if("object"==typeof a){let e=s(a,t,l);""!==e&&n.push(e)}else Array.isArray(a)?a.forEach((e,t)=>{let r=`${l}[${t}]`;n.push(`${i(r)}=${i(e)}`)}):n.push(`${i(l)}=${i(a)}`)}return n.join("&")}function i(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function o(e,t){return t?(e.endsWith("/")?e:e+"/")+(t.startsWith("/")?t.slice(1):t):e}class a extends Error{constructor(e,t,r){super(e),this.name="XiorError",this.request=t,this.config=t,this.response=r}}class l extends a{constructor(e,t,r){super(e),this.name="XiorTimeoutError",this.request=t,this.config=t,this.response=r}}function u(e){return"XiorError"===e.name||"XiorTimeoutError"===e.name}function c(e,t,r,n,s,i,o){try{var a=e[i](o),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,s)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let f="application/x-www-form-urlencoded",d="application/json";function p(e="GET"){return["HEAD","GET","DELETE","OPTIONS"].includes(e)}function m(e){return E.apply(this,arguments)}function E(){var t;return t=function*(t){let r=t.encode||t.paramsSerializer||s,n=!1!==t.encodeURI,i=t.method?t.method.toUpperCase():"GET",o=t.url||"",a=o,l=t.data,u=l,c=!1,m=(null==t?void 0:t.headers)||{};if(l&&!(l instanceof FormData)){let s="";if(null==t?void 0:t.headers){let e=Object.keys(t.headers).find(e=>"content-type"===e.toLowerCase());e&&(s=t.headers[e],t.headers["Content-Type"]=s,delete t.headers[e])}if(s||(s=p(i)?f:d,m["Content-Type"]=s),s===f&&("object"==typeof l||t.params)){c=!0;let s=r(e(l||{},t.params||{}),n);s&&(o+=o.includes("?")?`&${s}`:`?${s}`)}else s===d&&(u=JSON.stringify(l))}return!c&&t.params&&Object.keys(t.params).length>0&&(o+=o.includes("?")?`&${r(t.params,n)}`:`?${r(t.params,n)}`),h({},t,{data:l,_data:u,url:a,_url:o,method:i,headers:m,encode:r,paramsSerializer:r})},(E=function(){var e=this,r=arguments;return new Promise(function(n,s){var i=t.apply(e,r);function o(e){c(i,n,s,o,a,"next",e)}function a(e){c(i,n,s,o,a,"throw",e)}o(void 0)})}).apply(this,arguments)}function v(e,t,r,n,s,i,o){try{var a=e[i](o),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,s)}function y(e){return function(){var t=this,r=arguments;return new Promise(function(n,s){var i=e.apply(t,r);function o(e){v(i,n,s,o,a,"next",e)}function a(e){v(i,n,s,o,a,"throw",e)}o(void 0)})}}function g(){return(g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}let b="undefined"!=typeof AbortController;class R{static create(e){return new R(e)}get interceptors(){return{request:{use:(e,t)=>(this.REQI.push(e),e),eject:e=>{this.REQI=this.REQI.filter(t=>t!==e)},clear:()=>{this.REQI=[this.REQI[0]]}},response:{use:(e,t)=>(this.RESI.push({fn:e,onRejected:t}),e),eject:e=>{this.RESI=this.RESI.filter(t=>t.fn!==e)},clear:()=>{this.RESI=[]}}}}get plugins(){return{use:e=>(this._plugins.push(e),e),eject:e=>{this._plugins=this._plugins.filter(t=>t!==e)},clear:()=>{this._plugins=[]}}}request(t){var r=this;return y(function*(){let n=e({},r.config||{},r.defaults||{},"string"==typeof t?{url:t}:t||{},{headers:{},params:{}});for(let e of r.REQI)n=yield e(n);let s=r.fetch.bind(r);return r._plugins.forEach(e=>{s=e(s)}),s(n)})()}fetch(e){var r=this;return y(function*(){var n,s,u;let c,h;if(r._plugins.length>0)for(let t of r.REQI.slice(1))e=yield t(e);let{url:d,method:m,headers:E,timeout:v,signal:y,data:R,_data:O}=e,T=function(e,t){if(null==e)return{};var r,n,s={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(s[r]=e[r]);return s}(e,["url","method","headers","timeout","signal","data","_data"]),j=[];if(v&&b){let t=new AbortController;h=setTimeout(()=>{t.abort(new l(`timeout of ${v}ms exceeded`,e))},v),j.push(t.signal)}y&&j.push(y),c=j[0],j.length>1&&(c=t(j,()=>{clearTimeout(h)}));let I=e._url||d||"";e.baseURL&&!i(I)&&(I=o(e.baseURL,I));let w=yield fetch(I,g({body:p(e.method)||(null==(n=e.headers)?void 0:n["Content-Type"])===f?void 0:O},T,{signal:c,method:m,headers:E}));h&&clearTimeout(h),null==c||null==(s=c.clear)||s.call(c);let S={response:w,config:e,status:w.status,statusText:w.statusText,headers:w.headers};if(!w.ok){let t;try{(t=yield w.text())&&(t=JSON.parse(t))}catch(e){}let n=new a(w.status?`Request failed with status code ${w.status}`:"Network error",e,g({data:t},S));for(let e of r.RESI)if(e.onRejected){let t=yield e.onRejected(n);if(null==t?void 0:null==(u=t.response)?void 0:u.ok)return t}throw n}if("HEAD"===e.method)return g({data:void 0,request:e},S);let{responseType:P}=e;if(!P||"json"===P||"text"===P){let t;try{(t=yield w.text())&&"text"!==P&&(t=JSON.parse(t))}catch(e){}let n={data:t,request:e,response:w};for(let e of r.RESI)n=yield e.fn(n);return g({data:n.data,request:e},S)}return g({data:void 0,request:e},S)})()}createGet(e){return(t,r)=>this.request(r?g({},r,{method:e,url:t}):{method:e,url:t})}createPost(e){return(t,r,n)=>this.request(n?g({},n,{method:e,url:t,data:r}):{method:e,url:t,data:r})}get(e,t){return this.createGet("GET")(e,t)}head(e,t){return this.createGet("HEAD")(e,t)}post(e,t,r){return this.createPost("POST")(e,t,r)}put(e,t,r){return this.createPost("PUT")(e,t,r)}patch(e,t,r){return this.createPost("PATCH")(e,t,r)}delete(e,t){return this.createGet("DELETE")(e,t)}options(e,t){return this.createGet("OPTIONS")(e,t)}constructor(e){this.REQI=[m],this.RESI=[],this._plugins=[],this.config=e,this.defaults={params:{},headers:{}}}}R.VERSION="0.2.6";let O=Object.assign(R.create(),{create:R.create,VERSION:R.VERSION});export{a as XiorError,l as XiorTimeoutError,t as anySignal,r as buildSortedURL,O as default,n as delay,s as encodeParams,i as isAbsoluteURL,u as isXiorError,o as joinPath,R as xior};

@@ -105,4 +105,6 @@ export { merge } from 'ts-deepmerge';

constructor(options?: XiorRequestConfig);
requestInterceptors: ((config: XiorInterceptorRequestConfig) => Promise<XiorInterceptorRequestConfig> | XiorInterceptorRequestConfig)[];
responseInterceptors: {
/** request interceptors */
REQI: ((config: XiorInterceptorRequestConfig) => Promise<XiorInterceptorRequestConfig> | XiorInterceptorRequestConfig)[];
/** response interceptors */
RESI: {
fn: (config: {

@@ -178,5 +180,5 @@ data: any;

request<T>(options?: XiorRequestConfig | string): Promise<XiorResponse<T>>;
handlerFetch<T>(requestConfig: XiorRequestConfig): Promise<XiorResponse<T>>;
createGetHandler<T>(method: string): (url: string, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
createPostHandler<T>(method: string): (url: string, data?: any, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
fetch<T>(requestConfig: XiorRequestConfig): Promise<XiorResponse<T>>;
createGet<T>(method: string): (url: string, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
createPost<T>(method: string): (url: string, data?: any, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
get<T = any>(url: string, options?: XiorRequestConfig): Promise<XiorResponse<T>>;

@@ -183,0 +185,0 @@ head<T = any>(url: string, options?: XiorRequestConfig): Promise<XiorResponse<T>>;

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.xior=t():e.xior=t()}(this,(()=>(()=>{"use strict";var e={699:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.anySignal=void 0,t.anySignal=function(e,t){const r=new globalThis.AbortController;function n(e){r.abort(e),s()}const o=[];for(const t of e){if(!0===(null==t?void 0:t.aborted)){n(t.reason);break}if(null!=(null==t?void 0:t.addEventListener)){const e=()=>{n(t.reason)};o.push((()=>{null!=(null==t?void 0:t.removeEventListener)&&t.removeEventListener("abort",e)})),t.addEventListener("abort",e)}}function s(){o.forEach((e=>{e()})),null==t||t()}const i=r.signal;return i.clear=s,i}},509:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const s=r(895);o(r(895),t),o(r(340),t),o(r(976),t);const i=Object.assign(s.xior.create(),{create:s.xior.create,VERSION:s.xior.VERSION});t.default=i},393:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.likeGET=void 0;const o=r(976),s="application/x-www-form-urlencoded",i="application/json";function a(e="GET"){return["HEAD","GET","DELETE","OPTIONS"].includes(e)}t.likeGET=a,t.default=function(e){return n(this,void 0,void 0,(function*(){const t=e.encode||e.paramsSerializer||o.encodeParams,r=!1!==e.encodeURI,n=e.method?e.method.toUpperCase():"GET";let c=e.url||"";const u=c,l=e.data;let d=l,f=!1;const p=(null==e?void 0:e.headers)||{};if(l&&!(l instanceof FormData)){let u="";if(null==e?void 0:e.headers){const t=Object.keys(e.headers).find((e=>"content-type"===e.toLowerCase()));t&&(u=e.headers[t])}if(u||(u=a(n)?s:i,p["Content-Type"]=u),u!==s||"object"!=typeof l&&!e.params)u===i&&(d=JSON.stringify(l));else{f=!0;const n=t((0,o.merge)(l||{},e.params||{}),r);n&&(c+=c.includes("?")?`&${n}`:`?${n}`)}}return!f&&e.params&&Object.keys(e.params).length>0&&(c+=c.includes("?")?`&${t(e.params,r)}`:`?${t(e.params,r)}`),Object.assign(Object.assign({},e),{data:l,_data:d,url:u,_url:c,method:n,headers:p,encode:t,paramsSerializer:t})}))}},729:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;const n=r(602);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return n.merge}})},629:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let n=t?r(t):"";n&&(n=e+(e.includes("?")?"&"+n:"?"+n));const[o,s]=n.split("?");return s?`${o}?${s.split("&").sort().join("&")}`:n||e}},99:function(e,t,r){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.delay=t.buildSortedURL=void 0;const o=n(r(629));t.buildSortedURL=o.default,t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t("ok")}),e)}))}},340:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},976:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isXiorError=t.XiorTimeoutError=t.XiorError=t.joinPath=t.isAbsoluteURL=t.encodeParams=void 0,o(r(699),t),o(r(729),t),o(r(99),t),t.encodeParams=function e(t,r=!0,n=null){if(null==t)return"";const o=[],s=r?encodeURIComponent:e=>e;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const a=t[i],c=n?`${n}[${s(i)}]`:s(i);if("object"==typeof a){const t=e(a,r,c);""!==t&&o.push(t)}else Array.isArray(a)?a.forEach(((e,t)=>{const r=`${c}[${t}]`;o.push(`${s(r)}=${s(e)}`)})):o.push(`${s(c)}=${s(a)}`)}return o.join("&")},t.isAbsoluteURL=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},t.joinPath=function(e,t){return t?(e.endsWith("/")?e:e+"/")+(t.startsWith("/")?t.slice(1):t):e};class s extends Error{constructor(e,t,r){super(e),this.name="XiorError",this.request=t,this.config=t,this.response=r}}t.XiorError=s,t.XiorTimeoutError=class extends s{constructor(e,t,r){super(e),this.name="XiorTimeoutError",this.request=t,this.config=t,this.response=r}},t.isXiorError=function(e){return"XiorError"===e.name||"XiorTimeoutError"===e.name}},895:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.xior=void 0;const c=s(r(393)),u=r(976),l="undefined"!=typeof AbortController;class d{static create(e){return new d(e)}constructor(e){this.requestInterceptors=[c.default],this.responseInterceptors=[],this._plugins=[],this.config=e,this.defaults={params:{},headers:{}}}get interceptors(){return{request:{use:(e,t)=>(this.requestInterceptors.push(e),e),eject:e=>{this.requestInterceptors=this.requestInterceptors.filter((t=>t!==e))},clear:()=>{this.requestInterceptors=[this.requestInterceptors[0]]}},response:{use:(e,t)=>(this.responseInterceptors.push({fn:e,onRejected:t}),e),eject:e=>{this.responseInterceptors=this.responseInterceptors.filter((t=>t.fn!==e))},clear:()=>{this.responseInterceptors=[]}}}}get plugins(){return{use:e=>(this._plugins.push(e),e),eject:e=>{this._plugins=this._plugins.filter((t=>t!==e))},clear:()=>{this._plugins=[]}}}request(e){return i(this,void 0,void 0,(function*(){let t=(0,u.merge)({},this.config||{},this.defaults||{},"string"==typeof e?{url:e}:e||{},{headers:{},params:{}});for(const e of this.requestInterceptors)t=yield e(t);let r=this.handlerFetch.bind(this);return this._plugins.forEach((e=>{r=e(r)})),r(t)}))}handlerFetch(e){var t,r;return i(this,void 0,void 0,(function*(){if(this._plugins.length>0)for(const t of this.requestInterceptors.slice(1))e=yield t(e);const{url:n,method:o,headers:s,timeout:i,signal:d,data:f,_data:p}=e,h=a(e,["url","method","headers","timeout","signal","data","_data"]);let b;const y=[];let g;if(i&&l){const t=new AbortController;g=setTimeout((()=>{t.abort(new u.XiorTimeoutError(`timeout of ${i}ms exceeded`,e))}),i),y.push(t.signal)}d&&y.push(d),b=y[0],y.length>1&&(b=(0,u.anySignal)(y,(()=>{clearTimeout(g)})));let m=e._url||n||"";e.baseURL&&!(0,u.isAbsoluteURL)(m)&&(m=(0,u.joinPath)(e.baseURL,m));const O=yield fetch(m,Object.assign(Object.assign({body:(0,c.likeGET)(e.method)?void 0:p},h),{signal:b,method:o,headers:s}));g&&clearTimeout(g),null===(t=null==b?void 0:b.clear)||void 0===t||t.call(b);const v={response:O,config:e,status:O.status,statusText:O.statusText,headers:O.headers};if(!O.ok){let t;try{t=yield O.text(),t&&(t=JSON.parse(t))}catch(e){}const n=new u.XiorError(O.status?`Request failed with status code ${O.status}`:"Network error",e,Object.assign({data:t},v));for(const e of this.responseInterceptors)if(e.onRejected){const t=yield e.onRejected(n);if(null===(r=null==t?void 0:t.response)||void 0===r?void 0:r.ok)return t}throw n}if("HEAD"===e.method)return Object.assign({data:void 0,request:e},v);const{responseType:j}=e;if(!j||"json"===j||"text"===j){let t;try{t=yield O.text(),t&&"text"!==j&&(t=JSON.parse(t))}catch(e){}let r={data:t,request:e,response:O};for(const e of this.responseInterceptors)r=yield e.fn(r);return Object.assign({data:r.data,request:e},v)}return Object.assign({data:void 0,request:e},v)}))}createGetHandler(e){return(t,r)=>this.request(r?Object.assign(Object.assign({},r),{method:e,url:t}):{method:e,url:t})}createPostHandler(e){return(t,r,n)=>this.request(n?Object.assign(Object.assign({},n),{method:e,url:t,data:r}):{method:e,url:t,data:r})}get(e,t){return this.createGetHandler("GET")(e,t)}head(e,t){return this.createGetHandler("HEAD")(e,t)}post(e,t,r){return this.createPostHandler("POST")(e,t,r)}put(e,t,r){return this.createPostHandler("PUT")(e,t,r)}patch(e,t,r){return this.createPostHandler("PATCH")(e,t,r)}delete(e,t){return this.createGetHandler("DELETE")(e,t)}options(e,t){return this.createGetHandler("OPTIONS")(e,t)}}t.xior=d,d.VERSION="0.2.5"},602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;const r=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1};t.merge=(...e)=>e.reduce(((e,n)=>{if(Array.isArray(n))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(n).forEach((o=>{["__proto__","constructor","prototype"].includes(o)||(Array.isArray(e[o])&&Array.isArray(n[o])?e[o]=t.merge.options.mergeArrays?t.merge.options.uniqueArrayItems?Array.from(new Set(e[o].concat(n[o]))):[...e[o],...n[o]]:n[o]:r(e[o])&&r(n[o])?e[o]=(0,t.merge)(e[o],n[o]):e[o]=void 0===n[o]?t.merge.options.allowUndefinedOverrides?n[o]:e[o]:n[o])})),e}),{});const n={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};t.merge.options=n,t.merge.withOptions=(e,...r)=>{t.merge.options=Object.assign(Object.assign({},n),e);const o=(0,t.merge)(...r);return t.merge.options=n,o}}},t={},r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(509);return r.default})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.xior=t():e.xior=t()}(this,(()=>(()=>{"use strict";var e={699:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.anySignal=void 0,t.anySignal=function(e,t){const r=new globalThis.AbortController;function o(e){r.abort(e),i()}const n=[];for(const t of e){if(!0===(null==t?void 0:t.aborted)){o(t.reason);break}if(null!=(null==t?void 0:t.addEventListener)){const e=()=>{o(t.reason)};n.push((()=>{null!=(null==t?void 0:t.removeEventListener)&&t.removeEventListener("abort",e)})),t.addEventListener("abort",e)}}function i(){n.forEach((e=>{e()})),null==t||t()}const s=r.signal;return s.clear=i,s}},509:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const i=r(895);n(r(895),t),n(r(340),t),n(r(976),t);const s=Object.assign(i.xior.create(),{create:i.xior.create,VERSION:i.xior.VERSION});t.default=s},393:function(e,t,r){var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.likeGET=t.formUrl=void 0;const n=r(976);t.formUrl="application/x-www-form-urlencoded";const i="application/json";function s(e="GET"){return["HEAD","GET","DELETE","OPTIONS"].includes(e)}t.likeGET=s,t.default=function(e){return o(this,void 0,void 0,(function*(){const r=e.encode||e.paramsSerializer||n.encodeParams,o=!1!==e.encodeURI,a=e.method?e.method.toUpperCase():"GET";let c=e.url||"";const u=c,l=e.data;let d=l,f=!1;const p=(null==e?void 0:e.headers)||{};if(l&&!(l instanceof FormData)){let u="";if(null==e?void 0:e.headers){const t=Object.keys(e.headers).find((e=>"content-type"===e.toLowerCase()));t&&(u=e.headers[t],e.headers["Content-Type"]=u,delete e.headers[t])}if(u||(u=s(a)?t.formUrl:i,p["Content-Type"]=u),u!==t.formUrl||"object"!=typeof l&&!e.params)u===i&&(d=JSON.stringify(l));else{f=!0;const t=r((0,n.merge)(l||{},e.params||{}),o);t&&(c+=c.includes("?")?`&${t}`:`?${t}`)}}return!f&&e.params&&Object.keys(e.params).length>0&&(c+=c.includes("?")?`&${r(e.params,o)}`:`?${r(e.params,o)}`),Object.assign(Object.assign({},e),{data:l,_data:d,url:u,_url:c,method:a,headers:p,encode:r,paramsSerializer:r})}))}},729:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;const o=r(602);Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return o.merge}})},629:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let o=t?r(t):"";o&&(o=e+(e.includes("?")?"&"+o:"?"+o));const[n,i]=o.split("?");return i?`${n}?${i.split("&").sort().join("&")}`:o||e}},99:function(e,t,r){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.delay=t.buildSortedURL=void 0;const n=o(r(629));t.buildSortedURL=n.default,t.delay=function(e){return new Promise((t=>{setTimeout((()=>{t("ok")}),e)}))}},340:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},976:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isXiorError=t.XiorTimeoutError=t.XiorError=t.joinPath=t.isAbsoluteURL=t.encodeParams=void 0,n(r(699),t),n(r(729),t),n(r(99),t),t.encodeParams=function e(t,r=!0,o=null){if(null==t)return"";const n=[],i=r?encodeURIComponent:e=>e;for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const a=t[s],c=o?`${o}[${i(s)}]`:i(s);if("object"==typeof a){const t=e(a,r,c);""!==t&&n.push(t)}else Array.isArray(a)?a.forEach(((e,t)=>{const r=`${c}[${t}]`;n.push(`${i(r)}=${i(e)}`)})):n.push(`${i(c)}=${i(a)}`)}return n.join("&")},t.isAbsoluteURL=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},t.joinPath=function(e,t){return t?(e.endsWith("/")?e:e+"/")+(t.startsWith("/")?t.slice(1):t):e};class i extends Error{constructor(e,t,r){super(e),this.name="XiorError",this.request=t,this.config=t,this.response=r}}t.XiorError=i,t.XiorTimeoutError=class extends i{constructor(e,t,r){super(e),this.name="XiorTimeoutError",this.request=t,this.config=t,this.response=r}},t.isXiorError=function(e){return"XiorError"===e.name||"XiorTimeoutError"===e.name}},895:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return n(t,e),t},s=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))},a=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.xior=void 0;const c=i(r(393)),u=r(976),l="undefined"!=typeof AbortController;class d{static create(e){return new d(e)}constructor(e){this.REQI=[c.default],this.RESI=[],this._plugins=[],this.config=e,this.defaults={params:{},headers:{}}}get interceptors(){return{request:{use:(e,t)=>(this.REQI.push(e),e),eject:e=>{this.REQI=this.REQI.filter((t=>t!==e))},clear:()=>{this.REQI=[this.REQI[0]]}},response:{use:(e,t)=>(this.RESI.push({fn:e,onRejected:t}),e),eject:e=>{this.RESI=this.RESI.filter((t=>t.fn!==e))},clear:()=>{this.RESI=[]}}}}get plugins(){return{use:e=>(this._plugins.push(e),e),eject:e=>{this._plugins=this._plugins.filter((t=>t!==e))},clear:()=>{this._plugins=[]}}}request(e){return s(this,void 0,void 0,(function*(){let t=(0,u.merge)({},this.config||{},this.defaults||{},"string"==typeof e?{url:e}:e||{},{headers:{},params:{}});for(const e of this.REQI)t=yield e(t);let r=this.fetch.bind(this);return this._plugins.forEach((e=>{r=e(r)})),r(t)}))}fetch(e){var t,r,o;return s(this,void 0,void 0,(function*(){if(this._plugins.length>0)for(const t of this.REQI.slice(1))e=yield t(e);const{url:n,method:i,headers:s,timeout:d,signal:f,data:p,_data:h}=e,b=a(e,["url","method","headers","timeout","signal","data","_data"]);let y;const m=[];let g;if(d&&l){const t=new AbortController;g=setTimeout((()=>{t.abort(new u.XiorTimeoutError(`timeout of ${d}ms exceeded`,e))}),d),m.push(t.signal)}f&&m.push(f),y=m[0],m.length>1&&(y=(0,u.anySignal)(m,(()=>{clearTimeout(g)})));let v=e._url||n||"";e.baseURL&&!(0,u.isAbsoluteURL)(v)&&(v=(0,u.joinPath)(e.baseURL,v));const O=yield fetch(v,Object.assign(Object.assign({body:(0,c.likeGET)(e.method)||(null===(t=e.headers)||void 0===t?void 0:t["Content-Type"])===c.formUrl?void 0:h},b),{signal:y,method:i,headers:s}));g&&clearTimeout(g),null===(r=null==y?void 0:y.clear)||void 0===r||r.call(y);const j={response:O,config:e,status:O.status,statusText:O.statusText,headers:O.headers};if(!O.ok){let t;try{t=yield O.text(),t&&(t=JSON.parse(t))}catch(e){}const r=new u.XiorError(O.status?`Request failed with status code ${O.status}`:"Network error",e,Object.assign({data:t},j));for(const e of this.RESI)if(e.onRejected){const t=yield e.onRejected(r);if(null===(o=null==t?void 0:t.response)||void 0===o?void 0:o.ok)return t}throw r}if("HEAD"===e.method)return Object.assign({data:void 0,request:e},j);const{responseType:_}=e;if(!_||"json"===_||"text"===_){let t;try{t=yield O.text(),t&&"text"!==_&&(t=JSON.parse(t))}catch(e){}let r={data:t,request:e,response:O};for(const e of this.RESI)r=yield e.fn(r);return Object.assign({data:r.data,request:e},j)}return Object.assign({data:void 0,request:e},j)}))}createGet(e){return(t,r)=>this.request(r?Object.assign(Object.assign({},r),{method:e,url:t}):{method:e,url:t})}createPost(e){return(t,r,o)=>this.request(o?Object.assign(Object.assign({},o),{method:e,url:t,data:r}):{method:e,url:t,data:r})}get(e,t){return this.createGet("GET")(e,t)}head(e,t){return this.createGet("HEAD")(e,t)}post(e,t,r){return this.createPost("POST")(e,t,r)}put(e,t,r){return this.createPost("PUT")(e,t,r)}patch(e,t,r){return this.createPost("PATCH")(e,t,r)}delete(e,t){return this.createGet("DELETE")(e,t)}options(e,t){return this.createGet("OPTIONS")(e,t)}}t.xior=d,d.VERSION="0.2.6"},602:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.merge=void 0;const r=e=>{if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1};t.merge=(...e)=>e.reduce(((e,o)=>{if(Array.isArray(o))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(o).forEach((n=>{["__proto__","constructor","prototype"].includes(n)||(Array.isArray(e[n])&&Array.isArray(o[n])?e[n]=t.merge.options.mergeArrays?t.merge.options.uniqueArrayItems?Array.from(new Set(e[n].concat(o[n]))):[...e[n],...o[n]]:o[n]:r(e[n])&&r(o[n])?e[n]=(0,t.merge)(e[n],o[n]):e[n]=void 0===o[n]?t.merge.options.allowUndefinedOverrides?o[n]:e[n]:o[n])})),e}),{});const o={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};t.merge.options=o,t.merge.withOptions=(e,...r)=>{t.merge.options=Object.assign(Object.assign({},o),e);const n=(0,t.merge)(...r);return t.merge.options=o,n}}},t={},r=function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,r),i.exports}(509);return r.default})()));

@@ -64,4 +64,4 @@ [Go back](./README.md)

```html
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/plugins/mock.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/plugins/mock.umd.js"></script>

@@ -83,4 +83,4 @@ <!-- Usage -->

```html
<script src="https://unpkg.com/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.5/plugins/mock.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/plugins/mock.umd.js"></script>

@@ -87,0 +87,0 @@ <!-- Usage -->

{
"name": "xior",
"version": "0.2.5",
"version": "0.2.6",
"description": "A lite request lib based on fetch with plugins support, and axios similar API",

@@ -5,0 +5,0 @@ "repository": "suhaotian/xior",

@@ -74,4 +74,6 @@ interface XiorRequestConfig<T = any> extends Omit<RequestInit, 'body'> {

constructor(options?: XiorRequestConfig);
requestInterceptors: ((config: XiorInterceptorRequestConfig) => Promise<XiorInterceptorRequestConfig> | XiorInterceptorRequestConfig)[];
responseInterceptors: {
/** request interceptors */
REQI: ((config: XiorInterceptorRequestConfig) => Promise<XiorInterceptorRequestConfig> | XiorInterceptorRequestConfig)[];
/** response interceptors */
RESI: {
fn: (config: {

@@ -147,5 +149,5 @@ data: any;

request<T>(options?: XiorRequestConfig | string): Promise<XiorResponse<T>>;
handlerFetch<T>(requestConfig: XiorRequestConfig): Promise<XiorResponse<T>>;
createGetHandler<T>(method: string): (url: string, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
createPostHandler<T>(method: string): (url: string, data?: any, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
fetch<T>(requestConfig: XiorRequestConfig): Promise<XiorResponse<T>>;
createGet<T>(method: string): (url: string, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
createPost<T>(method: string): (url: string, data?: any, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
get<T = any>(url: string, options?: XiorRequestConfig): Promise<XiorResponse<T>>;

@@ -152,0 +154,0 @@ head<T = any>(url: string, options?: XiorRequestConfig): Promise<XiorResponse<T>>;

@@ -74,4 +74,6 @@ interface XiorRequestConfig<T = any> extends Omit<RequestInit, 'body'> {

constructor(options?: XiorRequestConfig);
requestInterceptors: ((config: XiorInterceptorRequestConfig) => Promise<XiorInterceptorRequestConfig> | XiorInterceptorRequestConfig)[];
responseInterceptors: {
/** request interceptors */
REQI: ((config: XiorInterceptorRequestConfig) => Promise<XiorInterceptorRequestConfig> | XiorInterceptorRequestConfig)[];
/** response interceptors */
RESI: {
fn: (config: {

@@ -147,5 +149,5 @@ data: any;

request<T>(options?: XiorRequestConfig | string): Promise<XiorResponse<T>>;
handlerFetch<T>(requestConfig: XiorRequestConfig): Promise<XiorResponse<T>>;
createGetHandler<T>(method: string): (url: string, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
createPostHandler<T>(method: string): (url: string, data?: any, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
fetch<T>(requestConfig: XiorRequestConfig): Promise<XiorResponse<T>>;
createGet<T>(method: string): (url: string, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
createPost<T>(method: string): (url: string, data?: any, options?: XiorRequestConfig) => Promise<XiorResponse<T>>;
get<T = any>(url: string, options?: XiorRequestConfig): Promise<XiorResponse<T>>;

@@ -152,0 +154,0 @@ head<T = any>(url: string, options?: XiorRequestConfig): Promise<XiorResponse<T>>;

@@ -114,3 +114,3 @@ [![Build](https://github.com/suhaotian/xior/actions/workflows/check.yml/badge.svg)](https://github.com/suhaotian/xior/actions/workflows/check.yml)

> Since v0.2.1, xior support UMD format now :()
> Since v0.2.1, xior support UMD format

@@ -120,3 +120,3 @@ Use jsDelivr CDN:

```html
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/dist/xior.umd.js"></script>

@@ -136,3 +136,3 @@ <!-- Usage -->

```html
<script src="https://unpkg.com/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/dist/xior.umd.js"></script>

@@ -448,5 +448,5 @@ <!-- Usage -->

```html
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/plugins/error-retry.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/plugins/error-retry.umd.js"></script>

@@ -464,6 +464,6 @@ <!-- Usage -->

```html
<script src="https://unpkg.com/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://unpkg.com/xior@0.2.5/plugins/error-retry.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/plugins/error-retry.umd.js"></script>

@@ -551,5 +551,5 @@ <!-- Usage -->

```html
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/plugins/throttle.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/plugins/throttle.umd.js"></script>

@@ -567,6 +567,6 @@ <!-- Usage -->

```html
<script src="https://unpkg.com/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://unpkg.com/xior@0.2.5/plugins/throttle.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/plugins/throttle.umd.js"></script>

@@ -619,5 +619,5 @@ <!-- Usage -->

```html
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/plugins/dedupe.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/plugins/dedupe.umd.js"></script>

@@ -635,6 +635,6 @@ <!-- Usage -->

```html
<script src="https://unpkg.com/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://unpkg.com/xior@0.2.5/plugins/dedupe.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/plugins/dedupe.umd.js"></script>

@@ -697,5 +697,5 @@ <!-- Usage -->

```html
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/plugins/error-cache.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/plugins/error-cache.umd.js"></script>

@@ -713,6 +713,6 @@ <!-- Usage -->

```html
<script src="https://unpkg.com/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://unpkg.com/xior@0.2.5/plugins/error-cache.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/plugins/error-cache.umd.js"></script>

@@ -852,5 +852,5 @@ <!-- Usage -->

```html
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/plugins/progress.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/plugins/progress.umd.js"></script>

@@ -868,6 +868,6 @@ <!-- Usage -->

```html
<script src="https://unpkg.com/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://unpkg.com/xior@0.2.5/plugins/progress.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/plugins/progress.umd.js"></script>

@@ -979,5 +979,5 @@ <!-- Usage -->

```html
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.5/plugins/mock.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/xior@0.2.6/plugins/mock.umd.js"></script>

@@ -995,6 +995,6 @@ <!-- Usage -->

```html
<script src="https://unpkg.com/xior@0.2.5/dist/xior.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/dist/xior.umd.js"></script>
<!-- Load plugin -->
<script src="https://unpkg.com/xior@0.2.5/plugins/mock.umd.js"></script>
<script src="https://unpkg.com/xior@0.2.6/plugins/mock.umd.js"></script>

@@ -1001,0 +1001,0 @@ <!-- Usage -->

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc