@nuxt/devtools 0.7.0 → 0.7.1

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.
Files changed (90) hide show
  1. package/dist/chunks/module-main.mjs +1 -1
  2. package/dist/client/200.html +2 -2
  3. package/dist/client/404.html +2 -2
  4. package/dist/client/__blank/index.html +7 -0
  5. package/dist/client/_nuxt/{AuthRequiredPanel.vue.d0cfb6b2.js → AuthRequiredPanel.vue.17c2a7bd.js} +1 -1
  6. package/dist/client/_nuxt/{Badge.51add8bd.js → Badge.8d650e3b.js} +1 -1
  7. package/dist/client/_nuxt/{CodeDiff.vue.ef3840bb.js → CodeDiff.vue.cc3f76a7.js} +1 -1
  8. package/dist/client/_nuxt/{CodeSnippets.vue.ac1ba0c8.js → CodeSnippets.vue.b4698473.js} +1 -1
  9. package/dist/client/_nuxt/{ComposableItem.vue.a20c44a4.js → ComposableItem.vue.6d7b799a.js} +1 -1
  10. package/dist/client/_nuxt/{DrawerRight.vue.53f21930.js → DrawerRight.vue.3ab85e5b.js} +1 -1
  11. package/dist/client/_nuxt/{DurationDisplay.vue.8283fdb3.js → DurationDisplay.vue.aba5fa70.js} +1 -1
  12. package/dist/client/_nuxt/{FilepathItem.vue.6f4d3680.js → FilepathItem.vue.84aa0a31.js} +1 -1
  13. package/dist/client/_nuxt/{HelpFab.vue.58531843.js → HelpFab.vue.a8d95bd1.js} +1 -1
  14. package/dist/client/_nuxt/{LaunchPage.vue.36ead88c.js → LaunchPage.vue.00d3a484.js} +1 -1
  15. package/dist/client/_nuxt/{NCheckbox.vue.a57ff0bb.js → NCheckbox.vue.63949e52.js} +1 -1
  16. package/dist/client/_nuxt/{NCodeBlock.vue.2012eb81.js → NCodeBlock.vue.77e54b2e.js} +1 -1
  17. package/dist/client/_nuxt/{NIconTitle.vue.c1ac3b5f.js → NIconTitle.vue.0a904b99.js} +1 -1
  18. package/dist/client/_nuxt/{NLink.vue.c45070c9.js → NLink.vue.ec1f69e3.js} +1 -1
  19. package/dist/client/_nuxt/{NMarkdown.vue.6bccbb92.js → NMarkdown.vue.a74698d6.js} +1 -1
  20. package/dist/client/_nuxt/{NSectionBlock.7613319f.js → NSectionBlock.b074e0b8.js} +1 -1
  21. package/dist/client/_nuxt/{NSelect.vue.b9c29645.js → NSelect.vue.9556d6e0.js} +1 -1
  22. package/dist/client/_nuxt/{NSwitch.vue.fa9b060a.js → NSwitch.vue.6c2556d0.js} +1 -1
  23. package/dist/client/_nuxt/{NTip.vue.95e4ec9e.js → NTip.vue.861372f7.js} +1 -1
  24. package/dist/client/_nuxt/{Navbar.vue.6c01dcab.js → Navbar.vue.1a2a587f.js} +1 -1
  25. package/dist/client/_nuxt/{StateEditor.vue.c5cc22ae.js → StateEditor.vue.05c4fc16.js} +1 -1
  26. package/dist/client/_nuxt/{__blank.87af3281.js → __blank.3f7b27a6.js} +1 -1
  27. package/dist/client/_nuxt/{analyze-build.cf3dea6a.js → analyze-build.c314de67.js} +1 -1
  28. package/dist/client/_nuxt/{assets.4f097b22.js → assets.722939b7.js} +1 -1
  29. package/dist/client/_nuxt/{client.247a64bd.js → client.ece13385.js} +1 -1
  30. package/dist/client/_nuxt/{components.07744e27.js → components.27bdfae4.js} +1 -1
  31. package/dist/client/_nuxt/{constants.2fec5dff.js → constants.4e5eba24.js} +1 -1
  32. package/dist/client/_nuxt/{custom-_name_.6e463663.js → custom-_name_.95a8297c.js} +1 -1
  33. package/dist/client/_nuxt/default.7e3f9818.js +1 -0
  34. package/dist/client/_nuxt/entry.6507cb32.js +21 -0
  35. package/dist/client/_nuxt/entry.6f7d64f9.css +1 -0
  36. package/dist/client/_nuxt/{error-404.b216bd73.js → error-404.66ff8897.js} +1 -1
  37. package/dist/client/_nuxt/{error-500.1bc58b0e.js → error-500.34984f69.js} +1 -1
  38. package/dist/client/_nuxt/full.748a1c93.js +1 -0
  39. package/dist/client/_nuxt/{hooks.259d0a69.js → hooks.3ec974a8.js} +1 -1
  40. package/dist/client/_nuxt/{imports.cc27dbf7.js → imports.8485b75c.js} +1 -1
  41. package/dist/client/_nuxt/{index.064a7a87.js → index.5152a001.js} +1 -1
  42. package/dist/client/_nuxt/{index.8f3e434d.js → index.7ae8a638.js} +2 -2
  43. package/dist/client/_nuxt/{json-editor-vue.af845b1c.js → json-editor-vue.bbdad521.js} +1 -1
  44. package/dist/client/_nuxt/{middleware.fcdb1770.js → middleware.3c73e553.js} +1 -1
  45. package/dist/client/_nuxt/{modules.5891e891.js → modules.67fd6240.js} +1 -1
  46. package/dist/client/_nuxt/{none.e5b666cf.js → none.2f8cf810.js} +1 -1
  47. package/dist/client/_nuxt/{open-graph.1141dd15.js → open-graph.79a7c77c.js} +1 -1
  48. package/dist/client/_nuxt/{overview.2af20256.js → overview.d953fa7e.js} +1 -1
  49. package/dist/client/_nuxt/{pages.b3fe162f.js → pages.7b386c55.js} +1 -1
  50. package/dist/client/_nuxt/{payload.2d5cef36.js → payload.f36f4355.js} +1 -1
  51. package/dist/client/_nuxt/{plugins.f25d8e7c.js → plugins.1c37e55d.js} +1 -1
  52. package/dist/client/_nuxt/{runtime-configs.68765f10.js → runtime-configs.67f4f0b3.js} +1 -1
  53. package/dist/client/_nuxt/server-routes.64373863.js +9 -0
  54. package/dist/client/_nuxt/{settings.cb26edfb.js → settings.b7df1779.js} +1 -1
  55. package/dist/client/_nuxt/{state-components.3bf21c12.js → state-components.cd34df16.js} +1 -1
  56. package/dist/client/_nuxt/{state-modules.dfd5fe81.js → state-modules.c2527930.js} +1 -1
  57. package/dist/client/_nuxt/{storage.921a198c.js → storage.13c667f3.js} +1 -1
  58. package/dist/client/_nuxt/{terminals.67898f73.js → terminals.1c5a4ee9.js} +1 -1
  59. package/dist/client/_nuxt/timeline.1ad3a70f.css +1 -0
  60. package/dist/client/_nuxt/{timeline.6b8e8f78.js → timeline.741d9e72.js} +1 -1
  61. package/dist/client/_nuxt/{unocss-runtime.5034abfc.js → unocss-runtime.d07b0096.js} +1 -1
  62. package/dist/client/_nuxt/{virtual-files.e3271a06.js → virtual-files.4e8316be.js} +1 -1
  63. package/dist/client/index.html +2 -2
  64. package/dist/client/modules/analyze-build/index.html +7 -0
  65. package/dist/client/modules/assets/index.html +7 -0
  66. package/dist/client/modules/components/index.html +7 -0
  67. package/dist/client/modules/hooks/index.html +7 -0
  68. package/dist/client/modules/imports/index.html +7 -0
  69. package/dist/client/modules/middleware/index.html +7 -0
  70. package/dist/client/modules/modules/index.html +7 -0
  71. package/dist/client/modules/open-graph/index.html +7 -0
  72. package/dist/client/modules/overview/index.html +7 -0
  73. package/dist/client/modules/pages/index.html +7 -0
  74. package/dist/client/modules/payload/index.html +7 -0
  75. package/dist/client/modules/plugins/index.html +7 -0
  76. package/dist/client/modules/runtime-configs/index.html +7 -0
  77. package/dist/client/modules/server-routes/index.html +7 -0
  78. package/dist/client/modules/storage/index.html +7 -0
  79. package/dist/client/modules/terminals/index.html +7 -0
  80. package/dist/client/modules/timeline/index.html +7 -0
  81. package/dist/client/modules/virtual-files/index.html +7 -0
  82. package/dist/client/settings/index.html +7 -0
  83. package/dist/module.json +1 -1
  84. package/package.json +20 -20
  85. package/dist/client/_nuxt/default.3a13b5c9.js +0 -1
  86. package/dist/client/_nuxt/entry.185d6835.css +0 -1
  87. package/dist/client/_nuxt/entry.33b5be03.js +0 -21
  88. package/dist/client/_nuxt/full.92d6a5f8.js +0 -1
  89. package/dist/client/_nuxt/server-routes.ab41fbf6.js +0 -9
  90. package/dist/client/_nuxt/timeline.289e5c9e.css +0 -1
