@lensjs/core 2.3.0 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstracts/store.cjs +1 -0
- package/dist/abstracts/store.d.cts +2 -1
- package/dist/abstracts/store.d.ts +2 -1
- package/dist/abstracts/store.js +1 -0
- package/dist/core/lens.cjs +36 -1
- package/dist/core/lens.js +36 -1
- package/dist/{exception-C69UCHPk.d.cts → exception-BJqUL0j5.d.cts} +1 -1
- package/dist/{exception-3AZsPtAg.d.ts → exception-DYe0t9-2.d.ts} +1 -1
- package/dist/{index-QmOJr0K-.d.cts → index-CDaOwv3y.d.cts} +1 -1
- package/dist/{index-CZsa0Zcm.d.ts → index-DRfxZjgs.d.ts} +1 -1
- package/dist/index.cjs +36 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +36 -1
- package/dist/mixins/queued_store.cjs +1 -0
- package/dist/mixins/queued_store.js +1 -0
- package/dist/stores/better_sqlite.cjs +34 -0
- package/dist/stores/better_sqlite.d.cts +3 -0
- package/dist/stores/better_sqlite.d.ts +3 -0
- package/dist/stores/better_sqlite.js +34 -0
- package/dist/stores/index.cjs +35 -0
- package/dist/stores/index.js +35 -0
- package/dist/stores/queued_sqlite.cjs +35 -0
- package/dist/stores/queued_sqlite.js +35 -0
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/ui/assets/{CacheActionBadge-BB4uokI1.js → CacheActionBadge-B0d8J3l3.js} +1 -1
- package/dist/ui/assets/CacheEntriesTable-BWcruMt2.js +1 -0
- package/dist/ui/assets/CacheEntryContainer-DtJ7sOfS.js +2 -0
- package/dist/ui/assets/{CacheEntryDetails-BeZnoIpm.js → CacheEntryDetails-BqnO7eQt.js} +1 -1
- package/dist/ui/assets/CacheEntryDetailsContainer-CDSo5J6T.js +2 -0
- package/dist/ui/assets/ExceptionContainer-CPGWtjRd.js +2 -0
- package/dist/ui/assets/{ExceptionDetails-BKHzv6hf.js → ExceptionDetails-pQPj3ONT.js} +1 -1
- package/dist/ui/assets/ExceptionDetailsContainer-ClPIK2i9.js +2 -0
- package/dist/ui/assets/{ExceptionTable-DzBmQLLa.js → ExceptionTable-DOeXVqQk.js} +1 -1
- package/dist/ui/assets/{JsonViewer-D-KPN089.js → JsonViewer-CsEn0XaU.js} +1 -1
- package/dist/ui/assets/{LoadMore-CLPR6Zd4.js → LoadMore-DkgyLoiB.js} +1 -1
- package/dist/ui/assets/QueriesContainer-EcqQVDVf.js +2 -0
- package/dist/ui/assets/{QueryDetailsContainer-Cqj3E6Dr.js → QueryDetailsContainer-CEB3hlHs.js} +1 -1
- package/dist/ui/assets/{QueryTable-DmWdZSnJ.js → QueryTable-BE7RpCNw.js} +1 -1
- package/dist/ui/assets/{RequestDetails-CF338Kcv.js → RequestDetails-Gd7Ai7fu.js} +1 -1
- package/dist/ui/assets/{RequestDetailsContainer-aW4GLool.js → RequestDetailsContainer-CnOSYjOY.js} +2 -2
- package/dist/ui/assets/{RequestsContainer-DdLSvAbl.js → RequestsContainer-CEnrqMqW.js} +2 -2
- package/dist/ui/assets/{RequetsTable-Bdp_PhGU.js → RequetsTable-DFm_vdLV.js} +1 -1
- package/dist/ui/assets/{StatusCode-C605nHvd.js → StatusCode-D5gEbxbO.js} +1 -1
- package/dist/ui/assets/{TabbedDataViewer-ofhEq_Wj.js → TabbedDataViewer-CJN6R11V.js} +2 -2
- package/dist/ui/assets/{Table-kak5sL5X.js → Table-C3Y9tdtZ.js} +1 -1
- package/dist/ui/assets/{columns-BEyDhUNq.js → columns-5NhbdeuI.js} +1 -1
- package/dist/ui/assets/{columns-Bu5psHyp.js → columns-BGeHl5-C.js} +1 -1
- package/dist/ui/assets/{columns-BvIUTkjN.js → columns-oQrpcTou.js} +1 -1
- package/dist/ui/assets/{copy-DzXuP4eO.js → copy-CwmmSmiO.js} +1 -1
- package/dist/ui/assets/index-Bg3-m46L.js +124 -0
- package/dist/ui/assets/{useCacheEntries-Pvte_aNc.js → useCacheEntries-OjlomqyI.js} +1 -1
- package/dist/ui/assets/{useExceptions-P3cnURvN.js → useExceptions-DE7MHRvJ.js} +1 -1
- package/dist/ui/assets/{useLensApi-BFdsfrzR.js → useLensApi-CI65OdmI.js} +1 -1
- package/dist/ui/assets/{useLoadMore-JCWak1Dg.js → useLoadMore-BA_-_Tw4.js} +1 -1
- package/dist/ui/assets/{useQueries-CNquFtm0.js → useQueries-D29NRLfq.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/utils/exception.d.cts +1 -1
- package/dist/utils/exception.d.ts +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/CacheEntriesTable-B8cUXhos.js +0 -1
- package/dist/ui/assets/CacheEntryContainer-WkdnGvnu.js +0 -2
- package/dist/ui/assets/CacheEntryDetailsContainer-DI0mEvpu.js +0 -2
- package/dist/ui/assets/ExceptionContainer-YNcR0F5U.js +0 -2
- package/dist/ui/assets/ExceptionDetailsContainer-CJHILjb3.js +0 -2
- package/dist/ui/assets/QueriesContainer-B_PmBkHR.js +0 -2
- package/dist/ui/assets/index-TW_-MgRG.js +0 -124
package/dist/ui/assets/{RequestDetailsContainer-aW4GLool.js → RequestDetailsContainer-CnOSYjOY.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./RequestDetails-
|
|
2
|
-
import{S as V,p as k,a as l,s as w,b as y,n as x,i as I,c as L,t as W,f as $,d as K,e as j,g as H,r as p,h as N,u as J,k as G,l as X,m as Y,j as T,_ as Z}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./RequestDetails-Gd7Ai7fu.js","./index-Bg3-m46L.js","./index-CsnKQ5Mh.css","./TabbedDataViewer-CJN6R11V.js","./Table-C3Y9tdtZ.js","./columns-BGeHl5-C.js","./index-BRRKsoNv.js","./columns-5NhbdeuI.js","./columns-oQrpcTou.js","./CacheActionBadge-B0d8J3l3.js","./StatusCode-D5gEbxbO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{S as V,p as k,a as l,s as w,b as y,n as x,i as I,c as L,t as W,f as $,d as K,e as j,g as H,r as p,h as N,u as J,k as G,l as X,m as Y,j as T,_ as Z}from"./index-Bg3-m46L.js";var tt=class extends V{constructor(t,e){super(),this.options=e,this.#s=t,this.#r=null,this.#i=k(),this.bindMethods(),this.setOptions(e)}#s;#t=void 0;#p=void 0;#e=void 0;#n;#c;#i;#r;#R;#l;#d;#o;#h;#a;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),A(this.#t,this.options)?this.#u():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Q(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Q(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#g(),this.#C(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#s.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof l(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#O(),this.#t.setOptions(this.options),e._defaulted&&!w(this.options,e)&&this.#s.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&B(this.#t,s,this.options,e)&&this.#u(),this.updateResult(),i&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(e.staleTime,this.#t))&&this.#b();const a=this.#v();i&&(this.#t!==s||l(this.options.enabled,this.#t)!==l(e.enabled,this.#t)||a!==this.#a)&&this.#m(a)}getOptimisticResult(t){const e=this.#s.getQueryCache().build(this.#s,t),s=this.createResult(e,t);return st(this,s)&&(this.#e=s,this.#c=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#e}trackResult(t,e){return new Proxy(t,{get:(s,i)=>(this.trackProp(i),e?.(i),i==="promise"&&!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(s,i))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#s.defaultQueryOptions(t),s=this.#s.getQueryCache().build(this.#s,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#u({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#e))}#u(t){this.#O();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(x)),e}#b(){this.#g();const t=y(this.options.staleTime,this.#t);if(I||this.#e.isStale||!L(t))return;const s=W(this.#e.dataUpdatedAt,t)+1;this.#o=setTimeout(()=>{this.#e.isStale||this.updateResult()},s)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#C(),this.#a=t,!(I||l(this.options.enabled,this.#t)===!1||!L(this.#a)||this.#a===0)&&(this.#h=setInterval(()=>{(this.options.refetchIntervalInBackground||$.isFocused())&&this.#u()},this.#a))}#y(){this.#b(),this.#m(this.#v())}#g(){this.#o&&(clearTimeout(this.#o),this.#o=void 0)}#C(){this.#h&&(clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,i=this.options,a=this.#e,u=this.#n,r=this.#c,o=t!==s?t.state:this.#p,{state:d}=t;let n={...d},m=!1,h;if(e._optimisticResults){const c=this.hasListeners(),g=!c&&A(t,e),v=c&&B(t,s,e,i);(g||v)&&(n={...n,...K(d.data,t.options)}),e._optimisticResults==="isRestoring"&&(n.fetchStatus="idle")}let{error:_,errorUpdatedAt:P,status:R}=n;h=n.data;let D=!1;if(e.placeholderData!==void 0&&h===void 0&&R==="pending"){let c;a?.isPlaceholderData&&e.placeholderData===r?.placeholderData?(c=a.data,D=!0):c=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,c!==void 0&&(R="success",h=j(a?.data,c,e),m=!0)}if(e.select&&h!==void 0&&!D)if(a&&h===u?.data&&e.select===this.#R)h=this.#l;else try{this.#R=e.select,h=e.select(h),h=j(a?.data,h,e),this.#l=h,this.#r=null}catch(c){this.#r=c}this.#r&&(_=this.#r,h=this.#l,P=Date.now(),R="error");const O=n.fetchStatus==="fetching",S=R==="pending",E=R==="error",U=S&&O,M=h!==void 0,f={status:R,fetchStatus:n.fetchStatus,isPending:S,isSuccess:R==="success",isError:E,isInitialLoading:U,isLoading:U,data:h,dataUpdatedAt:n.dataUpdatedAt,error:_,errorUpdatedAt:P,failureCount:n.fetchFailureCount,failureReason:n.fetchFailureReason,errorUpdateCount:n.errorUpdateCount,isFetched:n.dataUpdateCount>0||n.errorUpdateCount>0,isFetchedAfterMount:n.dataUpdateCount>o.dataUpdateCount||n.errorUpdateCount>o.errorUpdateCount,isFetching:O,isRefetching:O&&!S,isLoadingError:E&&!M,isPaused:n.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:E&&M,isStale:F(t,e),refetch:this.refetch,promise:this.#i,isEnabled:l(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const c=C=>{f.status==="error"?C.reject(f.error):f.data!==void 0&&C.resolve(f.data)},g=()=>{const C=this.#i=f.promise=k();c(C)},v=this.#i;switch(v.status){case"pending":t.queryHash===s.queryHash&&c(v);break;case"fulfilled":(f.status==="error"||f.data!==v.value)&&g();break;case"rejected":(f.status!=="error"||f.error!==v.reason)&&g();break}}return f}updateResult(){const t=this.#e,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#c=this.options,this.#n.data!==void 0&&(this.#d=this.#t),w(e,t))return;this.#e=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!this.#f.size)return!0;const u=new Set(a??this.#f);return this.options.throwOnError&&u.add("error"),Object.keys(this.#e).some(r=>{const b=r;return this.#e[b]!==t[b]&&u.has(b)})};this.#S({listeners:s()})}#O(){const t=this.#s.getQueryCache().build(this.#s,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#p=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(t){H.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#e)}),this.#s.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function et(t,e){return l(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function A(t,e){return et(t,e)||t.state.data!==void 0&&Q(t,e,e.refetchOnMount)}function Q(t,e,s){if(l(e.enabled,t)!==!1&&y(e.staleTime,t)!=="static"){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&F(t,e)}return!1}function B(t,e,s,i){return(t!==e||l(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&F(t,s)}function F(t,e){return l(e.enabled,t)!==!1&&t.isStaleByTime(y(e.staleTime,t))}function st(t,e){return!w(t.getCurrentResult(),e)}var z=p.createContext(!1),it=()=>p.useContext(z);z.Provider;function rt(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var at=p.createContext(rt()),nt=()=>p.useContext(at),ot=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},ht=t=>{p.useEffect(()=>{t.clearReset()},[t])},ut=({result:t,errorResetBoundary:e,throwOnError:s,query:i,suspense:a})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(a&&t.data===void 0||N(s,[t.error,i])),ct=t=>{if(t.suspense){const e=i=>i==="static"?i:Math.max(i??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...i)=>e(s(...i)):e(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},lt=(t,e)=>t.isLoading&&t.isFetching&&!e,dt=(t,e)=>t?.suspense&&e.isPending,q=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function ft(t,e,s){const i=it(),a=nt(),u=J(),r=u.defaultQueryOptions(t);u.getDefaultOptions().queries?._experimental_beforeQuery?.(r),r._optimisticResults=i?"isRestoring":"optimistic",ct(r),ot(r,a),ht(a);const b=!u.getQueryCache().get(r.queryHash),[o]=p.useState(()=>new e(u,r)),d=o.getOptimisticResult(r),n=!i&&t.subscribed!==!1;if(p.useSyncExternalStore(p.useCallback(m=>{const h=n?o.subscribe(H.batchCalls(m)):x;return o.updateResult(),h},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),p.useEffect(()=>{o.setOptions(r)},[r,o]),dt(r,d))throw q(r,o,a);if(ut({result:d,errorResetBoundary:a,throwOnError:r.throwOnError,query:u.getQueryCache().get(r.queryHash),suspense:r.suspense}))throw d.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(r,d),r.experimental_prefetchInRender&&!I&<(d,i)&&(b?q(r,o,a):u.getQueryCache().get(r.queryHash)?.promise)?.catch(x).finally(()=>{o.updateResult()}),r.notifyOnChangeProps?d:o.trackResult(d)}function pt(t,e){return ft(t,tt)}async function Rt(t,e){const s=await fetch(t,{headers:{"Content-Type":"application/json"},...e});if(!s.ok)throw new Error(`Failed to fetch: ${t}`);return s.json()}function bt(t,e){const s=G();return pt({queryKey:["request",t],queryFn:async()=>await Rt(X(`${s.api.requests}/${t}`)),enabled:!!t,...e})}const vt=p.lazy(()=>Z(()=>import("./RequestDetails-Gd7Ai7fu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url)),gt=()=>{const{id:t}=Y(),{data:e}=bt(t);return T.jsx(T.Fragment,{children:e?.data&&T.jsx(vt,{request:e?.data})})};export{gt as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./RequetsTable-
|
|
2
|
-
import{r as e,j as p,_ as m}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./RequetsTable-DFm_vdLV.js","./index-Bg3-m46L.js","./index-CsnKQ5Mh.css","./LoadMore-DkgyLoiB.js","./Table-C3Y9tdtZ.js","./StatusCode-D5gEbxbO.js","./index-BRRKsoNv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e,j as p,_ as m}from"./index-Bg3-m46L.js";import{D as h,u as _}from"./useLensApi-CI65OdmI.js";import{u as E}from"./useLoadMore-BA_-_Tw4.js";const y={queries:[],cacheEntries:[],exceptions:[],request:{created_at:"",data:{body:{},createdAt:"",duration:"",headers:{},id:"",ip:"",method:"GET",path:"",response:{headers:{},json:{}},status:0,user:null},id:"",lens_entry_id:null,type:"request"}};function M(){const[t,o]=e.useState([]),[r,d]=e.useState(y),[c,s]=e.useState(!1),[i,q]=e.useState(h),{getAllRequests:a,getRequestById:l}=_(),f=e.useCallback(async n=>{s(!0),l(n).then(u=>{d({request:u.data,queries:[],cacheEntries:[],exceptions:[]})}).finally(()=>{s(!1)})},[l]),R=e.useCallback(async n=>{s(!0),a(n).then(u=>{o(u.data),q(u.meta)}).finally(()=>{s(!1)})},[a]);return{loadMoreRequests:e.useMemo(()=>({initialData:t,meta:i,loading:c,fetchRawPage:a}),[t,i,c,a]),fetchRequests:R,fetchRequest:f,request:r}}const g=e.lazy(()=>m(()=>import("./RequetsTable-DFm_vdLV.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),L=()=>{const{loadMoreRequests:t,fetchRequests:o}=M(),r=E({paginatedPage:t});return e.useEffect(()=>{o()},[]),p.jsx(g,{hasMoreObject:r})};export{L as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as o,k as d,j as e,L as s}from"./index-
|
|
1
|
+
import{q as o,k as d,j as e,L as s}from"./index-Bg3-m46L.js";import{L as i}from"./LoadMore-DkgyLoiB.js";import{C as m,T as u}from"./Table-C3Y9tdtZ.js";import{R as l,S as x}from"./StatusCode-D5gEbxbO.js";import{h as c}from"./index-BRRKsoNv.js";const h=()=>{const a=o(d());return[{name:"Method",render:t=>e.jsx(l,{method:t.data.method})},{name:"Path",render:t=>e.jsx(s,{to:`${a.REQUESTS}/${t.id}`,className:"line-clamp-2 max-w-80 min-w-40 text-base text-blue-600 dark:text-neutral-200 hover:underline",children:t.data.path})},{name:"Status",render:t=>e.jsx(x,{status:t.data.status})},{name:"Duration",value:t=>t.data.duration},{name:"Happened",render:t=>{const{label:n,exact:r}=c(t.data.createdAt);return e.jsx("span",{title:r,children:n})},position:"end",class:"min-w-32"},{name:"Actions",render:t=>e.jsx(s,{to:`${a.REQUESTS}/${t.id}`,className:"transition-colors duration-100 hover:text-white",children:e.jsx(m,{size:20})}),position:"end"}]},S=({hasMoreObject:a})=>e.jsxs("div",{children:[e.jsx(u,{columns:h(),data:a.data}),e.jsx(i,{paginatedPage:a})]});export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-Bg3-m46L.js";function g({method:e}){let r="bg-gray-100 text-gray-800 dark:bg-gray-600 dark:text-white";switch(e){case"GET":r="bg-gray-100 text-gray-800 dark:bg-gray-600 dark:text-white";break;case"POST":case"PUT":r="bg-blue-100 text-blue-800 dark:bg-blue-600 dark:text-white";break;case"DELETE":r="bg-red-100 text-red-800 dark:bg-red-600 dark:text-white";break}return t.jsx("span",{className:`rounded px-2 py-1 text-sm font-semibold ${r}`,children:e})}const a=e=>e>=200&&e<300?"bg-green-100 text-green-800 dark:bg-green-700 dark:text-green-100":e>=300&&e<400?"bg-blue-100 text-blue-800 dark:bg-blue-700 dark:text-blue-100":e>=400&&e<500?"bg-yellow-100 text-yellow-800 dark:bg-yellow-700 dark:text-yellow-100":e>=500?"bg-red-100 text-red-800 dark:bg-red-700 dark:text-red-100":"bg-gray-100 text-gray-800 dark:bg-neutral-700 dark:text-neutral-200",b=({status:e})=>t.jsx("span",{className:`rounded-lg px-2 py-1 text-sm font-semibold ${a(e)}`,children:e});export{g as R,b as S};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./JsonViewer-
|
|
2
|
-
import{j as e,r as n,R as i,_ as x}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./JsonViewer-CsEn0XaU.js","./index-Bg3-m46L.js","./index-CsnKQ5Mh.css","./copy-CwmmSmiO.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as e,r as n,R as i,_ as x}from"./index-Bg3-m46L.js";const b=({title:d,items:s,emptyMessage:t="No data available"})=>!s||s.length===0||s.every(a=>!a.value)?e.jsxs("div",{className:"bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-lg shadow-sm p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:d})," ",e.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400",children:t})]}):e.jsxs("div",{className:"bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-lg shadow-sm",children:[e.jsx("div",{className:"px-6 py-4 border-b border-gray-200 dark:border-neutral-700 bg-gray-50 dark:bg-neutral-900",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:d})}),e.jsx("div",{className:"px-6 py-4",children:e.jsx("div",{className:"space-y-4",children:s.map((a,l)=>e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-2",children:[e.jsx("div",{className:"w-full sm:w-32 flex-shrink-0",children:e.jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:a.label})}),e.jsx("div",{className:"flex-1",children:typeof a.value=="string"?e.jsx("span",{className:`text-sm ${a.className||""}`,children:a.value}):a.value})]},l))})})]}),c=i.lazy(()=>x(()=>import("./JsonViewer-CsEn0XaU.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),h=({tabs:d,title:s,defaultActiveTab:t})=>{const a=d.filter(r=>r.shouldShow===void 0||r.shouldShow),[l,o]=n.useState(t||a[0]?.id||"");return a.length?e.jsxs("div",{className:"border border-neutral-200 dark:border-neutral-700 rounded-[15px] shadow-sm",children:[s&&e.jsx("div",{className:"px-6 py-4 rounded-t-[15px] border-b border-neutral-200 dark:border-neutral-700 bg-neutral-50 dark:bg-neutral-900",children:e.jsx("h2",{className:"text-lg font-semibold text-neutral-900 dark:text-neutral-100",children:s})}),e.jsx("div",{className:"border-b rounded-[15px] border-neutral-200 dark:border-neutral-700",children:e.jsx("nav",{className:"flex space-x-8 px-6","aria-label":"Tabs",children:a.map(r=>e.jsx("button",{onClick:()=>o(r.id),className:`py-4 px-1 border-b-2 font-medium text-sm transition-colors duration-200 ${l===r.id?"border-blue-500 text-blue-600 dark:text-blue-400":"border-transparent text-neutral-500 dark:text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-300 hover:border-neutral-300 dark:hover:border-neutral-600"}`,children:r.label},r.id))})}),e.jsx("div",{className:"p-6",children:a.map(r=>e.jsx("div",{className:l===r.id?"block":"hidden",children:r.content?e.jsx("div",{children:r.content}):r.data&&e.jsx(n.Suspense,{fallback:e.jsx("div",{children:"Loading viewer…"}),children:e.jsx(c,{data:r.data})})},r.id))})]}):null};export{b as D,h as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as r,k as i,j as t,L as o}from"./index-
|
|
1
|
+
import{q as r,k as i,j as t,L as o}from"./index-Bg3-m46L.js";import{h as d}from"./index-BRRKsoNv.js";import{C as m}from"./Table-C3Y9tdtZ.js";const p=()=>{const a=r(i());return[{name:"Type",render:e=>t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"font-medium text-sm text-gray-900 dark:text-gray-100",children:e.data.name||t.jsx("span",{className:"italic text-gray-400",children:"Unknown"})}),t.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 truncate max-w-xs",title:e.data.message,children:e.data.message})]})},{name:"Happened",render:e=>{const{label:s,exact:n}=d(e.data.createdAt);return t.jsx("span",{title:n,children:s})},position:"end",class:"min-w-32"},{name:"Actions",render:e=>t.jsx(o,{to:`${a.EXCEPTIONS}/${e.id}`,className:"transition-colors duration-100 hover:text-white",children:t.jsx(m,{size:20})}),position:"end"}]};export{p as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as r,k as i,j as t,L as o}from"./index-
|
|
1
|
+
import{q as r,k as i,j as t,L as o}from"./index-Bg3-m46L.js";import{h as l}from"./index-BRRKsoNv.js";import{C as d}from"./Table-C3Y9tdtZ.js";function m(a){return t.jsx("span",{className:"text-red-600 dark:text-red-400 font-mono",children:a})}const p=()=>{const a=r(i());return[{name:"Query",render:e=>t.jsx("div",{className:"max-w-xl",children:t.jsx("code",{className:"text-sm font-mono text-slate-800 dark:text-slate-300 leading-relaxed line-clamp-1",title:e.data.query,children:m(e.data.query)})})},{name:"Duration",render:e=>t.jsx("div",{className:"col-span-1 text-right",children:t.jsx("span",{className:"text-sm text-slate-600 dark:text-slate-400 font-mono",children:e.data.duration})})},{name:"Provider",render:e=>t.jsx("div",{className:"col-span-2 text-right",children:t.jsx("span",{className:"text-sm text-slate-600 dark:text-slate-400 font-mono",children:e.data.type})})},{name:"Happened",render:e=>{const{label:s,exact:n}=l(e.data.createdAt);return t.jsx("span",{className:"text-nowrap",title:n,children:s})},position:"end",class:"min-w-32"},{name:"Actions",render:e=>t.jsx(o,{to:`${a.QUERIES}/${e.id}`,className:"transition-colors duration-100 hover:text-white",children:t.jsx(d,{size:20})}),position:"end"}]};export{p as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as o,k as r,j as t,L as i}from"./index-
|
|
1
|
+
import{q as o,k as r,j as t,L as i}from"./index-Bg3-m46L.js";import{h as m}from"./index-BRRKsoNv.js";import{C as c}from"./CacheActionBadge-B0d8J3l3.js";import{C as d}from"./Table-C3Y9tdtZ.js";const x=()=>{const a=o(r());return[{name:"Key",value:e=>e.data.data?.key??"__"},{name:"Operation",render:e=>t.jsx(c,{action:e.data.action})},{name:"Happened",render:e=>{const{label:n,exact:s}=m(e.data.createdAt);return t.jsx("span",{title:s,children:n})},position:"end",class:"min-w-32"},{name:"Actions",render:e=>t.jsx(i,{to:`${a.CACHE_ENTRIES}/${e.id}`,className:"transition-colors duration-100 hover:text-white",children:t.jsx(d,{size:20})}),position:"end"}]};export{x as g};
|