apteva 0.4.44 → 0.4.48
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/{ActivityPage.c48n83h2.js → ActivityPage.sw9p594m.js} +1 -1
- package/dist/{ApiDocsPage.yzcxx5ax.js → ApiDocsPage.90e03bz7.js} +1 -1
- package/dist/App.0ws87fpx.js +53 -0
- package/dist/App.3vnrera5.js +4 -0
- package/dist/App.94x6mh7f.js +20 -0
- package/dist/{App.qzbx5wtj.js → App.9sryp183.js} +1 -1
- package/dist/App.d9tny4t0.js +221 -0
- package/dist/{App.r5serxkt.js → App.jhb45d7r.js} +1 -1
- package/dist/App.p7jjw1zf.js +4 -0
- package/dist/App.pfbdzrhh.js +4 -0
- package/dist/App.stgng5bx.js +13 -0
- package/dist/{App.152mbs1r.js → App.tm3k7h4b.js} +1 -1
- package/dist/App.vkg121c6.js +4 -0
- package/dist/App.wghtdzsk.js +1 -0
- package/dist/App.xf7wsckg.js +4 -0
- package/dist/App.xva0tfzh.js +4 -0
- package/dist/App.ysxy7akk.js +61 -0
- package/dist/App.yzkh4gq2.js +4 -0
- package/dist/ConnectionsPage.q5f9fd37.js +3 -0
- package/dist/McpPage.f3ccrezb.js +3 -0
- package/dist/SettingsPage.3sqx6wm4.js +3 -0
- package/dist/SkillsPage.whxnez67.js +3 -0
- package/dist/TasksPage.zp4jfevw.js +3 -0
- package/dist/TelemetryPage.a9fmxq87.js +3 -0
- package/dist/TestsPage.18krj0d1.js +3 -0
- package/dist/ThreadsPage.nnphgy98.js +3 -0
- package/dist/apteva-kit.css +1 -1
- package/dist/index.html +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -4
- package/src/db.ts +42 -4
- package/src/providers.ts +14 -9
- package/src/routes/api/agent-utils.ts +25 -3
- package/src/routes/api/telemetry.ts +20 -2
- package/src/server.ts +52 -1
- package/src/web/App.tsx +1 -1
- package/src/web/components/agents/AgentCard.tsx +9 -7
- package/src/web/components/agents/AgentPanel.tsx +205 -44
- package/src/web/components/agents/CreateAgentModal.tsx +5 -5
- package/src/web/components/auth/LoginPage.tsx +2 -2
- package/src/web/components/common/LoadingSpinner.tsx +1 -1
- package/src/web/components/common/Modal.tsx +6 -6
- package/src/web/components/common/Select.tsx +2 -2
- package/src/web/components/connections/ConnectionsPage.tsx +1 -1
- package/src/web/components/connections/IntegrationsTab.tsx +3 -3
- package/src/web/components/connections/OverviewTab.tsx +3 -3
- package/src/web/components/connections/TriggersTab.tsx +8 -8
- package/src/web/components/dashboard/Dashboard.tsx +2 -2
- package/src/web/components/layout/Header.tsx +3 -3
- package/src/web/components/layout/Sidebar.tsx +3 -2
- package/src/web/components/mcp/McpPage.tsx +13 -13
- package/src/web/components/onboarding/OnboardingWizard.tsx +2 -2
- package/src/web/components/settings/SettingsPage.tsx +55 -22
- package/src/web/components/skills/SkillsPage.tsx +7 -7
- package/src/web/components/tasks/TasksPage.tsx +212 -36
- package/src/web/components/telemetry/TelemetryPage.tsx +278 -9
- package/src/web/components/tests/TestsPage.tsx +2 -2
- package/src/web/components/threads/ThreadsPage.tsx +2 -2
- package/src/web/context/ThemeContext.tsx +31 -10
- package/src/web/index.html +1 -6
- package/src/web/styles.css +47 -0
- package/src/web/themes.ts +68 -5
- package/dist/App.09yb8t0b.js +0 -1
- package/dist/App.3a67nx9w.js +0 -4
- package/dist/App.9epx6785.js +0 -4
- package/dist/App.d8955awp.js +0 -4
- package/dist/App.drwb57jq.js +0 -4
- package/dist/App.gssbmajb.js +0 -4
- package/dist/App.qw70pc29.js +0 -53
- package/dist/App.tpmp9020.js +0 -20
- package/dist/App.v2wb4d7d.js +0 -61
- package/dist/App.vxmaaj0m.js +0 -13
- package/dist/App.w4p2tda9.js +0 -4
- package/dist/App.wv2ng55q.js +0 -221
- package/dist/App.yncnrn0f.js +0 -4
- package/dist/ConnectionsPage.k6cspyqq.js +0 -3
- package/dist/McpPage.cdxm48xj.js +0 -3
- package/dist/SettingsPage.evpv7c2y.js +0 -3
- package/dist/SkillsPage.pvzp6c1a.js +0 -3
- package/dist/TasksPage.6jnvbpsy.js +0 -3
- package/dist/TelemetryPage.t7vk24zc.js +0 -3
- package/dist/TestsPage.5x6658aa.js +0 -3
- package/dist/ThreadsPage.3fvhtevh.js +0 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{U as A}from"./App.
|
|
1
|
+
import{U as A}from"./App.p7jjw1zf.js";import{$ as V,X as C,aa as L,ca as P,ja as S,ma as b}from"./App.94x6mh7f.js";var W=C(V(),1);var q=C(L(),1),x=new Set(["thread_activity","agent_started","agent_stopped","agent_error","task_created","task_updated","task_deleted","task_executed","llm_request","tool_invocation","mcp_request","mcp_tool_execution"]),j={CHAT:"bg-green-400",LLM:"bg-purple-400",TOOL:"bg-blue-400",TASK:"bg-yellow-400",MEMORY:"bg-cyan-400",MCP:"bg-orange-400",SYSTEM:"bg-gray-400",ERROR:"bg-red-400"};function m($,G){let U=$.data||{};switch($.type){case"thread_activity":return U.activity||"Working...";case"agent_started":return"Agent started";case"agent_stopped":return U.reason?`Agent stopped (${U.reason})`:"Agent stopped";case"agent_error":return $.error||"Agent error";case"llm_request":return"Thinking...";case"tool_invocation":{let Q=U.tool_name||"";if(!Q)return"Using tools";return`Tool: ${Q.replace(/[-_]/g," ").replace(/\b\w/g,(Z)=>Z.toUpperCase())}`}case"task_created":return U.title?`Task created: ${U.title}`:"Task created";case"task_updated":{let{status:Q,title:X}=U,Z=Q?Q.charAt(0).toUpperCase()+Q.slice(1):null;if(X&&Z)return`Task ${Z}: ${X}`;if(Z)return`Task ${Z}`;if(X)return`Task updated: ${X}`;return"Task updated"}case"task_deleted":return"Task deleted";case"task_executed":{let Q=U.title;return Q?`Task started: ${Q}`:"Task started"}case"memory_stored":return"Memory stored";case"memory_retrieved":return"Memory retrieved";case"mcp_request":return U.server?`MCP request to ${U.server}`:"MCP request";case"mcp_tool_execution":{let Q=U.tool_name||U.tool||"";if(!Q)return"MCP tool call";return`MCP: ${(Q.includes("__")?Q.split("__").slice(1).join("__"):Q).replace(/[-_]/g," ").replace(/\b\w/g,(H)=>H.toUpperCase())}`}default:return $.type.replace(/_/g," ")}}function l({agents:$,loading:G,onNavigate:U}){let{authFetch:Q}=S(),{currentProjectId:X}=b(),{events:Z,statusChangeCounter:H}=P(),[_,p]=W.useState([]),[R,I]=W.useState(""),[O]=W.useState(()=>new Set),y=W.useRef(!1),Y=W.useMemo(()=>{if(X===null)return $;if(X==="unassigned")return $.filter((z)=>!z.projectId);return $.filter((z)=>z.projectId===X)},[$,X]),N=W.useMemo(()=>new Set(Y.map((z)=>z.id)),[Y]),h=W.useMemo(()=>{let z=new Map;return Y.forEach((J)=>z.set(J.id,J.name)),z},[Y]),w=W.useCallback(async()=>{let z=X?`&project_id=${encodeURIComponent(X)}`:"";try{let J=await Q(`/api/telemetry/events?limit=200${z}`);if(J.ok){let B=await J.json();p(B.events||[])}}catch{}},[Q,X]);W.useEffect(()=>{w()},[w,H]),W.useEffect(()=>{if(_.length>0&&!y.current){for(let z of _)O.add(z.id);for(let z of Z)O.add(z.id);y.current=!0}},[_,Z,O]);let M=W.useMemo(()=>{let z=new Set,J=[],B=(K)=>{if(!x.has(K.type)||!N.has(K.agent_id)||K.data?.parent_id)return!1;if(K.type==="mcp_tool_execution"&&!K.duration_ms)return!1;return!0};for(let K of Z)if(!z.has(K.id)&&B(K))J.push(K),z.add(K.id);for(let K of _)if(!z.has(K.id)&&B(K))J.push(K),z.add(K.id);let k=J;if(R)k=k.filter((K)=>K.agent_id===R);return k.sort((K,F)=>new Date(F.timestamp).getTime()-new Date(K.timestamp).getTime()),k.slice(0,200)},[Z,_,N,R]),f=W.useMemo(()=>{let z=[],J="",B=new Date().toDateString(),k=new Date(Date.now()-86400000).toDateString();for(let K of M){let F=new Date(K.timestamp).toDateString(),T=F===B?"Today":F===k?"Yesterday":F;if(T!==J)J=T,z.push({label:T,events:[]});z[z.length-1].events.push(K)}return z},[M]);if(G)return q.jsxDEV("div",{className:"flex-1 flex items-center justify-center text-[var(--color-text-muted)]",children:"Loading..."},void 0,!1,void 0,this);let D=Y.filter((z)=>z.status==="running").length;return q.jsxDEV("div",{className:"flex-1 flex flex-col overflow-hidden",children:[q.jsxDEV("div",{className:"px-6 pt-6 pb-4 shrink-0",children:q.jsxDEV("div",{className:"flex items-center justify-between gap-4",children:[q.jsxDEV("div",{children:[q.jsxDEV("h1",{className:"text-xl font-semibold",children:"Activity"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm text-[var(--color-text-muted)] mt-0.5",children:[D," of ",Y.length," agents running"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("div",{className:"w-48",children:q.jsxDEV(A,{value:R,onChange:I,placeholder:"All agents",options:[{value:"",label:"All agents"},...Y.map((z)=>({value:z.id,label:z.name}))]},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex-1 overflow-auto px-6 pb-6",children:M.length===0?q.jsxDEV("div",{className:"flex flex-col items-center justify-center py-20 text-[var(--color-text-faint)]",children:[q.jsxDEV("p",{className:"text-lg mb-2",children:"No activity yet"},void 0,!1,void 0,this),q.jsxDEV("p",{className:"text-sm",children:"Agent activity will appear here in real-time."},void 0,!1,void 0,this)]},void 0,!0,void 0,this):q.jsxDEV("div",{className:"max-w-2xl",children:f.map((z)=>q.jsxDEV("div",{children:[q.jsxDEV("div",{className:"sticky top-0 z-10 bg-[var(--color-bg)] backdrop-blur-sm py-2 mb-1",children:q.jsxDEV("span",{className:"text-xs font-semibold text-[var(--color-text-muted)] uppercase tracking-wider",children:z.label},void 0,!1,void 0,this)},void 0,!1,void 0,this),q.jsxDEV("div",{className:"relative ml-3 border-l border-[var(--color-border)]",children:z.events.map((J)=>{let B=!O.has(J.id);if(B)O.add(J.id);let k=h.get(J.agent_id)||J.agent_id.slice(0,8),K=J.level==="error"?"bg-red-400":j[J.category]||"bg-[var(--color-text-faint)]";return q.jsxDEV("div",{className:`relative pl-6 pr-3 py-2.5 hover:bg-[var(--color-surface-hover)] transition-colors ${B?"animate-slideIn":""}`,children:[q.jsxDEV("span",{className:`absolute left-[-4.5px] top-[14px] w-[9px] h-[9px] rounded-full ${K} ring-2 ring-[#0a0a0a]`},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex items-start justify-between gap-3",children:[q.jsxDEV("div",{className:"flex-1 min-w-0",children:[q.jsxDEV("p",{className:`text-sm ${J.level==="error"?"text-red-400":""}`,children:m(J,k)},void 0,!1,void 0,this),q.jsxDEV("div",{className:"flex items-center gap-2 text-[11px] text-[var(--color-text-faint)] mt-0.5",children:[q.jsxDEV("span",{className:"text-[var(--color-text-secondary)] font-medium",children:k},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-[var(--color-border-light)]",children:"·"},void 0,!1,void 0,this),q.jsxDEV("span",{className:"text-[var(--color-text-faint)]",children:J.category},void 0,!1,void 0,this),J.duration_ms!=null&&J.duration_ms>0&&q.jsxDEV(q.Fragment,{children:[q.jsxDEV("span",{className:"text-[var(--color-border-light)]",children:"·"},void 0,!1,void 0,this),q.jsxDEV("span",{children:J.duration_ms<1000?`${J.duration_ms}ms`:`${(J.duration_ms/1000).toFixed(1)}s`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),q.jsxDEV("span",{className:"text-[11px] text-[var(--color-text-faint)] shrink-0 pt-0.5",children:g(J.timestamp)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},J.id,!0,void 0,this)})},void 0,!1,void 0,this)]},z.label,!0,void 0,this))},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function g($){let G=Math.floor((Date.now()-new Date($).getTime())/1000);if(G<5)return"just now";if(G<60)return`${G}s ago`;let U=Math.floor(G/60);if(U<60)return`${U}m ago`;let Q=Math.floor(U/60);if(Q<24)return`${Q}h ago`;return`${Math.floor(Q/24)}d ago`}export{l as ActivityPage};
|
|
2
2
|
|
|
3
3
|
//# debugId=D584AFE9ED97069764756E2164756E21
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as E,X as y,aa as D,ja as l}from"./App.
|
|
1
|
+
import{$ as E,X as y,aa as D,ja as l}from"./App.94x6mh7f.js";var M=y(E(),1);var z=y(D(),1),V={get:"#61affe",post:"#49cc90",put:"#fca130",delete:"#f93e3e",patch:"#50e3c2"};function c({method:I,path:A,parameters:F,requestBody:L,authFetch:T}){let[U,R]=M.useState({}),[G,O]=M.useState(""),[_,k]=M.useState(null),[w,q]=M.useState(!1),[B,f]=M.useState(null);M.useEffect(()=>{if(L?.content?.["application/json"]?.schema){let W=L.content["application/json"].schema;if(W.example)O(JSON.stringify(W.example,null,2));else if(W.properties){let $={};for(let[N,Q]of Object.entries(W.properties))if(Q.example!==void 0)$[N]=Q.example;else if(Q.type==="string")$[N]="";else if(Q.type==="number"||Q.type==="integer")$[N]=0;else if(Q.type==="boolean")$[N]=!1;else if(Q.type==="array")$[N]=[];else if(Q.type==="object")$[N]={};O(JSON.stringify($,null,2))}}},[L]);let C=async()=>{q(!0),f(null),k(null);try{let W=A,$=[];for(let Z of F||[]){let H=U[Z.name]||"";if(Z.in==="path")W=W.replace(`{${Z.name}}`,encodeURIComponent(H));else if(Z.in==="query"&&H)$.push(`${Z.name}=${encodeURIComponent(H)}`)}if($.length>0)W+=`?${$.join("&")}`;let N={method:I.toUpperCase()};if(G&&["post","put","patch"].includes(I))N.headers={"Content-Type":"application/json"},N.body=G;let Q=await T(`/api${W}`,N),X;if(Q.headers.get("content-type")?.includes("application/json"))X=await Q.json();else X=await Q.text();k({status:Q.status,data:X})}catch(W){f(W.message||"Request failed")}finally{q(!1)}},b=F?.filter((W)=>W.in==="path")||[],K=F?.filter((W)=>W.in==="query")||[],S=["post","put","patch"].includes(I)&&L;return z.jsxDEV("div",{style:{marginTop:16,padding:16,background:"var(--color-bg)",borderRadius:6,border:"1px solid var(--color-border-light)"},children:[z.jsxDEV("h4",{style:{fontSize:13,color:"var(--color-accent)",marginBottom:12,fontWeight:600},children:"Try it out"},void 0,!1,void 0,this),b.length>0&&z.jsxDEV("div",{style:{marginBottom:12},children:[z.jsxDEV("div",{style:{fontSize:11,color:"var(--color-text-muted)",marginBottom:6},children:"Path Parameters"},void 0,!1,void 0,this),b.map((W)=>z.jsxDEV("div",{style:{marginBottom:8},children:[z.jsxDEV("label",{style:{fontSize:12,color:"var(--color-text-secondary)",display:"block",marginBottom:4},children:[W.name," ",W.required&&z.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("input",{type:"text",value:U[W.name]||"",onChange:($)=>R({...U,[W.name]:$.target.value}),placeholder:W.schema?.type||"string",style:{width:"100%",padding:"8px 12px",background:"var(--color-surface)",border:"1px solid var(--color-border-light)",borderRadius:4,color:"var(--color-text)",fontSize:13,fontFamily:"monospace"}},void 0,!1,void 0,this)]},W.name,!0,void 0,this))]},void 0,!0,void 0,this),K.length>0&&z.jsxDEV("div",{style:{marginBottom:12},children:[z.jsxDEV("div",{style:{fontSize:11,color:"var(--color-text-muted)",marginBottom:6},children:"Query Parameters"},void 0,!1,void 0,this),K.map((W)=>z.jsxDEV("div",{style:{marginBottom:8},children:[z.jsxDEV("label",{style:{fontSize:12,color:"var(--color-text-secondary)",display:"block",marginBottom:4},children:[W.name," ",W.required&&z.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("input",{type:"text",value:U[W.name]||"",onChange:($)=>R({...U,[W.name]:$.target.value}),placeholder:W.schema?.type||"string",style:{width:"100%",padding:"8px 12px",background:"var(--color-surface)",border:"1px solid var(--color-border-light)",borderRadius:4,color:"var(--color-text)",fontSize:13,fontFamily:"monospace"}},void 0,!1,void 0,this)]},W.name,!0,void 0,this))]},void 0,!0,void 0,this),S&&z.jsxDEV("div",{style:{marginBottom:12},children:[z.jsxDEV("div",{style:{fontSize:11,color:"var(--color-text-muted)",marginBottom:6},children:"Request Body (JSON)"},void 0,!1,void 0,this),z.jsxDEV("textarea",{value:G,onChange:(W)=>O(W.target.value),rows:6,style:{width:"100%",padding:"8px 12px",background:"var(--color-surface)",border:"1px solid var(--color-border-light)",borderRadius:4,color:"var(--color-text)",fontSize:12,fontFamily:"monospace",resize:"vertical"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("button",{onClick:C,disabled:w,style:{padding:"10px 20px",background:w?"var(--color-border-light)":"var(--color-accent)",color:w?"var(--color-text-muted)":"#000",border:"none",borderRadius:4,cursor:w?"not-allowed":"pointer",fontSize:13,fontWeight:600},children:w?"Executing...":"Execute"},void 0,!1,void 0,this),B&&z.jsxDEV("div",{style:{marginTop:12,padding:12,background:"#2a1515",borderRadius:4,color:"#f66",fontSize:12},children:B},void 0,!1,void 0,this),_&&z.jsxDEV("div",{style:{marginTop:12},children:[z.jsxDEV("div",{style:{fontSize:11,color:"var(--color-text-muted)",marginBottom:6},children:["Response"," ",z.jsxDEV("span",{style:{color:_.status>=200&&_.status<300?"#49cc90":"#f66"},children:_.status},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("pre",{style:{padding:12,background:"var(--color-surface)",borderRadius:4,color:"var(--color-text-secondary)",fontSize:11,fontFamily:"monospace",overflow:"auto",maxHeight:300,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:typeof _.data==="string"?_.data:JSON.stringify(_.data,null,2)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function h(){let{authFetch:I}=l(),[A,F]=M.useState(null),[L,T]=M.useState(!0),[U,R]=M.useState(new Set),[G,O]=M.useState(null),[_,k]=M.useState(!1);M.useEffect(()=>{B()},[]);async function w(){if(!A)return;try{await navigator.clipboard.writeText(JSON.stringify(A,null,2)),k(!0),setTimeout(()=>k(!1),2000)}catch(N){console.error("Failed to copy:",N)}}function q(){if(!A)return;let N=new Blob([JSON.stringify(A,null,2)],{type:"application/json"}),Q=URL.createObjectURL(N),X=document.createElement("a");X.href=Q,X.download="apteva-openapi.json",X.click(),URL.revokeObjectURL(Q)}async function B(){try{let N=await I("/api/openapi");if(N.ok){let Q=await N.json();F(Q)}}catch(N){console.error("Failed to load OpenAPI spec:",N)}finally{T(!1)}}function f(N){R((Q)=>{let X=new Set(Q);if(X.has(N))X.delete(N);else X.add(N);return X})}function C(N,Q=0){if(!N)return"{}";if(Q>2)return"...";if(N.$ref)return N.$ref.split("/").pop()||"Object";if(N.type==="array")return`${C(N.items,Q+1)}[]`;if(N.type==="object"&&N.properties){let X=Object.entries(N.properties).slice(0,3).map(([Z,H])=>`${Z}: ${H.type||"any"}`).join(", "),Y=Object.keys(N.properties).length>3?", ...":"";return`{ ${X}${Y} }`}return N.type||"any"}if(L)return z.jsxDEV("div",{style:{padding:24},children:z.jsxDEV("p",{style:{color:"var(--color-text-secondary)"},children:"Loading API documentation..."},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(!A)return z.jsxDEV("div",{style:{padding:24},children:z.jsxDEV("p",{style:{color:"#f66"},children:"Failed to load API documentation"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let b=A.tags||[],K=Object.entries(A.paths);function S(N){let Q=new Set;function X(Y){if(!Y)return;if(typeof Y==="object"){if(Y.$ref){let Z=Y.$ref.split("/").pop();if(Z)Q.add(Z)}for(let Z of Object.values(Y))X(Z)}}return X(N.requestBody),X(N.responses),Q}function W(){if(!G||!A.components?.schemas)return Object.keys(A.components?.schemas||{});let N=new Set;for(let[Q,X]of $)for(let[Y,Z]of Object.entries(X)){if(!["get","post","put","delete","patch"].includes(Y))continue;if(Z.tags?.includes(G))S(Z).forEach((g)=>N.add(g))}return Array.from(N)}let $=G?K.filter(([N,Q])=>Object.values(Q).some((X)=>X.tags?.includes(G))):K;return z.jsxDEV("div",{style:{padding:24,maxWidth:1000,height:"100%",overflowY:"auto"},children:[z.jsxDEV("div",{style:{marginBottom:24},children:[z.jsxDEV("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:8},children:[z.jsxDEV("h1",{style:{fontSize:24,fontWeight:600},children:A.info.title},void 0,!1,void 0,this),z.jsxDEV("div",{style:{display:"flex",gap:8},children:[z.jsxDEV("button",{onClick:w,style:{padding:"8px 16px",borderRadius:4,border:"1px solid var(--color-border-light)",background:_?"#49cc90":"var(--color-surface-raised)",color:_?"#000":"var(--color-text)",cursor:"pointer",fontSize:12,fontFamily:"inherit"},children:_?"Copied!":"Copy JSON"},void 0,!1,void 0,this),z.jsxDEV("button",{onClick:q,style:{padding:"8px 16px",borderRadius:4,border:"1px solid var(--color-border-light)",background:"var(--color-surface-raised)",color:"var(--color-text)",cursor:"pointer",fontSize:12,fontFamily:"inherit"},children:"Download"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("p",{style:{color:"var(--color-text-secondary)",marginBottom:8},children:A.info.description.split(`
|
|
2
2
|
`)[0]},void 0,!1,void 0,this),z.jsxDEV("p",{style:{color:"var(--color-text-muted)",fontSize:12},children:["Version: ",A.info.version]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{style:{background:"var(--color-surface-raised)",padding:12,borderRadius:6,marginBottom:24,fontFamily:"monospace"},children:[z.jsxDEV("span",{style:{color:"var(--color-text-secondary)"},children:"Base URL: "},void 0,!1,void 0,this),z.jsxDEV("span",{style:{color:"#61affe"},children:[window.location.origin,"/api"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{style:{marginBottom:24,display:"flex",flexWrap:"wrap",gap:8},children:[z.jsxDEV("button",{onClick:()=>O(null),style:{padding:"6px 12px",borderRadius:4,border:"1px solid var(--color-border-light)",background:G===null?"var(--color-border-light)":"transparent",color:G===null?"var(--color-text)":"var(--color-text-secondary)",cursor:"pointer",fontSize:12},children:"All"},void 0,!1,void 0,this),b.map((N)=>z.jsxDEV("button",{onClick:()=>O(N.name),style:{padding:"6px 12px",borderRadius:4,border:"1px solid var(--color-border-light)",background:G===N.name?"var(--color-border-light)":"transparent",color:G===N.name?"var(--color-text)":"var(--color-text-secondary)",cursor:"pointer",fontSize:12},title:N.description,children:N.name},N.name,!1,void 0,this))]},void 0,!0,void 0,this),z.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:8},children:$.map(([N,Q])=>Object.entries(Q).filter(([X])=>["get","post","put","delete","patch"].includes(X)).map(([X,Y])=>{let Z=`${X}:${N}`,H=U.has(Z),g=X.toUpperCase(),j=V[X]||"var(--color-text-secondary)";return z.jsxDEV("div",{style:{border:"1px solid var(--color-border-light)",borderRadius:6,overflow:"hidden"},children:[z.jsxDEV("div",{onClick:()=>f(Z),style:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",background:H?"var(--color-surface-raised)":"transparent",cursor:"pointer"},children:[z.jsxDEV("span",{style:{background:j,color:"#000",padding:"4px 8px",borderRadius:4,fontSize:11,fontWeight:600,minWidth:60,textAlign:"center"},children:g},void 0,!1,void 0,this),z.jsxDEV("span",{style:{fontFamily:"monospace",color:"var(--color-text)"},children:N},void 0,!1,void 0,this),z.jsxDEV("span",{style:{color:"var(--color-text-secondary)",flex:1,fontSize:13},children:Y.summary},void 0,!1,void 0,this),z.jsxDEV("span",{style:{color:"var(--color-text-muted)",fontSize:12},children:H?"[-]":"[+]"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H&&z.jsxDEV("div",{style:{padding:16,background:"var(--color-bg)",borderTop:"1px solid var(--color-border-light)"},children:[Y.description&&z.jsxDEV("p",{style:{color:"var(--color-text-secondary)",marginBottom:16,fontSize:13},children:Y.description},void 0,!1,void 0,this),Y.parameters&&Y.parameters.length>0&&z.jsxDEV("div",{style:{marginBottom:16},children:[z.jsxDEV("h4",{style:{fontSize:13,color:"var(--color-text-secondary)",marginBottom:8},children:"Parameters"},void 0,!1,void 0,this),z.jsxDEV("div",{style:{background:"var(--color-surface-raised)",borderRadius:4,padding:12},children:Y.parameters.map((J)=>z.jsxDEV("div",{style:{display:"flex",gap:12,marginBottom:8,fontSize:12},children:[z.jsxDEV("span",{style:{color:"#61affe",minWidth:100},children:[J.name,J.required&&z.jsxDEV("span",{style:{color:"#f66"},children:"*"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("span",{style:{color:"var(--color-text-muted)"},children:["(",J.in,")"]},void 0,!0,void 0,this),z.jsxDEV("span",{style:{color:"var(--color-text-secondary)"},children:J.schema?.type||"string"},void 0,!1,void 0,this),J.description&&z.jsxDEV("span",{style:{color:"var(--color-text-muted)"},children:["- ",J.description]},void 0,!0,void 0,this)]},J.name,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.requestBody&&z.jsxDEV("div",{style:{marginBottom:16},children:[z.jsxDEV("h4",{style:{fontSize:13,color:"var(--color-text-secondary)",marginBottom:8},children:["Request Body",Y.requestBody.required&&z.jsxDEV("span",{style:{color:"#f66"},children:" (required)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{style:{background:"var(--color-surface-raised)",borderRadius:4,padding:12,fontFamily:"monospace",fontSize:12,color:"#49cc90"},children:Object.entries(Y.requestBody.content||{}).map(([J,P])=>z.jsxDEV("div",{children:[z.jsxDEV("span",{style:{color:"var(--color-text-muted)"},children:[J,": "]},void 0,!0,void 0,this),C(P.schema)]},J,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y.responses&&z.jsxDEV("div",{children:[z.jsxDEV("h4",{style:{fontSize:13,color:"var(--color-text-secondary)",marginBottom:8},children:"Responses"},void 0,!1,void 0,this),z.jsxDEV("div",{style:{background:"var(--color-surface-raised)",borderRadius:4,padding:12},children:Object.entries(Y.responses).map(([J,P])=>{let v=P.content?.["application/json"]?.schema,u=v?.$ref?.split("/").pop(),n=v?.type,i=v?.items?.$ref?.split("/").pop();return z.jsxDEV("div",{style:{marginBottom:12,fontSize:12},children:[z.jsxDEV("div",{style:{display:"flex",gap:12,marginBottom:4},children:[z.jsxDEV("span",{style:{color:J.startsWith("2")?"#49cc90":"#f66",minWidth:40},children:J},void 0,!1,void 0,this),z.jsxDEV("span",{style:{color:"var(--color-text-secondary)"},children:P.description},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v&&z.jsxDEV("div",{style:{marginLeft:52,padding:"8px 12px",background:"var(--color-bg)",borderRadius:4,fontFamily:"monospace"},children:u?z.jsxDEV("span",{style:{color:"#61affe"},children:u},void 0,!1,void 0,this):n==="array"&&i?z.jsxDEV("span",{style:{color:"#61affe"},children:[i,"[]"]},void 0,!0,void 0,this):n==="array"?z.jsxDEV("span",{style:{color:"var(--color-text-secondary)"},children:"array"},void 0,!1,void 0,this):z.jsxDEV("span",{style:{color:"var(--color-text-secondary)"},children:C(v)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},J,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV(c,{method:X,path:N,parameters:Y.parameters,requestBody:Y.requestBody,authFetch:I},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},Z,!0,void 0,this)}))},void 0,!1,void 0,this),A.components?.schemas&&W().length>0&&z.jsxDEV("div",{style:{marginTop:32},children:[z.jsxDEV("h2",{style:{fontSize:18,fontWeight:600,marginBottom:16},children:["Schemas ",G&&z.jsxDEV("span",{style:{color:"var(--color-text-muted)",fontSize:14},children:["(",G,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),z.jsxDEV("div",{style:{display:"flex",flexDirection:"column",gap:8},children:W().map((N)=>{let Q=A.components.schemas[N];if(!Q)return null;return z.jsxDEV("div",{style:{border:"1px solid var(--color-border-light)",borderRadius:6,padding:12},children:[z.jsxDEV("h3",{style:{fontSize:14,color:"#61affe",marginBottom:8},children:N},void 0,!1,void 0,this),Q.properties&&z.jsxDEV("div",{style:{fontSize:12},children:Object.entries(Q.properties).map(([X,Y])=>z.jsxDEV("div",{style:{display:"flex",gap:8,marginBottom:4,fontFamily:"monospace"},children:[z.jsxDEV("span",{style:{color:"var(--color-text)",minWidth:120},children:X},void 0,!1,void 0,this),z.jsxDEV("span",{style:{color:"var(--color-text-secondary)"},children:[Y.type||(Y.$ref?Y.$ref.split("/").pop():"any"),Y.nullable&&" | null"]},void 0,!0,void 0,this),Y.enum&&z.jsxDEV("span",{style:{color:"var(--color-text-muted)"},children:["[",Y.enum.join(" | "),"]"]},void 0,!0,void 0,this)]},X,!0,void 0,this))},void 0,!1,void 0,this)]},N,!0,void 0,this)})},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}export{h as ApiDocsPage};
|
|
3
3
|
|
|
4
4
|
//# debugId=59EEC8715E10AB6E64756E2164756E21
|