@@ -1 +0,0 @@
1
- import{_ as o,o as t,c as s,Y as c}from"./entry.33b5be03.js";const r={},n={"h-full":"","of-auto":""};function a(e,l){return t(),s("div",n,[c(e.$slots,"default")])}const _=o(r,[["render",a]]);export{_ as default};
@@ -1,9 +0,0 @@
1
- import{g as te,r as B,b3 as pe,o as t,c,a as r,q as S,h as _,s as e,b4 as ee,t as w,v as U,d as q,W as je,Y as K,F as x,n as P,T as le,X as Ne,m as $,ab as De,b as m,w as h,M as ce,k as fe,A as ve,b5 as Oe,b6 as Ee,b7 as qe,a1 as Be,aj as ie,Z as Le,am as Pe,L as Q,aE as Me,S as me,i as he,b8 as Ae,b9 as Fe,a5 as We,J as ze,ba as Ge,ad as He}from"./entry.33b5be03.js";import{_ as Je}from"./Navbar.vue.6c01dcab.js";import{_ as _e}from"./Badge.51add8bd.js";import{_ as ye}from"./NSelect.vue.b9c29645.js";import{_ as Ke}from"./NCheckbox.vue.a57ff0bb.js";import{_ as Qe}from"./CodeSnippets.vue.ac1ba0c8.js";import{_ as Xe}from"./NCodeBlock.vue.2012eb81.js";import{C as de,S as ge}from"./constants.2fec5dff.js";import{U as Ye}from"./json-editor-vue.af845b1c.js";import{_ as Ze}from"./NSectionBlock.7613319f.js";import{_ as et}from"./DrawerRight.vue.53f21930.js";import"./client.247a64bd.js";import"./NIconTitle.vue.c1ac3b5f.js";const tt=r("div",{"x-divider":""},null,-1),be=te({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(M){const R=B(!0),T=pe();return(d,j)=>{const N=le,a=_e,V=be;return t(),c("div",null,[r("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:S([{"bg-active":e(T)===d.item.filepath}]),style:je({paddingLeft:`calc(0.5rem + ${d.index*1.5}em)`}),onClick:j[0]||(j[0]=s=>{R.value=!e(R),T.value=d.item.filepath})},[r("div",{class:S({"w-12":!d.item.routes}),"flex-none":"","text-left":""},[d.item.type==="collection"?(t(),_(N,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":e(R)?90:0,transition:""},null,8,["transform-rotate"])):(t(),_(a,{key:1,class:S(("getRequestMethodClass"in d?d.getRequestMethodClass:e(ee))(d.item.method||"*")),textContent:w((d.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),r("span",{class:S({"flex items-center":d.item.routes}),"text-sm":"","font-mono":""},[d.item.type==="collection"?(t(),_(N,{key:0,title:`${d.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):U("",!0),q(" "+w(d.item.route),1)],2)],6),tt,e(R)?K(d.$slots,"default",{key:0},()=>[(t(!0),c(x,null,P(d.item.routes,s=>(t(),_(V,{key:s.filepath,item:s,index:d.index+1},null,8,["item","index"]))),128))]):U("",!0)])}}}),ot={p4:"",flex:"~ col gap-4"},nt={key:1,ml2:"",flex:""},st=["value"],lt={key:0,flex:"","gap-4":""},at=r("div",{"flex-auto":""},null,-1),ke=te({__name:"ServerRouteInputs",props:{modelValue:{},keys:{default:()=>[]},default:{default:()=>({})},disabled:{type:Boolean,default:!1}},setup(M,{emit:R}){const T=M,d=Ne(T,"modelValue",R,{passive:!0}),j=$(()=>[...T.keys,"key","value","type"]),N=$(()=>{const s={};for(const n of j.value)s[n]=T.default[n]||"";return s}),a=["string","number","boolean","file","date","time","datetime-local"];function V(s,n){const C=n.target;if(C.files&&C.files[0]){const G=C.files[0],L=new FileReader;L.readAsDataURL(G),L.onload=()=>{d.value[s].value=L.result}}}return De(()=>d,s=>{s.value.forEach(n=>{if(n.type==="number"&&typeof n.value!="number"){const C=Number.parseFloat(n.value);n.value=Number.isNaN(C)?0:C}else n.type==="boolean"&&typeof n.value!="boolean"?n.value=!0:n.type==="file"&&typeof n.value!="object"?n.value="":n.type==="date"&&typeof n.value=="string"&&!n.value.match(/^\d{4}-\d{2}-\d{2}$/)?(n.value=new Date().toISOString().slice(0,10),console.log("date",n.value)):n.type==="time"&&typeof n.value=="string"&&!n.value.match(/^\d{2}:\d{2}$/)?n.value=new Date().toISOString().slice(11,16):n.type==="datetime-local"&&typeof n.value=="string"&&!n.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)?n.value=new Date().toISOString().slice(0,16):n.type==="string"&&(n.value=n.value.toString())})},{deep:!0,immediate:!0,flush:"sync"}),(s,n)=>{const C=ce,G=Ke,L=ye,W=le,p=fe;return t(),c("div",ot,[(t(!0),c(x,null,P(e(d),(l,v)=>(t(),c("div",{key:v,flex:"~ gap-2","justify-around":""},[K(s.$slots,"input",{item:l}),(t(!0),c(x,null,P(e(j),y=>(t(),c(x,{key:y},[l.type!==null&&y==="key"?(t(),_(C,{key:0,modelValue:l[y],"onUpdate:modelValue":f=>l[y]=f,placeholder:y,"flex-1":"","font-mono":"",n:"sm primary",disabled:s.disabled,class:S(s.disabled?"op50":"")},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])):y==="value"?(t(),c(x,{key:1},[l.type==="file"?(t(),_(C,{key:0,type:"file",disabled:s.disabled,class:S(s.disabled?"op75":""),onChange:f=>V(v,f)},null,8,["disabled","class","onChange"])):l.type==="boolean"?(t(),c("div",nt,[m(G,{modelValue:l.value,"onUpdate:modelValue":f=>l.value=f,placeholder:"Value",n:"green lg",disabled:s.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(t(),_(C,{key:2,modelValue:l.value,"onUpdate:modelValue":f=>l.value=f,type:l.type,placeholder:"Value","flex-1":"","font-mono":"",n:"sm primary",disabled:s.disabled,class:S(s.disabled?"op75":"")},null,8,["modelValue","onUpdate:modelValue","type","disabled","class"]))],64)):y==="type"?(t(),_(L,{key:2,modelValue:l.type,"onUpdate:modelValue":f=>l.type=f,n:"sm green",class:S(s.disabled?"op75":""),disabled:s.disabled},{default:h(()=>[(t(),c(x,null,P(a,f=>r("option",{key:f,value:f},w(f),9,st)),64))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"])):U("",!0)],64))),128)),K(s.$slots,"input-actions",{},()=>[m(p,{n:"red",disabled:s.disabled,class:S(s.disabled?"op0!":""),onClick:y=>e(d).splice(v,1)},{default:h(()=>[m(W,{icon:"carbon:delete"})]),_:2},1032,["disabled","class","onClick"])])]))),128)),s.disabled?U("",!0):(t(),c("div",lt,[K(s.$slots,"actions",{params:e(d)},()=>[m(p,{icon:"carbon-add",n:"sm primary",my1:"","px-3":"",onClick:n[0]||(n[0]=l=>e(d).push({...e(N)}))},{default:h(()=>[q(" Add ")]),_:1}),at,e(d).length?(t(),_(p,{key:0,icon:"carbon-trash-can",n:"sm red",my1:"","px-3":"",onClick:n[1]||(n[1]=l=>d.value=[])},{default:h(()=>[q(" Remove All ")]),_:1})):U("",!0)])])),K(s.$slots,"default")])}}}),$e=B(await ve.getOptions("serverRoutes")),rt=Oe($e),ut={serverRoutes:rt};function Ce(M){return ut[M]}Ee($e,async M=>{ve.updateOptions("serverRoutes",M)},{deep:!0,flush:"post",debounce:500,maxWait:1e3});const it={"h-full":"","w-full":"",flex:"~ col"},dt={flex:"~ col gap-2","flex-none":"",p4:"","navbar-glass":""},pt={flex:"~ gap2"},ct={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},ft=r("div",{"flex-auto":""},null,-1),vt={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},mt={"text-right":"","font-mono":""},ht={flex:"~ gap2","mb--2":"","items-center":"",op50:""},_t=r("div",{"w-5":"","x-divider":""},null,-1),yt=r("div",{"flex-none":""}," Default Inputs ",-1),gt=r("div",{"x-divider":""},null,-1),bt={key:1},kt={key:2,border:"b base",relative:"","n-code-block":""},$t={flex:"~ wrap","w-full":""},Ct=["onClick"],xt=r("div",{border:"b base","flex-auto":""},null,-1),Rt={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},St=r("div",null,"Response",-1),Tt={key:1,"text-xs":"",op50:""},Vt=r("div",{"flex-auto":""},null,-1),wt=r("div",{op50:""}," Request finished in ",-1),Ut={key:0,"flex-auto":"","overflow-auto":""},It={border:"~ base","h-full":"","w-full":"",rounded:""},jt=["data"],Nt={key:2,"flex-auto":"","overflow-auto":"",p4:""},Dt={border:"~ base",rounded:""},Ot=["src"],Et={key:1,controls:"",rounded:""},qt=["src"],Bt=te({__name:"ServerRouteDetails",props:{route:{}},emits:["open-default-input"],setup(M,{emit:R}){const T=M,[d,j]=qe(),N=Be(),a=ie({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),V=$(()=>a.contentType.includes("application/json")?"json":a.contentType.includes("text/html")?"html":a.contentType.includes("text/css")?"css":a.contentType.includes("text/javascript")?"javascript":a.contentType.includes("image")||a.contentType.includes("video")?"media":a.contentType.includes("text/xml")||a.contentType.includes("application/xml")?"xml":a.contentType.includes("application/pdf")?"pdf":"text"),s=$(()=>{if(V.value==="json")return JSON.stringify(a.data,null,2);if(V.value==="media"||V.value==="pdf"){const o=new Blob([a.data],{type:a.contentType});return URL.createObjectURL(o)}return a.data}),n=B(!1),C=B(!1),G=Le(),L=$(()=>T.route.route?.split(/((?:\*\*)?:[\w_]+)/g)),W=$(()=>L.value?.filter(o=>o.startsWith(":")||o.startsWith("**:"))||[]),p=B(T.route.method||"GET"),l=B({}),v=ie({query:[{key:"",value:"",type:"string"}],body:[{key:"",value:"",type:"string"}],headers:[{key:"Content-Type",value:"application/json",type:"string"}]}),y=B({}),{inputDefaults:f}=Ce("serverRoutes"),D=["GET","POST","PUT","PATCH","DELETE","HEAD"],O=["PATCH","POST","PUT","DELETE"],E=$(()=>O.includes(p.value.toUpperCase())),b=B(W.value.length?"params":"query"),X=["input","json"],A=B(X[0]),J=$({get:()=>v[b.value],set:o=>{v[b.value]=o}}),k=$(()=>({...H(f.value.query),...H(v.query)})),Y=$(()=>({...H(f.value.headers),...H(v.headers)})),oe=$(()=>E.value?A.value==="json"?{...H(f.value.body),...y.value}:{...H(f.value.body),...H(v.body)}:void 0),xe=$(()=>{let o=N.value?.devServer.url||"http://localhost";o.charAt(o.length-1)==="/"&&(o=o.slice(0,-1));const i=N.value?.devServer.port||3e3;return o.includes(`:${i}`)?o:`${o}:${i}`}),Z=$(()=>{let o=new URLSearchParams(k.value).toString();o&&(o=`?${o}`);const i=(L.value?.map(I=>(I.startsWith(":")||I.startsWith("**:"))&&l.value[I]||I).join("")||"")+o;let g=N.value?.app.baseURL||"";return(g==="./"||g===".")&&(g=""),g.endsWith("/")&&(g=g.slice(0,-1)),g+i}),Re=$(()=>xe.value+Z.value);function H(o){const i=Object.fromEntries(o.filter(({key:g,value:I})=>g&&I!==void 0).map(({key:g,value:I})=>[g,I]));return Object.entries(i).length?i:void 0}async function ae(){C.value=!0,n.value=!0;const o=Date.now();try{a.data=await $fetch(Re.value,{method:p.value.toUpperCase(),headers:Y.value,query:k.value,body:oe.value,onResponse({response:i}){a.contentType=(i.headers.get("content-type")||"").toString().toLowerCase().trim(),a.statusCode=i.status},onResponseError(i){a.error=i.response._data,a.data=i.response._data}})}catch{}n.value=!1,a.fetchTime=Date.now()-o}const re=$(()=>{const o=[],i=[],g=Object.entries(Y.value).filter(([F,z])=>F&&z&&!(F==="Content-Type"&&z==="application/json")).map(([F,z])=>` '${F}': '${z}'`).join(`,
2
- `);p.value.toUpperCase()!=="GET"&&i.push(`method: '${p.value.toUpperCase()}'`),g&&i.push(`headers: {
3
- ${g}
4
- }`),oe.value&&i.push(`body: ${JSON.stringify(oe.value,null,2)}`);const I=i.length?`, {
5
- ${i.join(`,
6
- `).split(`
7
- `).map(F=>` ${F}`).join(`
8
- `)}
9
- }`:"";return o.push({name:"useFetch",lang:"javascript",docs:de.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${Z.value}'${I})`}),o.push({name:"$fetch",lang:"javascript",docs:de.nuxt.$fetch,code:`await $fetch('${Z.value}'${I})`}),o}),Se=$(()=>{const o=[];return W.value.length&&o.push({name:"Params",slug:"params",length:W.value.length}),o.push({name:"Query",slug:"query",length:v.query.length}),E.value&&o.push({name:"Body",slug:"body",length:v.body.length}),o.push({name:"Headers",slug:"headers",length:v.headers.length}),o.push({name:"Snippets",slug:"snippet"}),o});return Pe(()=>{A.value==="json"&&typeof y.value=="string"&&(y.value=JSON.parse(y.value))}),(o,i)=>{const g=fe,I=ye,F=ce,z=le,Te=me,ue=ke,Ve=Qe,we=he,Ue=Ae,ne=_e,Ie=Xe;return t(),c("div",it,[r("div",dt,[r("div",pt,[o.route.method?(t(),_(g,{key:0,class:S(("getRequestMethodClass"in o?o.getRequestMethodClass:e(ee))(e(p))),"pointer-events-none":"",tabindex:"-1"},{default:h(()=>[q(w(e(p).toUpperCase()),1)]),_:1},8,["class"])):(t(),_(I,{key:1,modelValue:e(p),"onUpdate:modelValue":i[0]||(i[0]=u=>Q(p)?p.value=u:null),class:S(("getRequestMethodClass"in o?o.getRequestMethodClass:e(ee))(e(p)))},{default:h(()=>[(t(),c(x,null,P(D,u=>r("option",{key:u,class:S(("getRequestMethodClass"in o?o.getRequestMethodClass:e(ee))(u))},w(u.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),m(F,{"model-value":e(Z),disabled:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"primary xs"},null,8,["model-value"]),m(g,{n:"primary solid",onClick:ae},{default:h(()=>[m(z,{icon:"carbon:send"})]),_:1})])]),r("div",ct,[(t(!0),c(x,null,P(e(Se),u=>(t(),_(g,{key:u.slug,class:S(e(b)===u.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:se=>b.value=u.slug},{default:h(()=>[m(z,{icon:("ServerRouteTabIcons"in o?o.ServerRouteTabIcons:e(ge))[u.slug]},null,8,["icon"]),q(" "+w(u.name)+" "+w(u?.length?`(${u.length})`:"")+" ",1),r("span",null,w(e(f)[u.slug]?.length?`(${e(f)[u.slug].length})`:""),1)]),_:2},1032,["class","onClick"]))),128)),ft,m(g,{icon:"carbon-launch",onClick:i[1]||(i[1]=u=>e(G)(o.route.filepath))},{default:h(()=>[q(" Open in Editor ")]),_:1})]),e(b)==="params"?(t(),c("div",vt,[(t(!0),c(x,null,P(e(W),u=>(t(),c(x,{key:u},[r("div",mt,w(u),1),m(F,{modelValue:e(l)[u],"onUpdate:modelValue":se=>e(l)[u]=se,placeholder:u,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):U("",!0),m(e(d),null,{default:h(()=>[m(ue,{modelValue:e(J),"onUpdate:modelValue":i[4]||(i[4]=u=>Q(J)?J.value=u:null),default:{type:"string"},"max-h-xs":"","of-auto":""},{default:h(()=>[e(f)[e(b)]?.length?(t(),c(x,{key:0},[r("div",ht,[_t,yt,m(Te,{icon:"i-carbon-edit",onClick:i[2]||(i[2]=u=>R("open-default-input"))}),gt]),m(ue,{modelValue:e(f)[e(b)],"onUpdate:modelValue":i[3]||(i[3]=u=>e(f)[e(b)]=u),disabled:"",p0:""},null,8,["modelValue"])],64)):U("",!0)]),_:1},8,["modelValue"])]),_:1}),e(b)==="snippet"?(t(),c("div",bt,[e(re).length?(t(),_(Ve,{key:0,"code-snippets":e(re)},null,8,["code-snippets"])):U("",!0)])):e(J)?(t(),c("div",kt,[e(b)==="body"?(t(),c(x,{key:0},[r("div",$t,[(t(),c(x,null,P(X,u=>r("button",{key:u,px4:"",py2:"",border:"r base",hover:"bg-active",class:S({"border-b":u!==e(A)}),onClick:se=>A.value=u},[r("div",{class:S({op30:u!==e(A)}),"font-mono":""},w(u),3)],10,Ct)),64)),xt]),e(A)==="input"?(t(),_(e(j),{key:0})):e(A)==="json"?(t(),_(e(Ye),Me({key:1,modelValue:e(y),"onUpdate:modelValue":i[5]||(i[5]=u=>Q(y)?y.value=u:null),class:[[o.$colorMode.value==="dark"?"jse-theme-dark":"light"],"json-editor-vue of-auto text-sm outline-none"]},o.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):U("",!0)],64)):(t(),_(e(j),{key:1}))])):U("",!0),e(C)?e(n)?(t(),_(Ue,{key:4,"z-10":"","flex-auto":"","backdrop-blur":""},{default:h(()=>[q(" Fetching... ")]),_:1})):(t(),c(x,{key:5},[r("div",Rt,[St,e(a).error?(t(),_(ne,{key:0,"bg-red-400:10":"","text-red-400":""},{default:h(()=>[q(" Error ")]),_:1})):U("",!0),m(ne,{class:S({"bg-orange-400:10 text-orange-400":e(a).error,"bg-green-400:10 text-green-400":!e(a).error})},{default:h(()=>[q(w(e(a).statusCode),1)]),_:1},8,["class"]),e(a).contentType?(t(),c("code",Tt,w(e(a).contentType),1)):U("",!0),Vt,wt,m(ne,{"bg-green-400:10":"","text-green-400":""},{default:h(()=>[q(w(e(a).fetchTime)+" ms ",1)]),_:1})]),e(V)==="pdf"?(t(),c("div",Ut,[r("div",It,[r("object",{data:e(s),type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,jt)])])):e(V)!=="media"?(t(),_(Ie,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:e(s),lang:e(V)},null,8,["code","lang"])):(t(),c("div",Nt,[r("div",Dt,[e(a).contentType.includes("image")?(t(),c("img",{key:0,rounded:"",src:e(s)},null,8,Ot)):(t(),c("video",Et,[r("source",{src:e(s),type:"video/mp4"},null,8,qt)]))])]))],64)):(t(),_(we,{key:3},{default:h(()=>[m(g,{n:"primary",onClick:ae},{default:h(()=>[m(z,{icon:"carbon:send"}),q(" Send request ")]),_:1})]),_:1}))])}}}),Lt={flex:"~ gap1","text-sm":""},Pt={key:0,op50:""},Mt={op50:""},At=r("span",{op75:""},"Select a route to start",-1),Ft=r("div",{p4:"",border:"b base"},[r("span",{"text-lg":""},"Default Inputs"),r("br"),r("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1),no=te({__name:"server-routes",setup(M){const R=B(!1),T=Fe(),d=pe(),{selectedRoute:j,view:N,inputDefaults:a}=Ce("serverRoutes"),V=$(()=>{!d.value&&j.value&&(d.value=j.value.filepath);const p=T.value?.find(l=>l.filepath===d.value);return d.value!==j.value?.filepath&&p&&(j.value=p),p}),s=B(""),n=$(()=>new We(T.value||[],{keys:["method","route"],shouldSort:!0})),C=$(()=>T.value?s.value?n.value.search(s.value).map(l=>l.item):T.value:[]),G=$(()=>{const p=[],l=(v,y)=>{v.routes=v.routes||[],v.routes.push(y)};return C.value.forEach(v=>{const y=v.filepath.split("/"),f=y.slice(y.indexOf("server")+1);f.length>0&&f[f.length-1].includes(".")&&f.pop();let D=null;if(f.forEach(O=>{const E=D?D.routes?.find(b=>b.route===O):p.find(b=>b.route===O);if(E)D=E;else{const b={route:O,filepath:O.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};D?l(D,b):p.push(b),D=b}}),v.type==="runtime"){const O=p.find(E=>E.route==="runtime");if(O)l(O,v);else{const E={route:"runtime",filepath:"runtime",type:"collection",routes:[v]};p.push(E)}}else D?l(D,v):p.push(v)}),p});function L(){N.value=N.value==="tree"?"list":"tree"}function W(p){return p.charAt(0).toUpperCase()+p.slice(1)}return(p,l)=>{const v=me,y=Je,f=be,D=Bt,O=He,E=he,b=ze,X=ke,A=Ze,J=et;return t(),c(x,null,[m(b,{"storage-key":"tab-server-routes"},{left:h(()=>[m(y,{search:e(s),"onUpdate:search":l[1]||(l[1]=k=>Q(s)?s.value=k:null),pb2:""},{actions:h(()=>[m(v,{"text-lg":"",icon:e(N)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",onClick:L},null,8,["icon"]),m(v,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",onClick:l[0]||(l[0]=k=>R.value=!e(R))})]),default:h(()=>[r("div",Lt,[e(s)?(t(),c("span",Pt,w(e(C).length)+" matched · ",1)):U("",!0),r("span",Mt,w(e(T)?.length)+" routes in total",1)])]),_:1},8,["search"]),(t(!0),c(x,null,P(e(N)==="tree"?e(G):e(C),k=>(t(),_(f,{key:k.filepath,item:k},null,8,["item"]))),128))]),right:h(()=>[(t(),_(Ge,{max:10},[e(V)?(t(),_(D,{key:e(V).filepath,route:e(V),onOpenDefaultInput:l[2]||(l[2]=k=>R.value=!0)},null,8,["route"])):U("",!0)],1024)),e(V)?U("",!0):(t(),_(E,{key:0},{default:h(()=>[m(O,{px6:"",py2:""},{default:h(()=>[At]),_:1})]),_:1}))]),_:1}),m(J,{modelValue:e(R),"onUpdate:modelValue":l[3]||(l[3]=k=>Q(R)?R.value=k:null),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:l[4]||(l[4]=k=>R.value=!1)},{default:h(()=>[r("div",null,[Ft,(t(!0),c(x,null,P(Object.keys(e(a)),k=>(t(),_(A,{key:k,text:`${W(k)} ${e(a)[k].length?`(${e(a)[k].length})`:""}`,padding:!1,icon:("ServerRouteTabIcons"in p?p.ServerRouteTabIcons:e(ge))[k]},{default:h(()=>[m(X,{modelValue:e(a)[k],"onUpdate:modelValue":Y=>e(a)[k]=Y,py0:"",default:{type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{no as default};
@@ -1 +0,0 @@
1
- .timeline-scroller[data-v-33b6d70a]::-webkit-scrollbar{height:100px;width:.1px}.timeline-scroller[data-v-33b6d70a]::-webkit-scrollbar-track{background-color:transparent}.timeline-scroller[data-v-33b6d70a]::-webkit-scrollbar-thumb{background-color:#8881;height:100px}.timeline-scroller[data-v-33b6d70a]:hover::-webkit-scrollbar-thumb{background-color:#8882}