nestlens 0.6.1 → 0.7.0
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/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/route-path.d.ts +13 -0
- package/dist/api/route-path.d.ts.map +1 -1
- package/dist/api/route-path.js +24 -1
- package/dist/api/route-path.js.map +1 -1
- package/dist/api/stream.controller.d.ts +23 -0
- package/dist/api/stream.controller.d.ts.map +1 -0
- package/dist/api/stream.controller.js +49 -0
- package/dist/api/stream.controller.js.map +1 -0
- package/dist/core/alerting.service.d.ts +28 -0
- package/dist/core/alerting.service.d.ts.map +1 -0
- package/dist/core/alerting.service.js +157 -0
- package/dist/core/alerting.service.js.map +1 -0
- package/dist/core/collector.service.d.ts +5 -0
- package/dist/core/collector.service.d.ts.map +1 -1
- package/dist/core/collector.service.js +18 -0
- package/dist/core/collector.service.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/dashboard/public/assets/BatchesPage-CxMNNvPB.js +1 -0
- package/dist/dashboard/public/assets/CachePage-bCSHrxF4.js +1 -0
- package/dist/dashboard/public/assets/{ClickableBadge-BWNsj1rC.js → ClickableBadge-tED6n1-E.js} +1 -1
- package/dist/dashboard/public/assets/CommandsPage-B_DVjdZf.js +1 -0
- package/dist/dashboard/public/assets/{DashboardPage-DomAJ0y0.js → DashboardPage-Ds1BXF9B.js} +1 -1
- package/dist/dashboard/public/assets/DumpsPage-D5lFmw7H.js +1 -0
- package/dist/dashboard/public/assets/{EntryDetailPage-co7Dcryy.js → EntryDetailPage-CLMls5iQ.js} +1 -1
- package/dist/dashboard/public/assets/{EntrySearchInput-Dkpv3EPp.js → EntrySearchInput-CY7PniJH.js} +1 -1
- package/dist/dashboard/public/assets/EventsPage-n4Xydb1Y.js +1 -0
- package/dist/dashboard/public/assets/ExceptionsPage-BybuWw1Z.js +6 -0
- package/dist/dashboard/public/assets/GatesPage-B31blvt0.js +1 -0
- package/dist/dashboard/public/assets/GraphQLPage-BWtB-PGE.js +6 -0
- package/dist/dashboard/public/assets/HttpClientPage-CwuPZe_t.js +1 -0
- package/dist/dashboard/public/assets/JobsPage-CzgmVjvA.js +1 -0
- package/dist/dashboard/public/assets/LogsPage-DfqShIZ0.js +1 -0
- package/dist/dashboard/public/assets/MailPage-BqqF1l7c.js +1 -0
- package/dist/dashboard/public/assets/ModelsPage-Dw6ov4fO.js +1 -0
- package/dist/dashboard/public/assets/NotificationsPage-DJpp_0i0.js +1 -0
- package/dist/dashboard/public/assets/PageHeader-DiA3Krqw.js +1 -0
- package/dist/dashboard/public/assets/QueriesPage-Bi54SgjS.js +1 -0
- package/dist/dashboard/public/assets/RedisPage-DBfjRmyi.js +1 -0
- package/dist/dashboard/public/assets/RequestsPage-CoFD7pb1.js +1 -0
- package/dist/dashboard/public/assets/SchedulePage-BIQ5qqiE.js +1 -0
- package/dist/dashboard/public/assets/ViewsPage-BipJ5H5b.js +1 -0
- package/dist/dashboard/public/assets/{calendar-D9Y022zL.js → calendar-CMo_t_Lj.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-FDNfDBn8.js → circle-check-big-DTlljTn_.js} +1 -1
- package/dist/dashboard/public/assets/{eye-GaOYzAa7.js → eye-Dd78IRyj.js} +1 -1
- package/dist/dashboard/public/assets/{index-V-asXVHK.js → index-Bu05f2IL.js} +2 -2
- package/dist/dashboard/public/assets/{search-CKB8AiT_.js → search-Dv95NMlq.js} +1 -1
- package/dist/dashboard/public/assets/{types-aR3e-Gw0.js → types-B4KH4dQ2.js} +1 -1
- package/dist/dashboard/public/assets/{zap-C0BHz5Uq.js → zap-CN43tPyF.js} +1 -1
- package/dist/dashboard/public/index.html +1 -1
- package/dist/nestlens.config.d.ts +37 -2
- package/dist/nestlens.config.d.ts.map +1 -1
- package/dist/nestlens.config.js.map +1 -1
- package/dist/nestlens.module.d.ts +2 -2
- package/dist/nestlens.module.d.ts.map +1 -1
- package/dist/nestlens.module.js +14 -3
- package/dist/nestlens.module.js.map +1 -1
- package/dist/watchers/exception.watcher.d.ts +3 -2
- package/dist/watchers/exception.watcher.d.ts.map +1 -1
- package/dist/watchers/exception.watcher.js +7 -6
- package/dist/watchers/exception.watcher.js.map +1 -1
- package/dist/watchers/request.watcher.d.ts +3 -2
- package/dist/watchers/request.watcher.d.ts.map +1 -1
- package/dist/watchers/request.watcher.js +9 -6
- package/dist/watchers/request.watcher.js.map +1 -1
- package/package.json +1 -1
- package/dist/dashboard/public/assets/BatchesPage-CXwwl5Hl.js +0 -1
- package/dist/dashboard/public/assets/CachePage-C5s_wLWD.js +0 -1
- package/dist/dashboard/public/assets/CommandsPage-DdhtQEOn.js +0 -1
- package/dist/dashboard/public/assets/DumpsPage-COkSbmvW.js +0 -1
- package/dist/dashboard/public/assets/EventsPage-aGJyT2Dt.js +0 -1
- package/dist/dashboard/public/assets/ExceptionsPage-B47itW5o.js +0 -6
- package/dist/dashboard/public/assets/GatesPage-I7DiAYhZ.js +0 -1
- package/dist/dashboard/public/assets/GraphQLPage-BTYmAxzO.js +0 -6
- package/dist/dashboard/public/assets/HttpClientPage-D4g5yRkH.js +0 -1
- package/dist/dashboard/public/assets/JobsPage-BNzVui9c.js +0 -1
- package/dist/dashboard/public/assets/LogsPage-BiBTLT5l.js +0 -1
- package/dist/dashboard/public/assets/MailPage-CrQrou3V.js +0 -1
- package/dist/dashboard/public/assets/ModelsPage-C_NpOedi.js +0 -1
- package/dist/dashboard/public/assets/NotificationsPage-Qqc0mzhF.js +0 -1
- package/dist/dashboard/public/assets/PageHeader-CS_0HC5z.js +0 -1
- package/dist/dashboard/public/assets/QueriesPage-DmW1UBGD.js +0 -1
- package/dist/dashboard/public/assets/RedisPage-DAGfKxGJ.js +0 -1
- package/dist/dashboard/public/assets/RequestsPage-DdjvNM7B.js +0 -1
- package/dist/dashboard/public/assets/SchedulePage-Bkr6Qz7A.js +0 -1
- package/dist/dashboard/public/assets/ViewsPage-DIZ4rpuU.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DashboardPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DashboardPage-Ds1BXF9B.js","./vendor-B2nVRih0.js","./ClickableBadge-tED6n1-E.js","./zap-CN43tPyF.js","./calendar-CMo_t_Lj.js","./RequestsPage-CoFD7pb1.js","./PageHeader-DiA3Krqw.js","./EntrySearchInput-CY7PniJH.js","./search-Dv95NMlq.js","./types-B4KH4dQ2.js","./QueriesPage-Bi54SgjS.js","./ExceptionsPage-BybuWw1Z.js","./circle-check-big-DTlljTn_.js","./LogsPage-DfqShIZ0.js","./EventsPage-n4Xydb1Y.js","./JobsPage-CzgmVjvA.js","./CachePage-bCSHrxF4.js","./MailPage-BqqF1l7c.js","./SchedulePage-BIQ5qqiE.js","./format-BFldcnCk.js","./HttpClientPage-CwuPZe_t.js","./RedisPage-DBfjRmyi.js","./ModelsPage-Dw6ov4fO.js","./NotificationsPage-DJpp_0i0.js","./ViewsPage-BipJ5H5b.js","./eye-Dd78IRyj.js","./CommandsPage-B_DVjdZf.js","./GatesPage-B31blvt0.js","./BatchesPage-CxMNNvPB.js","./DumpsPage-D5lFmw7H.js","./GraphQLPage-BWtB-PGE.js","./EntryDetailPage-CLMls5iQ.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Se=Object.defineProperty;var _e=(s,a,e)=>a in s?Se(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e;var z=(s,a,e)=>_e(s,typeof a!="symbol"?a+"":a,e);import{r as Ee,a as Ne,g as Pe,b as r,u as Ce,L as D,O as Re,R as Le,c as p,N as Te,d as Ae,B as Oe}from"./vendor-B2nVRih0.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const n of o.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&i(n)}).observe(document,{childList:!0,subtree:!0});function e(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=e(l);fetch(l.href,o)}})();var G={exports:{}},M={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
@@ -358,4 +358,4 @@ to {
|
|
|
358
358
|
*
|
|
359
359
|
* This source code is licensed under the ISC license.
|
|
360
360
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const es=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ke=()=>window.__NESTLENS_BASE__??"",ts=s=>`${window.location.origin}${ke()}/__nestlens__${s}`,ve=ts("/api");async function P(s,a){const e=await fetch(`${ve}${s}`,a);if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function Ds(s){return P(`/entries/${s}`)}async function ss(){return P("/stats")}async function as(){return(await fetch(`${ve}/entries`,{method:"DELETE"})).json()}async function Ms(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search)}return P(`/entries/cursor?${a.toString()}`)}async function qs(s){const a=new URLSearchParams;return s&&a.set("type",s),P(`/entries/latest-sequence?${a.toString()}`)}async function $s(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),P(`/entries/check-new?${e.toString()}`)}async function zs(){return P("/storage/stats")}async function Is(){return P("/pruning/status")}async function Ks(){return P("/pruning/run",{method:"POST"})}async function Vs(s){return P(`/entries/${s}/resolve`,{method:"PATCH"})}async function Bs(s){return P(`/entries/${s}/unresolve`,{method:"PATCH"})}async function rs(s){return P("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function ns(){return P("/recording/resume",{method:"POST"})}async function os(){return P("/recording/status")}function is(s){const a=r.useCallback(e=>{const i=e.target,l=i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable;for(const o of s){const{key:n,ctrl:c,meta:d,shift:y,alt:u,handler:m,preventDefault:f=!0}=o;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),v=y?e.shiftKey:!e.shiftKey,h=u?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&v&&h){f&&e.preventDefault(),m(e);return}continue}if(d){if(e.metaKey&&!e.ctrlKey&&j&&v&&h){f&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&v&&h){f&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}const we=r.createContext(void 0);function ls({children:s}){const[a,e]=r.useState(null),[i,l]=r.useState(null),o=r.useRef(!0),n=r.useCallback(async()=>{try{const c=await ss();e(c.data),l(null)}catch(c){const d=c instanceof Error?c:new Error("Failed to fetch stats");l(d),console.error("Failed to fetch stats:",c),o.current&&q.error("Failed to load statistics")}finally{o.current=!1}},[]);return r.useEffect(()=>{n();const c=setInterval(n,1e4);return()=>clearInterval(c)},[n]),t.jsx(we.Provider,{value:{stats:a,error:i,refreshStats:n},children:s})}function cs(){const s=r.useContext(we);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function ce(){const[s,a]=r.useState(null),[e,i]=r.useState(!1);r.useEffect(()=>{const o=async()=>{try{const c=await os();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};o();const n=setInterval(o,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){i(!0);try{if(s.isPaused){const o=await ns();a(o.data),q.success("Recording resumed")}else{const o=await rs();a(o.data),q.success("Recording paused")}}catch{q.error("Failed to toggle recording")}finally{i(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Qt,{className:"h-5 w-5"}):t.jsx(Jt,{className:"h-5 w-5"})}):null}const de={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},ue=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Bt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:At,colorKey:"request"},{name:"Queries",href:"/queries",icon:$t,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:It,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:be,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:zt,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:Mt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:qt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Gt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:Yt,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:Dt,colorKey:"redis"},{name:"Models",href:"/models",icon:Vt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Kt,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ft,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:Ot,colorKey:"notification"},{name:"Events",href:"/events",icon:Wt,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Ut,colorKey:"view"},{name:"Gates",href:"/gates",icon:Xt,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function ds(){const s=Ce(),[a,e]=r.useState(!1),{stats:i}=cs(),[l,o]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[d,y]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),u=r.useCallback(h=>{o(k=>{const E=new Set(k);return E.has(h)?E.delete(h):E.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...E])),E})},[]),m=r.useCallback(h=>{if(!i)return 0;switch(h){case"exceptions":return i.unresolvedExceptions??i.byType.exception??0;default:return 0}},[i]),f=r.useCallback(h=>{let k=!1;h==="system"?k=window.matchMedia("(prefers-color-scheme: dark)").matches:k=h==="dark",k?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(k)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";y(h),localStorage.setItem("nestlens-theme",h),f(h)},[n,f]),v=r.useCallback(async()=>{window.confirm("Are you sure you want to clear all entries?")&&(await as(),q.success("All entries cleared"),window.location.reload())},[]);return r.useEffect(()=>{if(f(d),d==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)"),k=E=>{const b=E.matches;b?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(b)};return h.addEventListener("change",k),()=>h.removeEventListener("change",k)}},[d,f]),is([{key:"k",ctrl:!0,handler:()=>v()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(es,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:ue.map((h,k)=>{const E=l.has(h.name);return t.jsxs("div",{className:k>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>u(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!E,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?m(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${N?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${de[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),C>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:C>99?"99+":C})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(ce,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:v,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(D,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(U,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.6.1"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:ue.map((h,k)=>{const E=l.has(h.name);return t.jsxs("div",{className:k>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>u(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!E,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?m(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${N?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${de[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),C>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${N?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:C>99?"99+":C})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(ce,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:v,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Ht,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Re,{})})]})]})}function x(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const us=r.lazy(()=>w(()=>import("./DashboardPage-DomAJ0y0.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),hs=r.lazy(()=>w(()=>import("./RequestsPage-DdjvNM7B.js"),__vite__mapDeps([5,1,2,6,7,8,9]),import.meta.url)),ms=r.lazy(()=>w(()=>import("./QueriesPage-DmW1UBGD.js"),__vite__mapDeps([10,1,2,6,7,8,9,3]),import.meta.url)),ps=r.lazy(()=>w(()=>import("./ExceptionsPage-B47itW5o.js"),__vite__mapDeps([11,1,2,6,7,8,9,12]),import.meta.url)),xs=r.lazy(()=>w(()=>import("./LogsPage-BiBTLT5l.js"),__vite__mapDeps([13,1,2,6,7,8,9]),import.meta.url)),fs=r.lazy(()=>w(()=>import("./EventsPage-aGJyT2Dt.js"),__vite__mapDeps([14,1,2,6,9]),import.meta.url)),ys=r.lazy(()=>w(()=>import("./JobsPage-BNzVui9c.js"),__vite__mapDeps([15,1,2,6,9]),import.meta.url)),gs=r.lazy(()=>w(()=>import("./CachePage-C5s_wLWD.js"),__vite__mapDeps([16,1,2,6,9]),import.meta.url)),js=r.lazy(()=>w(()=>import("./MailPage-CrQrou3V.js"),__vite__mapDeps([17,1,2,6,9]),import.meta.url)),bs=r.lazy(()=>w(()=>import("./SchedulePage-Bkr6Qz7A.js"),__vite__mapDeps([18,1,19,2,6,9]),import.meta.url)),ks=r.lazy(()=>w(()=>import("./HttpClientPage-D4g5yRkH.js"),__vite__mapDeps([20,1,2,6,9]),import.meta.url)),vs=r.lazy(()=>w(()=>import("./RedisPage-DAGfKxGJ.js"),__vite__mapDeps([21,1,2,6,9]),import.meta.url)),ws=r.lazy(()=>w(()=>import("./ModelsPage-C_NpOedi.js"),__vite__mapDeps([22,1,2,6,9]),import.meta.url)),Ss=r.lazy(()=>w(()=>import("./NotificationsPage-Qqc0mzhF.js"),__vite__mapDeps([23,1,2,6,9]),import.meta.url)),_s=r.lazy(()=>w(()=>import("./ViewsPage-DIZ4rpuU.js"),__vite__mapDeps([24,1,2,6,9,25]),import.meta.url)),Es=r.lazy(()=>w(()=>import("./CommandsPage-DdhtQEOn.js"),__vite__mapDeps([26,1,2,6,9]),import.meta.url)),Ns=r.lazy(()=>w(()=>import("./GatesPage-I7DiAYhZ.js"),__vite__mapDeps([27,1,2,6,9]),import.meta.url)),Ps=r.lazy(()=>w(()=>import("./BatchesPage-CXwwl5Hl.js"),__vite__mapDeps([28,1,2,6,9]),import.meta.url)),Cs=r.lazy(()=>w(()=>import("./DumpsPage-COkSbmvW.js"),__vite__mapDeps([29,1,2,6,9]),import.meta.url)),Rs=r.lazy(()=>w(()=>import("./GraphQLPage-BTYmAxzO.js"),__vite__mapDeps([30,1,2,7,8,6,9]),import.meta.url)),S=r.lazy(()=>w(()=>import("./EntryDetailPage-co7Dcryy.js"),__vite__mapDeps([31,1,2,9,8,3,12,19,4,25]),import.meta.url));function Ls(){return t.jsx(Le,{children:t.jsxs(p,{path:"/",element:t.jsx(ds,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(us,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(hs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ms,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Te,{to:"/",replace:!0})})]})})}class Ts extends r.Component{constructor(){super(...arguments);z(this,"state",{hasError:!1});z(this,"handleReload",()=>{window.location.reload()});z(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,i){console.error("ErrorBoundary caught an error:",e,i),this.setState({errorInfo:i})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(be,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(Zt,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}ze.createRoot(document.getElementById("root")).render(t.jsx(Ae.StrictMode,{children:t.jsx(Ts,{children:t.jsx(Oe,{basename:ke(),children:t.jsxs(ls,{children:[t.jsx(Ls,{}),t.jsx(Nt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{At as A,Mt as B,qt as C,$t as D,zt as F,It as G,ne as H,Vt as L,Ft as M,Gt as P,Wt as R,Xt as S,be as T,es as X,Yt as a,Dt as b,g as c,Kt as d,Ot as e,Ut as f,ae as g,le as h,Zt as i,t as j,zs as k,Is as l,Ms as m,Bs as n,Vs as o,qs as p,$s as q,Ks as r,se as s,Qt as t,cs as u,Ds as v,q as z};
|
|
361
|
+
*/const es=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ke=()=>window.__NESTLENS_BASE__??"",ts=s=>`${window.location.origin}${ke()}/__nestlens__${s}`,ve=ts("/api");async function P(s,a){const e=await fetch(`${ve}${s}`,a);if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function Ds(s){return P(`/entries/${s}`)}async function ss(){return P("/stats")}async function as(){return(await fetch(`${ve}/entries`,{method:"DELETE"})).json()}async function Ms(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search)}return P(`/entries/cursor?${a.toString()}`)}async function qs(s){const a=new URLSearchParams;return s&&a.set("type",s),P(`/entries/latest-sequence?${a.toString()}`)}async function $s(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),P(`/entries/check-new?${e.toString()}`)}async function zs(){return P("/storage/stats")}async function Is(){return P("/pruning/status")}async function Ks(){return P("/pruning/run",{method:"POST"})}async function Vs(s){return P(`/entries/${s}/resolve`,{method:"PATCH"})}async function Bs(s){return P(`/entries/${s}/unresolve`,{method:"PATCH"})}async function rs(s){return P("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function ns(){return P("/recording/resume",{method:"POST"})}async function os(){return P("/recording/status")}function is(s){const a=r.useCallback(e=>{const i=e.target,l=i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable;for(const o of s){const{key:n,ctrl:c,meta:d,shift:y,alt:u,handler:m,preventDefault:f=!0}=o;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),v=y?e.shiftKey:!e.shiftKey,h=u?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&v&&h){f&&e.preventDefault(),m(e);return}continue}if(d){if(e.metaKey&&!e.ctrlKey&&j&&v&&h){f&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&v&&h){f&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}const we=r.createContext(void 0);function ls({children:s}){const[a,e]=r.useState(null),[i,l]=r.useState(null),o=r.useRef(!0),n=r.useCallback(async()=>{try{const c=await ss();e(c.data),l(null)}catch(c){const d=c instanceof Error?c:new Error("Failed to fetch stats");l(d),console.error("Failed to fetch stats:",c),o.current&&q.error("Failed to load statistics")}finally{o.current=!1}},[]);return r.useEffect(()=>{n();const c=setInterval(n,1e4);return()=>clearInterval(c)},[n]),t.jsx(we.Provider,{value:{stats:a,error:i,refreshStats:n},children:s})}function cs(){const s=r.useContext(we);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function ce(){const[s,a]=r.useState(null),[e,i]=r.useState(!1);r.useEffect(()=>{const o=async()=>{try{const c=await os();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};o();const n=setInterval(o,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){i(!0);try{if(s.isPaused){const o=await ns();a(o.data),q.success("Recording resumed")}else{const o=await rs();a(o.data),q.success("Recording paused")}}catch{q.error("Failed to toggle recording")}finally{i(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Qt,{className:"h-5 w-5"}):t.jsx(Jt,{className:"h-5 w-5"})}):null}const de={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},ue=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Bt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:At,colorKey:"request"},{name:"Queries",href:"/queries",icon:$t,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:It,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:be,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:zt,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:Mt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:qt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Gt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:Yt,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:Dt,colorKey:"redis"},{name:"Models",href:"/models",icon:Vt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Kt,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ft,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:Ot,colorKey:"notification"},{name:"Events",href:"/events",icon:Wt,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Ut,colorKey:"view"},{name:"Gates",href:"/gates",icon:Xt,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function ds(){const s=Ce(),[a,e]=r.useState(!1),{stats:i}=cs(),[l,o]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[d,y]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),u=r.useCallback(h=>{o(k=>{const E=new Set(k);return E.has(h)?E.delete(h):E.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...E])),E})},[]),m=r.useCallback(h=>{if(!i)return 0;switch(h){case"exceptions":return i.unresolvedExceptions??i.byType.exception??0;default:return 0}},[i]),f=r.useCallback(h=>{let k=!1;h==="system"?k=window.matchMedia("(prefers-color-scheme: dark)").matches:k=h==="dark",k?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(k)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";y(h),localStorage.setItem("nestlens-theme",h),f(h)},[n,f]),v=r.useCallback(async()=>{window.confirm("Are you sure you want to clear all entries?")&&(await as(),q.success("All entries cleared"),window.location.reload())},[]);return r.useEffect(()=>{if(f(d),d==="system"){const h=window.matchMedia("(prefers-color-scheme: dark)"),k=E=>{const b=E.matches;b?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(b)};return h.addEventListener("change",k),()=>h.removeEventListener("change",k)}},[d,f]),is([{key:"k",ctrl:!0,handler:()=>v()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(es,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:ue.map((h,k)=>{const E=l.has(h.name);return t.jsxs("div",{className:k>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>u(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!E,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?m(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${N?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${de[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),C>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:C>99?"99+":C})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(ce,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:v,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(D,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(U,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.7.0"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:ue.map((h,k)=>{const E=l.has(h.name);return t.jsxs("div",{className:k>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>u(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!E,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?m(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${N?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${de[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),C>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${N?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:C>99?"99+":C})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(ce,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:v,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Ht,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Re,{})})]})]})}function x(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const us=r.lazy(()=>w(()=>import("./DashboardPage-Ds1BXF9B.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),hs=r.lazy(()=>w(()=>import("./RequestsPage-CoFD7pb1.js"),__vite__mapDeps([5,1,2,6,7,8,9]),import.meta.url)),ms=r.lazy(()=>w(()=>import("./QueriesPage-Bi54SgjS.js"),__vite__mapDeps([10,1,2,6,7,8,9,3]),import.meta.url)),ps=r.lazy(()=>w(()=>import("./ExceptionsPage-BybuWw1Z.js"),__vite__mapDeps([11,1,2,6,7,8,9,12]),import.meta.url)),xs=r.lazy(()=>w(()=>import("./LogsPage-DfqShIZ0.js"),__vite__mapDeps([13,1,2,6,7,8,9]),import.meta.url)),fs=r.lazy(()=>w(()=>import("./EventsPage-n4Xydb1Y.js"),__vite__mapDeps([14,1,2,6,9]),import.meta.url)),ys=r.lazy(()=>w(()=>import("./JobsPage-CzgmVjvA.js"),__vite__mapDeps([15,1,2,6,9]),import.meta.url)),gs=r.lazy(()=>w(()=>import("./CachePage-bCSHrxF4.js"),__vite__mapDeps([16,1,2,6,9]),import.meta.url)),js=r.lazy(()=>w(()=>import("./MailPage-BqqF1l7c.js"),__vite__mapDeps([17,1,2,6,9]),import.meta.url)),bs=r.lazy(()=>w(()=>import("./SchedulePage-BIQ5qqiE.js"),__vite__mapDeps([18,1,19,2,6,9]),import.meta.url)),ks=r.lazy(()=>w(()=>import("./HttpClientPage-CwuPZe_t.js"),__vite__mapDeps([20,1,2,6,9]),import.meta.url)),vs=r.lazy(()=>w(()=>import("./RedisPage-DBfjRmyi.js"),__vite__mapDeps([21,1,2,6,9]),import.meta.url)),ws=r.lazy(()=>w(()=>import("./ModelsPage-Dw6ov4fO.js"),__vite__mapDeps([22,1,2,6,9]),import.meta.url)),Ss=r.lazy(()=>w(()=>import("./NotificationsPage-DJpp_0i0.js"),__vite__mapDeps([23,1,2,6,9]),import.meta.url)),_s=r.lazy(()=>w(()=>import("./ViewsPage-BipJ5H5b.js"),__vite__mapDeps([24,1,2,6,9,25]),import.meta.url)),Es=r.lazy(()=>w(()=>import("./CommandsPage-B_DVjdZf.js"),__vite__mapDeps([26,1,2,6,9]),import.meta.url)),Ns=r.lazy(()=>w(()=>import("./GatesPage-B31blvt0.js"),__vite__mapDeps([27,1,2,6,9]),import.meta.url)),Ps=r.lazy(()=>w(()=>import("./BatchesPage-CxMNNvPB.js"),__vite__mapDeps([28,1,2,6,9]),import.meta.url)),Cs=r.lazy(()=>w(()=>import("./DumpsPage-D5lFmw7H.js"),__vite__mapDeps([29,1,2,6,9]),import.meta.url)),Rs=r.lazy(()=>w(()=>import("./GraphQLPage-BWtB-PGE.js"),__vite__mapDeps([30,1,2,7,8,6,9]),import.meta.url)),S=r.lazy(()=>w(()=>import("./EntryDetailPage-CLMls5iQ.js"),__vite__mapDeps([31,1,2,9,8,3,12,19,4,25]),import.meta.url));function Ls(){return t.jsx(Le,{children:t.jsxs(p,{path:"/",element:t.jsx(ds,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(us,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(hs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ms,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(x,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Te,{to:"/",replace:!0})})]})})}class Ts extends r.Component{constructor(){super(...arguments);z(this,"state",{hasError:!1});z(this,"handleReload",()=>{window.location.reload()});z(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,i){console.error("ErrorBoundary caught an error:",e,i),this.setState({errorInfo:i})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(be,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(Zt,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}ze.createRoot(document.getElementById("root")).render(t.jsx(Ae.StrictMode,{children:t.jsx(Ts,{children:t.jsx(Oe,{basename:ke(),children:t.jsxs(ls,{children:[t.jsx(Ls,{}),t.jsx(Nt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{At as A,Mt as B,qt as C,$t as D,zt as F,It as G,ne as H,Vt as L,Ft as M,Gt as P,Wt as R,Xt as S,be as T,es as X,Yt as a,Dt as b,g as c,Kt as d,Ot as e,Ut as f,ae as g,le as h,Zt as i,t as j,zs as k,Is as l,Ms as m,Bs as n,Vs as o,ts as p,qs as q,Ks as r,$s as s,se as t,cs as u,Qt as v,Ds as w,q as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as q,j as t,g as A}from"./index-
|
|
1
|
+
import{c as q,j as t,g as A}from"./index-Bu05f2IL.js";import{b as d}from"./vendor-B2nVRih0.js";import{g as b}from"./ClickableBadge-tED6n1-E.js";/**
|
|
2
2
|
* @license lucide-react v0.468.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="./nestlens-icon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>NestLens - Debug Dashboard</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-Bu05f2IL.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/vendor-B2nVRih0.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="./assets/index-FAG28XEI.css">
|
|
11
11
|
</head>
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
import type { Request } from 'express';
|
|
2
|
-
import { Entry } from './types';
|
|
2
|
+
import { Entry, EntryType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Payload format for an alerting webhook.
|
|
5
|
+
* - 'slack': Slack incoming-webhook JSON (`{ text }`)
|
|
6
|
+
* - 'discord': Discord webhook JSON (`{ content }`)
|
|
7
|
+
* - 'generic': raw `{ event, entry }` JSON
|
|
8
|
+
*/
|
|
9
|
+
export type AlertingWebhookType = 'slack' | 'discord' | 'generic';
|
|
10
|
+
/**
|
|
11
|
+
* A single alerting destination.
|
|
12
|
+
*/
|
|
13
|
+
export interface AlertingWebhook {
|
|
14
|
+
/** Webhook URL to POST alerts to. */
|
|
15
|
+
url: string;
|
|
16
|
+
/** Payload format. Default: 'generic'. */
|
|
17
|
+
type?: AlertingWebhookType;
|
|
18
|
+
/** Entry types that trigger this webhook. Default: ['exception']. */
|
|
19
|
+
events?: EntryType[];
|
|
20
|
+
/** Minimum milliseconds between alerts sharing the same dedup key. Default: 60000. */
|
|
21
|
+
throttleMs?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Proactive alerting: POST collected entries (exceptions by default) to webhooks.
|
|
25
|
+
*/
|
|
26
|
+
export interface AlertingConfig {
|
|
27
|
+
enabled?: boolean;
|
|
28
|
+
/** One or more webhook destinations. */
|
|
29
|
+
webhooks?: AlertingWebhook[];
|
|
30
|
+
/** Per-delivery timeout in milliseconds. Default: 5000. */
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
}
|
|
3
33
|
/**
|
|
4
34
|
* Authenticated user information returned from authorization
|
|
5
35
|
*/
|
|
@@ -346,6 +376,11 @@ export interface NestLensConfig {
|
|
|
346
376
|
* Security configuration for data masking and input validation.
|
|
347
377
|
*/
|
|
348
378
|
security?: SecurityConfig;
|
|
379
|
+
/**
|
|
380
|
+
* Proactive alerting — POST collected entries (exceptions by default) to
|
|
381
|
+
* Slack/Discord/generic webhooks. Disabled by default.
|
|
382
|
+
*/
|
|
383
|
+
alerting?: AlertingConfig;
|
|
349
384
|
/**
|
|
350
385
|
* Filter function to determine if an entry should be collected.
|
|
351
386
|
* Return true to collect the entry, false to skip it.
|
|
@@ -380,7 +415,7 @@ export interface NestLensConfig {
|
|
|
380
415
|
graphql?: boolean | GraphQLWatcherConfig;
|
|
381
416
|
};
|
|
382
417
|
}
|
|
383
|
-
export declare const DEFAULT_CONFIG: Required<Omit<NestLensConfig, 'allowedIps' | 'canAccess' | 'authorization' | 'filter' | 'filterBatch' | 'rateLimit' | 'security'>> & {
|
|
418
|
+
export declare const DEFAULT_CONFIG: Required<Omit<NestLensConfig, 'allowedIps' | 'canAccess' | 'authorization' | 'filter' | 'filterBatch' | 'rateLimit' | 'security' | 'alerting'>> & {
|
|
384
419
|
authorization: AuthorizationConfig;
|
|
385
420
|
allowedIps?: string[];
|
|
386
421
|
canAccess?: (req: Request) => boolean | AuthUser | Promise<boolean | AuthUser>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestlens.config.d.ts","sourceRoot":"","sources":["../src/nestlens.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"nestlens.config.d.ts","sourceRoot":"","sources":["../src/nestlens.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,qEAAqE;IACrE,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,sFAAsF;IACtF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM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,CAAC;KAC1C,CAAC;CACH;AAED,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,IAAI,CACF,cAAc,EACZ,YAAY,GACZ,WAAW,GACX,eAAe,GACf,QAAQ,GACR,aAAa,GACb,WAAW,GACX,UAAU,GACV,UAAU,CACb,CACF,GAAG;IACF,aAAa,EAAE,mBAAmB,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC/E,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/D,SAAS,CAAC,EAAE,eAAe,GAAG,KAAK,CAAC;IACpC,QAAQ,CAAC,EAAE,cAAc,CAAC;CA4D3B,CAAC;AAEF,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestlens.config.js","sourceRoot":"","sources":["../src/nestlens.config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"nestlens.config.js","sourceRoot":"","sources":["../src/nestlens.config.ts"],"names":[],"mappings":";;;AAsfa,QAAA,cAAc,GAoBvB;IACF,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,WAAW;IACjB,aAAa,EAAE;QACb,mBAAmB,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC;QACrD,mBAAmB,EAAE,UAAU;QAC/B,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,SAAS;QACpB,aAAa,EAAE,SAA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* RoutesResolver reads them during `app.init()`. `forRoot()` runs well ahead
|
|
12
12
|
* of that, so rewriting the metadata here is what makes `path` take effect.
|
|
13
13
|
*
|
|
14
|
-
* Every controller — dashboard, API and
|
|
15
|
-
* whole surface stays reachable under a single prefix.
|
|
14
|
+
* Every controller — dashboard, API, tags and the SSE stream — moves as one
|
|
15
|
+
* unit, so the whole surface stays reachable under a single prefix.
|
|
16
16
|
*/
|
|
17
17
|
private static mountControllersAt;
|
|
18
18
|
private static mergeConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestlens.module.d.ts","sourceRoot":"","sources":["../src/nestlens.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGb,kBAAkB,EAElB,UAAU,EACV,YAAY,EAGb,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,cAAc,EAGf,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"nestlens.module.d.ts","sourceRoot":"","sources":["../src/nestlens.module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGb,kBAAkB,EAElB,UAAU,EACV,YAAY,EAGb,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,cAAc,EAGf,MAAM,mBAAmB,CAAC;AA+I3B,qBACa,cAAe,YAAW,UAAU,EAAE,YAAY;IAC7D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAA0B;IAExD,MAAM,CAAC,OAAO,CAAC,MAAM,GAAE,cAAmB,GAAG,aAAa;IAwJ1D;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAqBjC,OAAO,CAAC,MAAM,CAAC,WAAW;IAmB1B,SAAS,CAAC,QAAQ,EAAE,kBAAkB;IAIhC,YAAY;CAGnB"}
|
package/dist/nestlens.module.js
CHANGED
|
@@ -14,6 +14,7 @@ const core_1 = require("@nestjs/core");
|
|
|
14
14
|
const nestlens_config_1 = require("./nestlens.config");
|
|
15
15
|
const route_path_1 = require("./api/route-path");
|
|
16
16
|
const collector_service_1 = require("./core/collector.service");
|
|
17
|
+
const alerting_service_1 = require("./core/alerting.service");
|
|
17
18
|
const pruning_service_1 = require("./core/pruning.service");
|
|
18
19
|
const tag_service_1 = require("./core/tag.service");
|
|
19
20
|
const family_hash_service_1 = require("./core/family-hash.service");
|
|
@@ -130,7 +131,12 @@ let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
|
130
131
|
}
|
|
131
132
|
const providers = [api_1.NestLensGuard];
|
|
132
133
|
// API controllers must be registered before Dashboard to prevent catch-all from overriding API routes
|
|
133
|
-
const controllers = [
|
|
134
|
+
const controllers = [
|
|
135
|
+
api_1.NestLensApiController,
|
|
136
|
+
api_1.TagController,
|
|
137
|
+
api_1.NestLensStreamController,
|
|
138
|
+
api_1.DashboardController,
|
|
139
|
+
];
|
|
134
140
|
this.mountControllersAt(mergedConfig.path);
|
|
135
141
|
const imports = [
|
|
136
142
|
// Core module provides shared services (config, storage, collector, pruning)
|
|
@@ -180,6 +186,10 @@ let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
|
180
186
|
if (mergedConfig.watchers?.schedule) {
|
|
181
187
|
imports.push(NestLensScheduleModule.forRoot());
|
|
182
188
|
}
|
|
189
|
+
// Add Alerting (webhook notifications on collected entries)
|
|
190
|
+
if (mergedConfig.alerting?.enabled) {
|
|
191
|
+
providers.push(alerting_service_1.AlertingService);
|
|
192
|
+
}
|
|
183
193
|
// Add Mail Watcher
|
|
184
194
|
if (mergedConfig.watchers?.mail) {
|
|
185
195
|
providers.push(watchers_1.MailWatcher);
|
|
@@ -237,8 +247,8 @@ let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
|
237
247
|
* RoutesResolver reads them during `app.init()`. `forRoot()` runs well ahead
|
|
238
248
|
* of that, so rewriting the metadata here is what makes `path` take effect.
|
|
239
249
|
*
|
|
240
|
-
* Every controller — dashboard, API and
|
|
241
|
-
* whole surface stays reachable under a single prefix.
|
|
250
|
+
* Every controller — dashboard, API, tags and the SSE stream — moves as one
|
|
251
|
+
* unit, so the whole surface stays reachable under a single prefix.
|
|
242
252
|
*/
|
|
243
253
|
static mountControllersAt(path) {
|
|
244
254
|
const prefix = (0, route_path_1.toRoutePrefix)(path);
|
|
@@ -247,6 +257,7 @@ let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
|
247
257
|
[api_1.DashboardController, withPrefix('')],
|
|
248
258
|
[api_1.NestLensApiController, withPrefix(`${nestlens_config_1.NESTLENS_API_PREFIX}/api`)],
|
|
249
259
|
[api_1.TagController, withPrefix(`${nestlens_config_1.NESTLENS_API_PREFIX}/api/tags`)],
|
|
260
|
+
[api_1.NestLensStreamController, withPrefix(`${nestlens_config_1.NESTLENS_API_PREFIX}/stream`)],
|
|
250
261
|
];
|
|
251
262
|
for (const [controller, routePath] of mounts) {
|
|
252
263
|
Reflect.defineMetadata(constants_1.PATH_METADATA, routePath, controller);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestlens.module.js","sourceRoot":"","sources":["../src/nestlens.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAUwB;AACxB,wDAA2E;AAC3E,uCAA4E;AAC5E,uDAK2B;AAC3B,iDAAiD;AACjD,gEAA4D;AAC5D,4DAAwD;AACxD,oDAAgD;AAChD,oEAA+D;AAC/D,4CAAyC;AACzC,oEAA+D;AAC/D,+
|
|
1
|
+
{"version":3,"file":"nestlens.module.js","sourceRoot":"","sources":["../src/nestlens.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAUwB;AACxB,wDAA2E;AAC3E,uCAA4E;AAC5E,uDAK2B;AAC3B,iDAAiD;AACjD,gEAA4D;AAC5D,8DAA0D;AAC1D,4DAAwD;AACxD,oDAAgD;AAChD,oEAA+D;AAC/D,4CAAyC;AACzC,oEAA+D;AAC/D,+BAMe;AACf,yCAoBoB;AACpB,0DAIqC;AAErC;;;GAGG;AAGH,IAAM,kBAAkB,0BAAxB,MAAM,k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C,GAAG,qCAAmB,WAAW,CAAC,CAAC;YAC9D,CAAC,8BAAwB,EAAE,UAAU,CAAC,GAAG,qCAAmB,SAAS,CAAC,CAAC;SACxE,CAAC;QAEF,KAAK,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,MAAM,EAAE,CAAC;YAC7C,OAAO,CAAC,cAAc,CAAC,yBAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;YAC7D,8EAA8E;YAC9E,8EAA8E;YAC9E,uCAAuC;YACvC,OAAO,CAAC,cAAc,CAAC,4BAAgB,EAAE,wBAAe,EAAE,UAAU,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,WAAW,CAAC,MAAsB;QAC/C,OAAO;YACL,GAAG,gCAAc;YACjB,GAAG,MAAM;YACT,OAAO,EAAE;gBACP,GAAG,gCAAc,CAAC,OAAO;gBACzB,GAAG,MAAM,CAAC,OAAO;aAClB;YACD,OAAO,EAAE;gBACP,GAAG,gCAAc,CAAC,OAAO;gBACzB,GAAG,MAAM,CAAC,OAAO;aAClB;YACD,QAAQ,EAAE;gBACR,GAAG,gCAAc,CAAC,QAAQ;gBAC1B,GAAG,MAAM,CAAC,QAAQ;aACnB;SACF,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,QAA4B;QACpC,qCAAqC;IACvC,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,gBAAc,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACpD,CAAC;;AApNU,wCAAc;AACD,qBAAM,GAAG,IAAI,eAAM,CAAC,UAAU,CAAC,AAAzB,CAA0B;yBAD7C,cAAc;IAD1B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,cAAc,CAqN1B"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ArgumentsHost, ExceptionFilter } from '@nestjs/common';
|
|
2
|
-
import { HttpAdapterHost } from '@nestjs/core';
|
|
2
|
+
import { ApplicationConfig, HttpAdapterHost } from '@nestjs/core';
|
|
3
3
|
import { CollectorService } from '../core/collector.service';
|
|
4
4
|
import { NestLensConfig } from '../nestlens.config';
|
|
5
5
|
export declare class ExceptionWatcher implements ExceptionFilter {
|
|
6
6
|
private readonly collector;
|
|
7
7
|
private readonly nestlensConfig;
|
|
8
8
|
private readonly httpAdapterHost;
|
|
9
|
+
private readonly applicationConfig;
|
|
9
10
|
private readonly config;
|
|
10
|
-
constructor(collector: CollectorService, nestlensConfig: NestLensConfig, httpAdapterHost: HttpAdapterHost);
|
|
11
|
+
constructor(collector: CollectorService, nestlensConfig: NestLensConfig, httpAdapterHost: HttpAdapterHost, applicationConfig: ApplicationConfig);
|
|
11
12
|
catch(exception: Error, host: ArgumentsHost): void;
|
|
12
13
|
private getRequestPath;
|
|
13
14
|
private sendException;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exception.watcher.d.ts","sourceRoot":"","sources":["../../src/watchers/exception.watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,eAAe,EAIhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"exception.watcher.d.ts","sourceRoot":"","sources":["../../src/watchers/exception.watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,eAAe,EAIhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAA0B,cAAc,EAAmB,MAAM,oBAAoB,CAAC;AAG7F,qBAEa,gBAAiB,YAAW,eAAe;IAIpD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAPpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;gBAG7B,SAAS,EAAE,gBAAgB,EAE3B,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB;IAOvD,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI;IAgElD,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,mBAAmB;CAa5B"}
|
|
@@ -15,13 +15,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.ExceptionWatcher = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const core_1 = require("@nestjs/core");
|
|
18
|
+
const route_path_1 = require("../api/route-path");
|
|
18
19
|
const collector_service_1 = require("../core/collector.service");
|
|
19
20
|
const nestlens_config_1 = require("../nestlens.config");
|
|
20
21
|
let ExceptionWatcher = class ExceptionWatcher {
|
|
21
|
-
constructor(collector, nestlensConfig, httpAdapterHost) {
|
|
22
|
+
constructor(collector, nestlensConfig, httpAdapterHost, applicationConfig) {
|
|
22
23
|
this.collector = collector;
|
|
23
24
|
this.nestlensConfig = nestlensConfig;
|
|
24
25
|
this.httpAdapterHost = httpAdapterHost;
|
|
26
|
+
this.applicationConfig = applicationConfig;
|
|
25
27
|
const watcherConfig = nestlensConfig.watchers?.exception;
|
|
26
28
|
this.config =
|
|
27
29
|
typeof watcherConfig === 'object' ? watcherConfig : { enabled: watcherConfig !== false };
|
|
@@ -44,11 +46,9 @@ let ExceptionWatcher = class ExceptionWatcher {
|
|
|
44
46
|
this.sendException(exception, response);
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
|
-
// Skip NestLens own
|
|
49
|
+
// Skip NestLens's own traffic — dashboard, API and event stream.
|
|
48
50
|
const requestPath = this.getRequestPath(request);
|
|
49
|
-
|
|
50
|
-
const apiPrefix = `/${nestlens_config_1.NESTLENS_API_PREFIX}`;
|
|
51
|
-
if (requestPath.startsWith(nestlensPath) || requestPath.startsWith(apiPrefix)) {
|
|
51
|
+
if ((0, route_path_1.isNestLensRequest)(requestPath, this.nestlensConfig.path, this.applicationConfig.getGlobalPrefix())) {
|
|
52
52
|
this.sendException(exception, response);
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
@@ -131,6 +131,7 @@ exports.ExceptionWatcher = ExceptionWatcher = __decorate([
|
|
|
131
131
|
(0, common_1.Catch)(),
|
|
132
132
|
(0, common_1.Injectable)(),
|
|
133
133
|
__param(1, (0, common_1.Inject)(nestlens_config_1.NESTLENS_CONFIG)),
|
|
134
|
-
__metadata("design:paramtypes", [collector_service_1.CollectorService, Object, core_1.HttpAdapterHost
|
|
134
|
+
__metadata("design:paramtypes", [collector_service_1.CollectorService, Object, core_1.HttpAdapterHost,
|
|
135
|
+
core_1.ApplicationConfig])
|
|
135
136
|
], ExceptionWatcher);
|
|
136
137
|
//# sourceMappingURL=exception.watcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exception.watcher.js","sourceRoot":"","sources":["../../src/watchers/exception.watcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,
|
|
1
|
+
{"version":3,"file":"exception.watcher.js","sourceRoot":"","sources":["../../src/watchers/exception.watcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAOwB;AACxB,uCAAkE;AAClE,kDAAsD;AACtD,iEAA6D;AAC7D,wDAA6F;AAKtF,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAG3B,YACmB,SAA2B,EAE3B,cAA8B,EAC9B,eAAgC,EAChC,iBAAoC;QAJpC,cAAS,GAAT,SAAS,CAAkB;QAE3B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,oBAAe,GAAf,eAAe,CAAiB;QAChC,sBAAiB,GAAjB,iBAAiB,C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AW,CAAC;QACrB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AA1IY,4CAAgB;2BAAhB,gBAAgB;IAF5B,IAAA,cAAK,GAAE;IACP,IAAA,mBAAU,GAAE;IAMR,WAAA,IAAA,eAAM,EAAC,iCAAe,CAAC,CAAA;qCADI,oCAAgB,UAGV,sBAAe;QACb,wBAAiB;GAR5C,gBAAgB,CA0I5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
|
|
2
|
-
import { HttpAdapterHost } from '@nestjs/core';
|
|
2
|
+
import { ApplicationConfig, HttpAdapterHost } from '@nestjs/core';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
4
|
import { CollectorService } from '../core/collector.service';
|
|
5
5
|
import { NestLensConfig } from '../nestlens.config';
|
|
@@ -8,8 +8,9 @@ export declare class RequestWatcher implements NestInterceptor {
|
|
|
8
8
|
private readonly collector;
|
|
9
9
|
private readonly nestlensConfig;
|
|
10
10
|
private readonly httpAdapterHost;
|
|
11
|
+
private readonly applicationConfig;
|
|
11
12
|
private readonly config;
|
|
12
|
-
constructor(collector: CollectorService, nestlensConfig: NestLensConfig, httpAdapterHost: HttpAdapterHost);
|
|
13
|
+
constructor(collector: CollectorService, nestlensConfig: NestLensConfig, httpAdapterHost: HttpAdapterHost, applicationConfig: ApplicationConfig);
|
|
13
14
|
private getRequestPath;
|
|
14
15
|
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
|
|
15
16
|
private captureHeaders;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.watcher.d.ts","sourceRoot":"","sources":["../../src/watchers/request.watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAsB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"request.watcher.d.ts","sourceRoot":"","sources":["../../src/watchers/request.watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAsB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAyC,MAAM,oBAAoB,CAAC;AAG3F,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD,qBACa,cAAe,YAAW,eAAe;IAIlD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAPpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;gBAG3B,SAAS,EAAE,gBAAgB,EAE3B,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB;IAOvD,OAAO,CAAC,cAAc;IAUtB,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC;IA4J5E,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,WAAW;IAgBnB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,WAAW;IAoBnB,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,sBAAsB;YAyBhB,WAAW;IAazB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;CAmCzB"}
|
|
@@ -15,16 +15,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.RequestWatcher = exports.REQUEST_ID_HEADER = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const core_1 = require("@nestjs/core");
|
|
18
|
+
const route_path_1 = require("../api/route-path");
|
|
18
19
|
const operators_1 = require("rxjs/operators");
|
|
19
20
|
const uuid_1 = require("uuid");
|
|
20
21
|
const collector_service_1 = require("../core/collector.service");
|
|
21
22
|
const nestlens_config_1 = require("../nestlens.config");
|
|
22
23
|
exports.REQUEST_ID_HEADER = 'x-nestlens-request-id';
|
|
23
24
|
let RequestWatcher = class RequestWatcher {
|
|
24
|
-
constructor(collector, nestlensConfig, httpAdapterHost) {
|
|
25
|
+
constructor(collector, nestlensConfig, httpAdapterHost, applicationConfig) {
|
|
25
26
|
this.collector = collector;
|
|
26
27
|
this.nestlensConfig = nestlensConfig;
|
|
27
28
|
this.httpAdapterHost = httpAdapterHost;
|
|
29
|
+
this.applicationConfig = applicationConfig;
|
|
28
30
|
const watcherConfig = nestlensConfig.watchers?.request;
|
|
29
31
|
this.config =
|
|
30
32
|
typeof watcherConfig === 'object' ? watcherConfig : { enabled: watcherConfig !== false };
|
|
@@ -58,10 +60,10 @@ let RequestWatcher = class RequestWatcher {
|
|
|
58
60
|
if (!requestPath) {
|
|
59
61
|
return next.handle();
|
|
60
62
|
}
|
|
61
|
-
// Skip NestLens own
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
63
|
+
// Skip NestLens's own traffic — dashboard, API and event stream. The global
|
|
64
|
+
// prefix has to be taken into account, otherwise NestLens records its own
|
|
65
|
+
// dashboard polling and buries the entries the user actually came for.
|
|
66
|
+
if ((0, route_path_1.isNestLensRequest)(requestPath, this.nestlensConfig.path, this.applicationConfig.getGlobalPrefix())) {
|
|
65
67
|
return next.handle();
|
|
66
68
|
}
|
|
67
69
|
// Skip ignored paths
|
|
@@ -339,6 +341,7 @@ exports.RequestWatcher = RequestWatcher;
|
|
|
339
341
|
exports.RequestWatcher = RequestWatcher = __decorate([
|
|
340
342
|
(0, common_1.Injectable)(),
|
|
341
343
|
__param(1, (0, common_1.Inject)(nestlens_config_1.NESTLENS_CONFIG)),
|
|
342
|
-
__metadata("design:paramtypes", [collector_service_1.CollectorService, Object, core_1.HttpAdapterHost
|
|
344
|
+
__metadata("design:paramtypes", [collector_service_1.CollectorService, Object, core_1.HttpAdapterHost,
|
|
345
|
+
core_1.ApplicationConfig])
|
|
343
346
|
], RequestWatcher);
|
|
344
347
|
//# sourceMappingURL=request.watcher.js.map
|