import{R as s,bE as r,d7 as u,a as o,aP as c,q as n}from"./index-C88DWJny.js";const i=["can_edit","can_delete"],h=async e=>{const t=new URLSearchParams;return t.set("recursion","2"),u(t,e,i),fetch(`${s}/1.0/cluster/links?${t.toString()}`).then(r).then(a=>a.metadata)},d=async(e,t)=>{const a=new URLSearchParams;return a.set("recursion","2"),u(a,t,i),fetch(`${s}/1.0/cluster/links/${encodeURIComponent(e)}?${a.toString()}`).then(r).then(l=>l.metadata)},y=async e=>fetch(`${s}/1.0/cluster/links/${encodeURIComponent(e)}/state`).then(r).then(t=>t.metadata),k=async e=>fetch(`${s}/1.0/cluster/links`,{method:"POST",headers:{"Content-Type":"application/json"},body:e}).then(r).then(t=>t.metadata),p=async(e,t)=>{await fetch(`${s}/1.0/cluster/links/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:t}).then(r)},C=async e=>{await fetch(`${s}/1.0/cluster/links/${encodeURIComponent(e)}`,{method:"DELETE"}).then(r)},L=()=>{const{isFineGrained:e}=o();return c({queryKey:[n.cluster,n.links],queryFn:async()=>h(e)})},$=e=>{const{isFineGrained:t}=o();return c({queryKey:[n.cluster,n.links,e],queryFn:async()=>d(e,t)})},f=e=>c({queryKey:[n.cluster,n.links,e,n.state],queryFn:async()=>y(e)});export{$ as a,p as b,k as c,C as d,L as e,f as u};
