vue-request
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -5,2 +5,8 @@ # Changelog | ||
### [1.2.2](https://github.com/attojs/vue-request/compare/v1.2.1...v1.2.2) (2021-10-06) | ||
### Bug Fixes | ||
- Fix nullish operator is not transform | ||
### [1.2.1](https://github.com/attojs/vue-request/compare/v1.2.0...v1.2.1) (2021-10-06) | ||
@@ -7,0 +13,0 @@ |
@@ -5,2 +5,8 @@ # Changelog | ||
### [1.2.2](https://github.com/attojs/vue-request/compare/v1.2.1...v1.2.2) (2021-10-06) | ||
### Bug Fixes | ||
- 修复 nullish 操作符没有没转换的问题 | ||
### [1.2.1](https://github.com/attojs/vue-request/compare/v1.2.0...v1.2.1) (2021-10-06) | ||
@@ -7,0 +13,0 @@ |
@@ -59,5 +59,5 @@ 'use strict'; | ||
const isOnline = () => { | ||
var _window2, _window2$navigator; | ||
var _ref, _window2, _window2$navigator; | ||
return (!isServer && ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$navigator = _window2.navigator) === null || _window2$navigator === void 0 ? void 0 : _window2$navigator.onLine)) ?? true; | ||
return (_ref = !isServer && ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$navigator = _window2.navigator) === null || _window2$navigator === void 0 ? void 0 : _window2$navigator.onLine)) !== null && _ref !== void 0 ? _ref : true; | ||
}; | ||
@@ -391,2 +391,4 @@ const unRefObject = val => { | ||
const createQuery = (query, config, initialState) => { | ||
var _initialState$loading, _initialState$data, _initialState$params; | ||
const { | ||
@@ -416,6 +418,6 @@ initialAutoRunFlag, | ||
const retriedCount = vue.ref(0); | ||
const loading = vue.ref((initialState === null || initialState === void 0 ? void 0 : initialState.loading) ?? false); | ||
const data = vue.ref((initialState === null || initialState === void 0 ? void 0 : initialState.data) ?? initialData); | ||
const loading = vue.ref((_initialState$loading = initialState === null || initialState === void 0 ? void 0 : initialState.loading) !== null && _initialState$loading !== void 0 ? _initialState$loading : false); | ||
const data = vue.ref((_initialState$data = initialState === null || initialState === void 0 ? void 0 : initialState.data) !== null && _initialState$data !== void 0 ? _initialState$data : initialData); | ||
const error = vue.ref(initialState === null || initialState === void 0 ? void 0 : initialState.error); | ||
const params = vue.ref((initialState === null || initialState === void 0 ? void 0 : initialState.params) ?? []); | ||
const params = vue.ref((_initialState$params = initialState === null || initialState === void 0 ? void 0 : initialState.params) !== null && _initialState$params !== void 0 ? _initialState$params : []); | ||
const setState = setStateBind({ | ||
@@ -717,3 +719,3 @@ loading, | ||
const updateCache = state => { | ||
var _getCache; | ||
var _getCache, _queryKey; | ||
@@ -724,3 +726,3 @@ if (!cacheKey) return; | ||
const queryData = unRefObject(state); | ||
const currentQueryKey = (queryKey === null || queryKey === void 0 ? void 0 : queryKey(...state.params.value)) ?? QUERY_DEFAULT_KEY; | ||
const currentQueryKey = (_queryKey = queryKey === null || queryKey === void 0 ? void 0 : queryKey(...state.params.value)) !== null && _queryKey !== void 0 ? _queryKey : QUERY_DEFAULT_KEY; | ||
setCache(cacheKey, { | ||
@@ -758,4 +760,8 @@ queries: { ...cacheQueries, | ||
const latestQueriesKey = vue.ref(QUERY_DEFAULT_KEY); | ||
const latestQuery = vue.computed(() => queries[latestQueriesKey.value] ?? {}); // sync state | ||
const latestQuery = vue.computed(() => { | ||
var _queries$latestQuerie; | ||
return (_queries$latestQuerie = queries[latestQueriesKey.value]) !== null && _queries$latestQuerie !== void 0 ? _queries$latestQuerie : {}; | ||
}); // sync state | ||
vue.watch(latestQuery, queryData => { | ||
@@ -798,2 +804,4 @@ loading.value = queryData.loading; | ||
const run = (...args) => { | ||
var _queryKey2; | ||
if (!ready.value && !hasTriggerReady.value) { | ||
@@ -804,3 +812,3 @@ tempReadyParams.value = args; | ||
const newKey = (queryKey === null || queryKey === void 0 ? void 0 : queryKey(...args)) ?? QUERY_DEFAULT_KEY; | ||
const newKey = (_queryKey2 = queryKey === null || queryKey === void 0 ? void 0 : queryKey(...args)) !== null && _queryKey2 !== void 0 ? _queryKey2 : QUERY_DEFAULT_KEY; | ||
@@ -838,6 +846,8 @@ if (!queries[newKey]) { | ||
if (!manual) { | ||
var _cache$data$queries; | ||
initialAutoRunFlag.value = true; // TODO: need refactor | ||
const cache = getCache(cacheKey); | ||
const cacheQueries = (cache === null || cache === void 0 ? void 0 : cache.data.queries) ?? {}; | ||
const cacheQueries = (_cache$data$queries = cache === null || cache === void 0 ? void 0 : cache.data.queries) !== null && _cache$data$queries !== void 0 ? _cache$data$queries : {}; | ||
const isFresh = cache && (staleTime === -1 || cache.cacheTime + staleTime > new Date().getTime()); | ||
@@ -919,2 +929,4 @@ const hasCacheQueries = Object.keys(cacheQueries).length > 0; | ||
function useLoadMore(service, options) { | ||
var _injectedGlobalOption; | ||
if (!isFunction(service)) { | ||
@@ -932,4 +944,4 @@ warning('useLoadMore only support function service'); | ||
} = Object.assign({ | ||
listKey: injectedGlobalOptions.listKey ?? getGlobalOptions().listKey | ||
}, options ?? {}); | ||
listKey: (_injectedGlobalOption = injectedGlobalOptions.listKey) !== null && _injectedGlobalOption !== void 0 ? _injectedGlobalOption : getGlobalOptions().listKey | ||
}, options !== null && options !== void 0 ? options : {}); | ||
@@ -1064,2 +1076,4 @@ if (queryKey) { | ||
function usePagination(service, options) { | ||
var _getGlobalOptions$pag, _injectedGlobalOption; | ||
const promiseQuery = generateService(service); | ||
@@ -1085,6 +1099,6 @@ const defaultOptions = { | ||
} = merge(defaultOptions, { | ||
pagination: getGlobalOptions().pagination ?? {} | ||
pagination: (_getGlobalOptions$pag = getGlobalOptions().pagination) !== null && _getGlobalOptions$pag !== void 0 ? _getGlobalOptions$pag : {} | ||
}, { | ||
pagination: injectedGlobalOptions.pagination ?? {} | ||
}, options ?? {}); | ||
pagination: (_injectedGlobalOption = injectedGlobalOptions.pagination) !== null && _injectedGlobalOption !== void 0 ? _injectedGlobalOption : {} | ||
}, options !== null && options !== void 0 ? options : {}); | ||
@@ -1160,5 +1174,5 @@ if (queryKey) { | ||
get: () => { | ||
var _params$value$; | ||
var _params$value$0$curre, _params$value$; | ||
return ((_params$value$ = params.value[0]) === null || _params$value$ === void 0 ? void 0 : _params$value$[currentKey]) ?? finallyOptions.defaultParams[0][currentKey]; | ||
return (_params$value$0$curre = (_params$value$ = params.value[0]) === null || _params$value$ === void 0 ? void 0 : _params$value$[currentKey]) !== null && _params$value$0$curre !== void 0 ? _params$value$0$curre : finallyOptions.defaultParams[0][currentKey]; | ||
}, | ||
@@ -1171,5 +1185,5 @@ set: val => { | ||
get: () => { | ||
var _params$value$2; | ||
var _params$value$0$pageS, _params$value$2; | ||
return ((_params$value$2 = params.value[0]) === null || _params$value$2 === void 0 ? void 0 : _params$value$2[pageSizeKey]) ?? finallyOptions.defaultParams[0][pageSizeKey]; | ||
return (_params$value$0$pageS = (_params$value$2 = params.value[0]) === null || _params$value$2 === void 0 ? void 0 : _params$value$2[pageSizeKey]) !== null && _params$value$0$pageS !== void 0 ? _params$value$0$pageS : finallyOptions.defaultParams[0][pageSizeKey]; | ||
}, | ||
@@ -1204,3 +1218,3 @@ set: val => { | ||
...rest | ||
} = useAsyncQuery(promiseQuery, options ?? {}); | ||
} = useAsyncQuery(promiseQuery, options !== null && options !== void 0 ? options : {}); | ||
const reloading = vue.ref(false); | ||
@@ -1207,0 +1221,0 @@ |
@@ -55,5 +55,5 @@ import { defineComponent, provide, unref, ref, computed, inject, reactive, watch, onUnmounted, watchEffect } from 'vue'; | ||
const isOnline = () => { | ||
var _window2, _window2$navigator; | ||
var _ref, _window2, _window2$navigator; | ||
return (!isServer && ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$navigator = _window2.navigator) === null || _window2$navigator === void 0 ? void 0 : _window2$navigator.onLine)) ?? true; | ||
return (_ref = !isServer && ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$navigator = _window2.navigator) === null || _window2$navigator === void 0 ? void 0 : _window2$navigator.onLine)) !== null && _ref !== void 0 ? _ref : true; | ||
}; | ||
@@ -387,2 +387,4 @@ const unRefObject = val => { | ||
const createQuery = (query, config, initialState) => { | ||
var _initialState$loading, _initialState$data, _initialState$params; | ||
const { | ||
@@ -412,6 +414,6 @@ initialAutoRunFlag, | ||
const retriedCount = ref(0); | ||
const loading = ref((initialState === null || initialState === void 0 ? void 0 : initialState.loading) ?? false); | ||
const data = ref((initialState === null || initialState === void 0 ? void 0 : initialState.data) ?? initialData); | ||
const loading = ref((_initialState$loading = initialState === null || initialState === void 0 ? void 0 : initialState.loading) !== null && _initialState$loading !== void 0 ? _initialState$loading : false); | ||
const data = ref((_initialState$data = initialState === null || initialState === void 0 ? void 0 : initialState.data) !== null && _initialState$data !== void 0 ? _initialState$data : initialData); | ||
const error = ref(initialState === null || initialState === void 0 ? void 0 : initialState.error); | ||
const params = ref((initialState === null || initialState === void 0 ? void 0 : initialState.params) ?? []); | ||
const params = ref((_initialState$params = initialState === null || initialState === void 0 ? void 0 : initialState.params) !== null && _initialState$params !== void 0 ? _initialState$params : []); | ||
const setState = setStateBind({ | ||
@@ -713,3 +715,3 @@ loading, | ||
const updateCache = state => { | ||
var _getCache; | ||
var _getCache, _queryKey; | ||
@@ -720,3 +722,3 @@ if (!cacheKey) return; | ||
const queryData = unRefObject(state); | ||
const currentQueryKey = (queryKey === null || queryKey === void 0 ? void 0 : queryKey(...state.params.value)) ?? QUERY_DEFAULT_KEY; | ||
const currentQueryKey = (_queryKey = queryKey === null || queryKey === void 0 ? void 0 : queryKey(...state.params.value)) !== null && _queryKey !== void 0 ? _queryKey : QUERY_DEFAULT_KEY; | ||
setCache(cacheKey, { | ||
@@ -754,4 +756,8 @@ queries: { ...cacheQueries, | ||
const latestQueriesKey = ref(QUERY_DEFAULT_KEY); | ||
const latestQuery = computed(() => queries[latestQueriesKey.value] ?? {}); // sync state | ||
const latestQuery = computed(() => { | ||
var _queries$latestQuerie; | ||
return (_queries$latestQuerie = queries[latestQueriesKey.value]) !== null && _queries$latestQuerie !== void 0 ? _queries$latestQuerie : {}; | ||
}); // sync state | ||
watch(latestQuery, queryData => { | ||
@@ -794,2 +800,4 @@ loading.value = queryData.loading; | ||
const run = (...args) => { | ||
var _queryKey2; | ||
if (!ready.value && !hasTriggerReady.value) { | ||
@@ -800,3 +808,3 @@ tempReadyParams.value = args; | ||
const newKey = (queryKey === null || queryKey === void 0 ? void 0 : queryKey(...args)) ?? QUERY_DEFAULT_KEY; | ||
const newKey = (_queryKey2 = queryKey === null || queryKey === void 0 ? void 0 : queryKey(...args)) !== null && _queryKey2 !== void 0 ? _queryKey2 : QUERY_DEFAULT_KEY; | ||
@@ -834,6 +842,8 @@ if (!queries[newKey]) { | ||
if (!manual) { | ||
var _cache$data$queries; | ||
initialAutoRunFlag.value = true; // TODO: need refactor | ||
const cache = getCache(cacheKey); | ||
const cacheQueries = (cache === null || cache === void 0 ? void 0 : cache.data.queries) ?? {}; | ||
const cacheQueries = (_cache$data$queries = cache === null || cache === void 0 ? void 0 : cache.data.queries) !== null && _cache$data$queries !== void 0 ? _cache$data$queries : {}; | ||
const isFresh = cache && (staleTime === -1 || cache.cacheTime + staleTime > new Date().getTime()); | ||
@@ -915,2 +925,4 @@ const hasCacheQueries = Object.keys(cacheQueries).length > 0; | ||
function useLoadMore(service, options) { | ||
var _injectedGlobalOption; | ||
if (!isFunction(service)) { | ||
@@ -928,4 +940,4 @@ warning('useLoadMore only support function service'); | ||
} = Object.assign({ | ||
listKey: injectedGlobalOptions.listKey ?? getGlobalOptions().listKey | ||
}, options ?? {}); | ||
listKey: (_injectedGlobalOption = injectedGlobalOptions.listKey) !== null && _injectedGlobalOption !== void 0 ? _injectedGlobalOption : getGlobalOptions().listKey | ||
}, options !== null && options !== void 0 ? options : {}); | ||
@@ -1060,2 +1072,4 @@ if (queryKey) { | ||
function usePagination(service, options) { | ||
var _getGlobalOptions$pag, _injectedGlobalOption; | ||
const promiseQuery = generateService(service); | ||
@@ -1081,6 +1095,6 @@ const defaultOptions = { | ||
} = merge(defaultOptions, { | ||
pagination: getGlobalOptions().pagination ?? {} | ||
pagination: (_getGlobalOptions$pag = getGlobalOptions().pagination) !== null && _getGlobalOptions$pag !== void 0 ? _getGlobalOptions$pag : {} | ||
}, { | ||
pagination: injectedGlobalOptions.pagination ?? {} | ||
}, options ?? {}); | ||
pagination: (_injectedGlobalOption = injectedGlobalOptions.pagination) !== null && _injectedGlobalOption !== void 0 ? _injectedGlobalOption : {} | ||
}, options !== null && options !== void 0 ? options : {}); | ||
@@ -1156,5 +1170,5 @@ if (queryKey) { | ||
get: () => { | ||
var _params$value$; | ||
var _params$value$0$curre, _params$value$; | ||
return ((_params$value$ = params.value[0]) === null || _params$value$ === void 0 ? void 0 : _params$value$[currentKey]) ?? finallyOptions.defaultParams[0][currentKey]; | ||
return (_params$value$0$curre = (_params$value$ = params.value[0]) === null || _params$value$ === void 0 ? void 0 : _params$value$[currentKey]) !== null && _params$value$0$curre !== void 0 ? _params$value$0$curre : finallyOptions.defaultParams[0][currentKey]; | ||
}, | ||
@@ -1167,5 +1181,5 @@ set: val => { | ||
get: () => { | ||
var _params$value$2; | ||
var _params$value$0$pageS, _params$value$2; | ||
return ((_params$value$2 = params.value[0]) === null || _params$value$2 === void 0 ? void 0 : _params$value$2[pageSizeKey]) ?? finallyOptions.defaultParams[0][pageSizeKey]; | ||
return (_params$value$0$pageS = (_params$value$2 = params.value[0]) === null || _params$value$2 === void 0 ? void 0 : _params$value$2[pageSizeKey]) !== null && _params$value$0$pageS !== void 0 ? _params$value$0$pageS : finallyOptions.defaultParams[0][pageSizeKey]; | ||
}, | ||
@@ -1200,3 +1214,3 @@ set: val => { | ||
...rest | ||
} = useAsyncQuery(promiseQuery, options ?? {}); | ||
} = useAsyncQuery(promiseQuery, options !== null && options !== void 0 ? options : {}); | ||
const reloading = ref(false); | ||
@@ -1203,0 +1217,0 @@ |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"use strict";const n={},a=Symbol("GLOBAL_OPTIONS_PROVIDE_KEY"),r=()=>n,o=t.defineComponent({name:"RequestConfig",props:{config:{type:Object,required:!0}},setup(e,{slots:n}){const{config:r}=e;return t.provide(a,r),()=>{var e;return null===(e=n.default)||void 0===e?void 0:e.call(n)}}}),u=Object.prototype.toString,i=e=>u.call(e),l=e=>"[object Object]"===i(e),c=e=>null!==e&&"object"==typeof e,s=e=>e instanceof Function,d=e=>null==e,v="undefined"==typeof window,f=()=>{var e,t;return!v&&"visible"===(null===(e=window)||void 0===e||null===(t=e.document)||void 0===t?void 0:t.visibilityState)},g=()=>{var e,t;return(!v&&(null===(e=window)||void 0===e||null===(t=e.navigator)||void 0===t?void 0:t.onLine))??!0},m=Promise.resolve(null),p=async(...e)=>{const t=await fetch(...e);if(t.ok)return t.json();throw new Error(t.statusText)},h=(e,t,n)=>{const a=t.replace(/\[(\d+)\]/g,".$1").split(".");let r=e;for(const e of a)if(r=Object(r)[e],void 0===r)return n;return r};function y(e,t){const n=Object.assign({},e);for(const e of t)delete n[e];return n}const w=(e,t=!1)=>{const n=`Warning: [vue-request] ${e}`;if(t)return new Error(n);console.error(n)};var E;const O=new Set,T=new Set,S=new Set,b=(e,t)=>{let n;switch(e){case"FOCUS_LISTENER":n=O;break;case"RECONNECT_LISTENER":n=S;break;case"VISIBLE_LISTENER":n=T}if(!n.has(t))return n.add(t),()=>{n.delete(t)}},R=e=>{e.forEach((e=>{e()}))};function j(e,t,n){let a,r,o,u,i,l,s=0,d=!1,v=!1,f=!0;const g=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){const n=a,o=r;return a=r=void 0,s=t,u=e.apply(o,n),u}function p(e,t){return g?(window.cancelAnimationFrame(i),window.requestAnimationFrame(e)):setTimeout(e,t)}function h(e){const n=e-l;return void 0===l||n>=t||n<0||v&&e-s>=o}function y(){const e=Date.now();if(h(e))return w(e);i=p(y,function(e){const n=e-s,a=t-(e-l);return v?Math.min(a,o-n):a}(e))}function w(e){return i=void 0,f&&a?m(e):(a=r=void 0,u)}function E(...e){const n=Date.now(),o=h(n);if(a=e,r=this,l=n,o){if(void 0===i)return function(e){return s=e,i=p(y,t),d?m(e):u}(l);if(v)return i=p(y,t),m(l)}return void 0===i&&(i=p(y,t)),u}return t=+t||0,c(n)&&(d=!!n.leading,v="maxWait"in n,o=v?Math.max(+n.maxWait||0,t):o,f="trailing"in n?!!n.trailing:f),E.cancel=function(){void 0!==i&&function(e){if(g)return window.cancelAnimationFrame(e);clearTimeout(e)}(i),s=0,a=l=r=i=void 0},E.flush=function(){return void 0===i?u:w(Date.now())},E.pending=function(){return void 0!==i},E}function q(e,t){for(const a in t)void 0!==t[a]&&(c(t[a])&&c(e[a])&&a in e?(l(t[a])||(n=t[a],Array.isArray(n)))&&q(e[a],t[a]):e[a]=t[a]);var n}function K(e,...t){const n=Object.assign({},e);if(!t.length)return n;for(const e of t)q(n,e);return n}!v&&null!==(E=window)&&void 0!==E&&E.addEventListener&&(window.addEventListener("visibilitychange",(()=>{f()&&R(T)}),!1),window.addEventListener("focus",(()=>R(O)),!1),window.addEventListener("online",(()=>R(S)),!1));const L=(e,n,a)=>{const{initialAutoRunFlag:r,initialData:o,loadingDelay:u,pollingInterval:i,debounceInterval:l,debounceOptions:v,throttleInterval:p,throttleOptions:h,pollingWhenHidden:y,pollingWhenOffline:w,errorRetryCount:E,errorRetryInterval:O,stopPollingWhenHiddenOrOffline:T,refreshOnWindowFocus:S,refocusTimespan:R,updateCache:q,formatResult:K,onSuccess:L,onError:I,onBefore:P,onAfter:_}=n,C=t.ref(0),M=t.ref((null==a?void 0:a.loading)??!1),W=t.ref((null==a?void 0:a.data)??o),A=t.ref(null==a?void 0:a.error),F=t.ref((null==a?void 0:a.params)??[]),N=(k={loading:M,data:W,error:A,params:F},D=[e=>q(e)],e=>{Object.keys(e).forEach((t=>{k[t].value=e[t]})),D.forEach((e=>e(k)))});var k,D;const x=()=>{C.value=0},V=t.ref(0),U=t.ref(),z=t.ref(),B=t.ref(),H=()=>{U.value&&U.value(),B.value&&B.value(),z.value&&z.value()},Q=t.computed((()=>{if(O)return O;return 1e3*Math.floor(Math.random()*2**Math.min(C.value,9)+1)})),Y=(...t)=>{N({loading:!u,params:t}),B.value=(()=>{let e;return u&&(e=setTimeout(N,u,{loading:!0})),()=>e&&clearTimeout(e)})(),V.value+=1;const n=V.value;return null==P||P(t),e(...t).then((e=>{if(n===V.value){const n=K?K(e):e;return N({data:n,loading:!1,error:void 0}),L&&L(n,t),x(),n}return m})).catch((e=>(n===V.value&&(N({data:void 0,loading:!1,error:e}),I&&I(e,t),console.error(e)),m))).finally((()=>{n===V.value&&(B.value(),z.value=(e=>{let t;const n=-1===E,a=C.value<E;return A.value&&(n||a)&&(n||(C.value+=1),t=setTimeout(e,Q.value)),()=>t&&clearTimeout(t)})((()=>Y(...t))),U.value=(e=>{if(A.value&&0!==E)return;let t;if(!d(i)&&i>=0){if(!y&&!f()||!w&&!g())return void(T.value=!0);t=setTimeout(e,i)}return()=>t&&clearTimeout(t)})((()=>Y(...t))),null==_||_(t))}))},G=!d(l)&&j(Y,l,v),$=!d(p)&&function(e,t,n){let a=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return c(n)&&(a="leading"in n?!!n.leading:a,r="trailing"in n?!!n.trailing:r),j(e,t,{leading:a,trailing:r,maxWait:t})}(Y,p,h),J=(...e)=>(H(),!r.value&&G?(G(...e),m):$?($(...e),m):(x(),Y(...e))),X=()=>J(...F.value),Z=[],ee=e=>{e&&Z.push(e)},te=()=>{T.value&&(y||f())&&(w||g())&&(X(),T.value=!1)};y||ee(b("VISIBLE_LISTENER",te)),w||ee(b("RECONNECT_LISTENER",te));const ne=((e,t)=>{let n=!1;return(...a)=>{n||(n=!0,e(...a),setTimeout((()=>{n=!1}),t))}})(X,R);S&&(ee(b("VISIBLE_LISTENER",ne)),ee(b("FOCUS_LISTENER",ne)));return{loading:M,data:W,error:A,params:F,run:J,cancel:()=>{V.value+=1,N({loading:!1}),G&&G.cancel(),$&&$.cancel(),H()},refresh:X,mutate:e=>{const t=s(e)?e(W.value):e;N({data:t})},unmount:()=>{Z.forEach((e=>e()))}}},I=new Map,P=e=>{if(d(e))return;const t=I.get(e);return t?{data:t.data,cacheTime:t.cacheTime}:void 0},_="__QUERY_DEFAULT_KEY__";function C(e,n){const o=t.inject(a,{}),{cacheKey:u,defaultParams:i=[],manual:l=!1,ready:c=t.ref(!0),refreshDeps:s=[],loadingDelay:d=0,pollingWhenHidden:v=!1,pollingWhenOffline:f=!1,refreshOnWindowFocus:g=!1,refocusTimespan:p=5e3,cacheTime:h=6e5,staleTime:w=0,errorRetryCount:E=0,errorRetryInterval:O=0,queryKey:T,...S}={...r(),...o,...n},b=t.ref(!1),R=t.ref(!1),j={initialAutoRunFlag:R,loadingDelay:d,pollingWhenHidden:v,pollingWhenOffline:f,stopPollingWhenHiddenOrOffline:b,cacheKey:u,errorRetryCount:E,errorRetryInterval:O,refreshOnWindowFocus:g,refocusTimespan:p,updateCache:e=>{var n;if(!u)return;const a=null===(n=P(u))||void 0===n?void 0:n.data,r=null==a?void 0:a.queries,o=(e=>{const n={};return Object.keys(e).forEach((a=>{n[a]=t.unref(e[a])})),n})(e),i=(null==T?void 0:T(...e.params.value))??_;((e,t,n)=>{const a=I.get(e);null!=a&&a.timer&&clearTimeout(a.timer);const r=setTimeout((()=>I.delete(e)),n);I.set(e,{data:t,timer:r,cacheTime:(new Date).getTime()})})(u,{queries:{...r,[i]:{...null==r?void 0:r[i],...o}},latestQueriesKey:i},h)},...y(S,["pagination","listKey"])},q=t.ref(!1),K=t.ref(),C=t.ref(),M=t.ref(),W=t.reactive({[_]:t.reactive(L(e,j))}),A=t.ref(_),F=t.computed((()=>W[A.value]??{}));if(t.watch(F,(e=>{q.value=e.loading,K.value=e.data,C.value=e.error,M.value=e.params}),{immediate:!0,deep:!0}),u){var N;const n=P(u);null!=n&&null!==(N=n.data)&&void 0!==N&&N.queries&&(Object.keys(n.data.queries).forEach((a=>{const r=n.data.queries[a];W[a]=t.reactive(L(e,j,{loading:r.loading,params:r.params,data:r.data,error:r.error}))})),n.data.latestQueriesKey&&(A.value=n.data.latestQueriesKey))}const k=t.ref(),D=t.ref(!1),x=(...n)=>{if(!c.value&&!D.value)return k.value=n,m;const a=(null==T?void 0:T(...n))??_;return W[a]||(W[a]=t.reactive(L(e,j))),A.value=a,F.value.run(...n)},V=()=>{Object.keys(W).forEach((e=>{W[e].cancel(),W[e].unmount(),delete W[e]}))};if(!l){R.value=!0;const e=P(u),t=(null==e?void 0:e.data.queries)??{},n=e&&(-1===w||e.cacheTime+w>(new Date).getTime()),a=Object.keys(t).length>0;n||(a?Object.keys(W).forEach((e=>{var t;null===(t=W[e])||void 0===t||t.refresh()})):x(...i)),R.value=!1}const U=t.ref();return U.value=t.watch(c,(e=>{D.value=!0,e&&k.value&&(x(...k.value),U.value())}),{flush:"sync"}),s.length&&t.watch(s,(()=>{!l&&F.value.refresh()})),t.onUnmounted((()=>{V()})),{loading:q,data:K,error:C,params:M,cancel:()=>F.value.cancel(),refresh:()=>F.value.refresh(),mutate:e=>F.value.mutate(e),run:x,reset:()=>{V(),A.value=_,W[_]=t.reactive(L(e,j))},queries:W}}const M=e=>(...t)=>{if(s(e))return M(e(...t))();if(c(n=e)&&s(n.then)&&s(n.catch))return e;if(l(e)){const{url:t,...n}=e;return p(t,n)}if("[object String]"===i(e))return p(e);throw w("Unknown service type",!0);var n};e.RequestConfig=o,e.setGlobalOptions=e=>{Object.keys(e).forEach((t=>{n[t]=e[t]}))},e.useLoadMore=function(e,n){s(e)||w("useLoadMore only support function service");const o=M(e),u=t.inject(a,{}),{queryKey:i,isNoMore:l,listKey:c="list",...d}=Object.assign({listKey:u.listKey??r().listKey},n??{});i&&w("useLoadMore does not support concurrent request");const v=t.ref(!1),f=t.ref(!1),g=t.ref(!1),m=t.ref(0),{data:p,params:E,queries:O,run:T,reset:S,cancel:b,...R}=C(o,{...d,onSuccess:(...e)=>{var t;f.value=!1,m.value++,null==d||null===(t=d.onSuccess)||void 0===t||t.call(d,...e)},onError:(...e)=>{var t;f.value=!1,null==d||null===(t=d.onError)||void 0===t||t.call(d,...e)},queryKey:()=>String(m.value)}),j=t.ref(p.value);t.watchEffect((()=>{void 0!==p.value&&(j.value=p.value)}));const q=t.computed((()=>!(!l||!s(l))&&l(j.value))),K=t.computed((()=>{let e=[];return Object.values(O).forEach((t=>{const n=h(t.data,c);n&&Array.isArray(n)&&(e=e.concat(n))})),e}));return{data:j,dataList:K,params:E,noMore:q,loadingMore:f,refreshing:v,reloading:g,run:T,reload:async()=>{g.value=!0,S(),m.value=0,j.value=void 0;const[,...e]=E.value,t=[void 0,...e];await T(...t),g.value=!1},loadMore:()=>{if(q.value)return;f.value=!0;const[,...e]=E.value,t=[{dataList:K.value,data:j.value},...e];T(...t)},reset:S,refresh:async()=>{v.value=!0;const e=m.value-1,t=e<0?0:e;j.value=O[t].data,m.value=0;const[,...n]=E.value,a=[void 0,...n];await T(...a),Object.keys(O).forEach((e=>{e!==(0).toString()&&(O[e].cancel(),O[e].unmount(),delete O[e])})),v.value=!1},cancel:()=>{b(),f.value=!1,v.value=!1},...y(R,["refresh","mutate"])}},e.usePagination=function(e,n){const o=M(e),u=t.inject(a,{}),{pagination:{currentKey:i,pageSizeKey:l,totalKey:c,totalPageKey:s},queryKey:d,...v}=K({pagination:{currentKey:"current",pageSizeKey:"pageSize",totalKey:"total",totalPageKey:"totalPage"}},{pagination:r().pagination??{}},{pagination:u.pagination??{}},n??{});d&&w("usePagination does not support concurrent request");const f=K({defaultParams:[{[i]:1,[l]:10}]},v),{data:g,params:m,queries:p,run:y,reset:E,...O}=C(o,f),T=e=>{const[t,...n]=m.value,a=[{...t,...e},...n];y(...a)},S=e=>{T({[i]:e})},b=e=>{T({[l]:e})},R=t.ref(!1),j=t.computed((()=>h(g.value,c,0))),q=t.computed({get:()=>{var e;return(null===(e=m.value[0])||void 0===e?void 0:e[i])??f.defaultParams[0][i]},set:e=>{S(e)}}),L=t.computed({get:()=>{var e;return(null===(e=m.value[0])||void 0===e?void 0:e[l])??f.defaultParams[0][l]},set:e=>{b(e)}}),I=t.computed((()=>h(g.value,s,Math.ceil(j.value/L.value))));return{data:g,params:m,current:q,pageSize:L,total:j,totalPage:I,reloading:R,run:y,changeCurrent:S,changePageSize:b,changePagination:(e,t)=>{T({[i]:e,[l]:t})},reload:async()=>{const{defaultParams:e,manual:t}=f;E(),t||(R.value=!0,await y(...e),R.value=!1)},...O}},e.useRequest=function(e,n){const a=M(e),{reset:r,run:o,...u}=C(a,n??{}),i=t.ref(!1);return{reload:async()=>{const{defaultParams:e=[],manual:t}=n;r(),t||(i.value=!0,await o(...e),i.value=!1)},run:o,reloading:i,...u}},Object.defineProperty(e,"__esModule",{value:!0})}(this.VueRequest=this.VueRequest||{},Vue); | ||
!function(e,n){"use strict";const t={},a=Symbol("GLOBAL_OPTIONS_PROVIDE_KEY"),r=()=>t,o=n.defineComponent({name:"RequestConfig",props:{config:{type:Object,required:!0}},setup(e,{slots:t}){const{config:r}=e;return n.provide(a,r),()=>{var e;return null===(e=t.default)||void 0===e?void 0:e.call(t)}}}),u=Object.prototype.toString,l=e=>u.call(e),i=e=>"[object Object]"===l(e),c=e=>null!==e&&"object"==typeof e,s=e=>e instanceof Function,v=e=>null==e,d="undefined"==typeof window,f=()=>{var e,n;return!d&&"visible"===(null===(e=window)||void 0===e||null===(n=e.document)||void 0===n?void 0:n.visibilityState)},g=()=>{var e,n,t;return null===(e=!d&&(null===(n=window)||void 0===n||null===(t=n.navigator)||void 0===t?void 0:t.onLine))||void 0===e||e},m=Promise.resolve(null),p=async(...e)=>{const n=await fetch(...e);if(n.ok)return n.json();throw new Error(n.statusText)},h=(e,n,t)=>{const a=n.replace(/\[(\d+)\]/g,".$1").split(".");let r=e;for(const e of a)if(r=Object(r)[e],void 0===r)return t;return r};function y(e,n){const t=Object.assign({},e);for(const e of n)delete t[e];return t}const w=(e,n=!1)=>{const t=`Warning: [vue-request] ${e}`;if(n)return new Error(t);console.error(t)};var E;const O=new Set,T=new Set,S=new Set,b=(e,n)=>{let t;switch(e){case"FOCUS_LISTENER":t=O;break;case"RECONNECT_LISTENER":t=S;break;case"VISIBLE_LISTENER":t=T}if(!t.has(n))return t.add(n),()=>{t.delete(n)}},R=e=>{e.forEach((e=>{e()}))};function j(e,n,t){let a,r,o,u,l,i,s=0,v=!1,d=!1,f=!0;const g=!n&&0!==n&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function m(n){const t=a,o=r;return a=r=void 0,s=n,u=e.apply(o,t),u}function p(e,n){return g?(window.cancelAnimationFrame(l),window.requestAnimationFrame(e)):setTimeout(e,n)}function h(e){const t=e-i;return void 0===i||t>=n||t<0||d&&e-s>=o}function y(){const e=Date.now();if(h(e))return w(e);l=p(y,function(e){const t=e-s,a=n-(e-i);return d?Math.min(a,o-t):a}(e))}function w(e){return l=void 0,f&&a?m(e):(a=r=void 0,u)}function E(...e){const t=Date.now(),o=h(t);if(a=e,r=this,i=t,o){if(void 0===l)return function(e){return s=e,l=p(y,n),v?m(e):u}(i);if(d)return l=p(y,n),m(i)}return void 0===l&&(l=p(y,n)),u}return n=+n||0,c(t)&&(v=!!t.leading,d="maxWait"in t,o=d?Math.max(+t.maxWait||0,n):o,f="trailing"in t?!!t.trailing:f),E.cancel=function(){void 0!==l&&function(e){if(g)return window.cancelAnimationFrame(e);clearTimeout(e)}(l),s=0,a=i=r=l=void 0},E.flush=function(){return void 0===l?u:w(Date.now())},E.pending=function(){return void 0!==l},E}function q(e,n){for(const a in n)void 0!==n[a]&&(c(n[a])&&c(e[a])&&a in e?(i(n[a])||(t=n[a],Array.isArray(t)))&&q(e[a],n[a]):e[a]=n[a]);var t}function K(e,...n){const t=Object.assign({},e);if(!n.length)return t;for(const e of n)q(t,e);return t}!d&&null!==(E=window)&&void 0!==E&&E.addEventListener&&(window.addEventListener("visibilitychange",(()=>{f()&&R(T)}),!1),window.addEventListener("focus",(()=>R(O)),!1),window.addEventListener("online",(()=>R(S)),!1));const L=(e,t,a)=>{var r,o,u;const{initialAutoRunFlag:l,initialData:i,loadingDelay:d,pollingInterval:p,debounceInterval:h,debounceOptions:y,throttleInterval:w,throttleOptions:E,pollingWhenHidden:O,pollingWhenOffline:T,errorRetryCount:S,errorRetryInterval:R,stopPollingWhenHiddenOrOffline:q,refreshOnWindowFocus:K,refocusTimespan:L,updateCache:I,formatResult:P,onSuccess:_,onError:C,onBefore:M,onAfter:W}=t,A=n.ref(0),F=n.ref(null!==(r=null==a?void 0:a.loading)&&void 0!==r&&r),N=n.ref(null!==(o=null==a?void 0:a.data)&&void 0!==o?o:i),k=n.ref(null==a?void 0:a.error),D=n.ref(null!==(u=null==a?void 0:a.params)&&void 0!==u?u:[]),x=(V={loading:F,data:N,error:k,params:D},U=[e=>I(e)],e=>{Object.keys(e).forEach((n=>{V[n].value=e[n]})),U.forEach((e=>e(V)))});var V,U;const z=()=>{A.value=0},B=n.ref(0),H=n.ref(),Q=n.ref(),Y=n.ref(),G=()=>{H.value&&H.value(),Y.value&&Y.value(),Q.value&&Q.value()},$=n.computed((()=>{if(R)return R;return 1e3*Math.floor(Math.random()*2**Math.min(A.value,9)+1)})),J=(...n)=>{x({loading:!d,params:n}),Y.value=(()=>{let e;return d&&(e=setTimeout(x,d,{loading:!0})),()=>e&&clearTimeout(e)})(),B.value+=1;const t=B.value;return null==M||M(n),e(...n).then((e=>{if(t===B.value){const t=P?P(e):e;return x({data:t,loading:!1,error:void 0}),_&&_(t,n),z(),t}return m})).catch((e=>(t===B.value&&(x({data:void 0,loading:!1,error:e}),C&&C(e,n),console.error(e)),m))).finally((()=>{t===B.value&&(Y.value(),Q.value=(e=>{let n;const t=-1===S,a=A.value<S;return k.value&&(t||a)&&(t||(A.value+=1),n=setTimeout(e,$.value)),()=>n&&clearTimeout(n)})((()=>J(...n))),H.value=(e=>{if(k.value&&0!==S)return;let n;if(!v(p)&&p>=0){if(!O&&!f()||!T&&!g())return void(q.value=!0);n=setTimeout(e,p)}return()=>n&&clearTimeout(n)})((()=>J(...n))),null==W||W(n))}))},X=!v(h)&&j(J,h,y),Z=!v(w)&&function(e,n,t){let a=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return c(t)&&(a="leading"in t?!!t.leading:a,r="trailing"in t?!!t.trailing:r),j(e,n,{leading:a,trailing:r,maxWait:n})}(J,w,E),ee=(...e)=>(G(),!l.value&&X?(X(...e),m):Z?(Z(...e),m):(z(),J(...e))),ne=()=>ee(...D.value),te=[],ae=e=>{e&&te.push(e)},re=()=>{q.value&&(O||f())&&(T||g())&&(ne(),q.value=!1)};O||ae(b("VISIBLE_LISTENER",re)),T||ae(b("RECONNECT_LISTENER",re));const oe=((e,n)=>{let t=!1;return(...a)=>{t||(t=!0,e(...a),setTimeout((()=>{t=!1}),n))}})(ne,L);K&&(ae(b("VISIBLE_LISTENER",oe)),ae(b("FOCUS_LISTENER",oe)));return{loading:F,data:N,error:k,params:D,run:ee,cancel:()=>{B.value+=1,x({loading:!1}),X&&X.cancel(),Z&&Z.cancel(),G()},refresh:ne,mutate:e=>{const n=s(e)?e(N.value):e;x({data:n})},unmount:()=>{te.forEach((e=>e()))}}},I=new Map,P=e=>{if(v(e))return;const n=I.get(e);return n?{data:n.data,cacheTime:n.cacheTime}:void 0},_="__QUERY_DEFAULT_KEY__";function C(e,t){const o=n.inject(a,{}),{cacheKey:u,defaultParams:l=[],manual:i=!1,ready:c=n.ref(!0),refreshDeps:s=[],loadingDelay:v=0,pollingWhenHidden:d=!1,pollingWhenOffline:f=!1,refreshOnWindowFocus:g=!1,refocusTimespan:p=5e3,cacheTime:h=6e5,staleTime:w=0,errorRetryCount:E=0,errorRetryInterval:O=0,queryKey:T,...S}={...r(),...o,...t},b=n.ref(!1),R=n.ref(!1),j={initialAutoRunFlag:R,loadingDelay:v,pollingWhenHidden:d,pollingWhenOffline:f,stopPollingWhenHiddenOrOffline:b,cacheKey:u,errorRetryCount:E,errorRetryInterval:O,refreshOnWindowFocus:g,refocusTimespan:p,updateCache:e=>{var t,a;if(!u)return;const r=null===(t=P(u))||void 0===t?void 0:t.data,o=null==r?void 0:r.queries,l=(e=>{const t={};return Object.keys(e).forEach((a=>{t[a]=n.unref(e[a])})),t})(e),i=null!==(a=null==T?void 0:T(...e.params.value))&&void 0!==a?a:_;((e,n,t)=>{const a=I.get(e);null!=a&&a.timer&&clearTimeout(a.timer);const r=setTimeout((()=>I.delete(e)),t);I.set(e,{data:n,timer:r,cacheTime:(new Date).getTime()})})(u,{queries:{...o,[i]:{...null==o?void 0:o[i],...l}},latestQueriesKey:i},h)},...y(S,["pagination","listKey"])},q=n.ref(!1),K=n.ref(),C=n.ref(),M=n.ref(),W=n.reactive({[_]:n.reactive(L(e,j))}),A=n.ref(_),F=n.computed((()=>{var e;return null!==(e=W[A.value])&&void 0!==e?e:{}}));if(n.watch(F,(e=>{q.value=e.loading,K.value=e.data,C.value=e.error,M.value=e.params}),{immediate:!0,deep:!0}),u){var N;const t=P(u);null!=t&&null!==(N=t.data)&&void 0!==N&&N.queries&&(Object.keys(t.data.queries).forEach((a=>{const r=t.data.queries[a];W[a]=n.reactive(L(e,j,{loading:r.loading,params:r.params,data:r.data,error:r.error}))})),t.data.latestQueriesKey&&(A.value=t.data.latestQueriesKey))}const k=n.ref(),D=n.ref(!1),x=(...t)=>{var a;if(!c.value&&!D.value)return k.value=t,m;const r=null!==(a=null==T?void 0:T(...t))&&void 0!==a?a:_;return W[r]||(W[r]=n.reactive(L(e,j))),A.value=r,F.value.run(...t)},V=()=>{Object.keys(W).forEach((e=>{W[e].cancel(),W[e].unmount(),delete W[e]}))};if(!i){var U;R.value=!0;const e=P(u),n=null!==(U=null==e?void 0:e.data.queries)&&void 0!==U?U:{},t=e&&(-1===w||e.cacheTime+w>(new Date).getTime()),a=Object.keys(n).length>0;t||(a?Object.keys(W).forEach((e=>{var n;null===(n=W[e])||void 0===n||n.refresh()})):x(...l)),R.value=!1}const z=n.ref();return z.value=n.watch(c,(e=>{D.value=!0,e&&k.value&&(x(...k.value),z.value())}),{flush:"sync"}),s.length&&n.watch(s,(()=>{!i&&F.value.refresh()})),n.onUnmounted((()=>{V()})),{loading:q,data:K,error:C,params:M,cancel:()=>F.value.cancel(),refresh:()=>F.value.refresh(),mutate:e=>F.value.mutate(e),run:x,reset:()=>{V(),A.value=_,W[_]=n.reactive(L(e,j))},queries:W}}const M=e=>(...n)=>{if(s(e))return M(e(...n))();if(c(t=e)&&s(t.then)&&s(t.catch))return e;if(i(e)){const{url:n,...t}=e;return p(n,t)}if("[object String]"===l(e))return p(e);throw w("Unknown service type",!0);var t};e.RequestConfig=o,e.setGlobalOptions=e=>{Object.keys(e).forEach((n=>{t[n]=e[n]}))},e.useLoadMore=function(e,t){var o;s(e)||w("useLoadMore only support function service");const u=M(e),l=n.inject(a,{}),{queryKey:i,isNoMore:c,listKey:v="list",...d}=Object.assign({listKey:null!==(o=l.listKey)&&void 0!==o?o:r().listKey},null!=t?t:{});i&&w("useLoadMore does not support concurrent request");const f=n.ref(!1),g=n.ref(!1),m=n.ref(!1),p=n.ref(0),{data:E,params:O,queries:T,run:S,reset:b,cancel:R,...j}=C(u,{...d,onSuccess:(...e)=>{var n;g.value=!1,p.value++,null==d||null===(n=d.onSuccess)||void 0===n||n.call(d,...e)},onError:(...e)=>{var n;g.value=!1,null==d||null===(n=d.onError)||void 0===n||n.call(d,...e)},queryKey:()=>String(p.value)}),q=n.ref(E.value);n.watchEffect((()=>{void 0!==E.value&&(q.value=E.value)}));const K=n.computed((()=>!(!c||!s(c))&&c(q.value))),L=n.computed((()=>{let e=[];return Object.values(T).forEach((n=>{const t=h(n.data,v);t&&Array.isArray(t)&&(e=e.concat(t))})),e}));return{data:q,dataList:L,params:O,noMore:K,loadingMore:g,refreshing:f,reloading:m,run:S,reload:async()=>{m.value=!0,b(),p.value=0,q.value=void 0;const[,...e]=O.value,n=[void 0,...e];await S(...n),m.value=!1},loadMore:()=>{if(K.value)return;g.value=!0;const[,...e]=O.value,n=[{dataList:L.value,data:q.value},...e];S(...n)},reset:b,refresh:async()=>{f.value=!0;const e=p.value-1,n=e<0?0:e;q.value=T[n].data,p.value=0;const[,...t]=O.value,a=[void 0,...t];await S(...a),Object.keys(T).forEach((e=>{e!==(0).toString()&&(T[e].cancel(),T[e].unmount(),delete T[e])})),f.value=!1},cancel:()=>{R(),g.value=!1,f.value=!1},...y(j,["refresh","mutate"])}},e.usePagination=function(e,t){var o,u;const l=M(e),i=n.inject(a,{}),{pagination:{currentKey:c,pageSizeKey:s,totalKey:v,totalPageKey:d},queryKey:f,...g}=K({pagination:{currentKey:"current",pageSizeKey:"pageSize",totalKey:"total",totalPageKey:"totalPage"}},{pagination:null!==(o=r().pagination)&&void 0!==o?o:{}},{pagination:null!==(u=i.pagination)&&void 0!==u?u:{}},null!=t?t:{});f&&w("usePagination does not support concurrent request");const m=K({defaultParams:[{[c]:1,[s]:10}]},g),{data:p,params:y,queries:E,run:O,reset:T,...S}=C(l,m),b=e=>{const[n,...t]=y.value,a=[{...n,...e},...t];O(...a)},R=e=>{b({[c]:e})},j=e=>{b({[s]:e})},q=n.ref(!1),L=n.computed((()=>h(p.value,v,0))),I=n.computed({get:()=>{var e,n;return null!==(e=null===(n=y.value[0])||void 0===n?void 0:n[c])&&void 0!==e?e:m.defaultParams[0][c]},set:e=>{R(e)}}),P=n.computed({get:()=>{var e,n;return null!==(e=null===(n=y.value[0])||void 0===n?void 0:n[s])&&void 0!==e?e:m.defaultParams[0][s]},set:e=>{j(e)}}),_=n.computed((()=>h(p.value,d,Math.ceil(L.value/P.value))));return{data:p,params:y,current:I,pageSize:P,total:L,totalPage:_,reloading:q,run:O,changeCurrent:R,changePageSize:j,changePagination:(e,n)=>{b({[c]:e,[s]:n})},reload:async()=>{const{defaultParams:e,manual:n}=m;T(),n||(q.value=!0,await O(...e),q.value=!1)},...S}},e.useRequest=function(e,t){const a=M(e),{reset:r,run:o,...u}=C(a,null!=t?t:{}),l=n.ref(!1);return{reload:async()=>{const{defaultParams:e=[],manual:n}=t;r(),n||(l.value=!0,await o(...e),l.value=!1)},run:o,reloading:l,...u}},Object.defineProperty(e,"__esModule",{value:!0})}(this.VueRequest=this.VueRequest||{},Vue); |
{ | ||
"name": "vue-request", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Vue 3 composition API for data fetching, supports SWR, polling, error retry, cache request, pagination and other cool features.", | ||
@@ -58,2 +58,3 @@ "keywords": [ | ||
"@babel/core": "^7.12.3", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", | ||
"@babel/plugin-transform-runtime": "^7.12.1", | ||
@@ -60,0 +61,0 @@ "@babel/preset-env": "^7.12.1", |
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
129451
2377
46