import{b as s,c as u,u as a}from"./vendor-query-B2UbickB.js";import{b as n}from"./index-BZu5zewH.js";function y(e={}){const t=new URLSearchParams;return e.limit&&t.set("limit",String(e.limit)),e.offset!==void 0&&t.set("offset",String(e.offset)),a({queryKey:["bots",e],queryFn:()=>n(`/bot-accounts?${t}`)})}function d(e){return a({queryKey:["bots",e,"api-keys"],queryFn:()=>n(`/bot-accounts/${e}/api-keys`),enabled:!!e})}function b(){const e=s();return u({mutationFn:t=>n("/bot-accounts",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["bots"]})}})}function m(){const e=s();return u({mutationFn:({id:t,...o})=>n(`/bot-accounts/${t}`,{method:"PUT",body:JSON.stringify(o)}),onSuccess:()=>{e.invalidateQueries({queryKey:["bots"]})}})}function f(){const e=s();return u({mutationFn:t=>n(`/bot-accounts/${t}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["bots"]})}})}function l(){const e=s();return u({mutationFn:({botId:t,name:o,scopes:i})=>n(`/bot-accounts/${t}/api-keys`,{method:"POST",body:JSON.stringify({name:o,scopes:i})}),onSuccess:(t,o)=>{e.invalidateQueries({queryKey:["bots",o.botId,"api-keys"]})}})}function q(){const e=s();return u({mutationFn:({botId:t,keyId:o})=>n(`/bot-accounts/${t}/api-keys/${o}`,{method:"DELETE"}),onSuccess:(t,o)=>{e.invalidateQueries({queryKey:["bots",o.botId,"api-keys"]})}})}function S(){const e=s();return u({mutationFn:({botId:t,role:o,type:i})=>n(`/bot-accounts/${t}/roles`,{method:"POST",body:JSON.stringify({role:o,type:i})}),onSuccess:()=>{e.invalidateQueries({queryKey:["bots"]})}})}function p(){const e=s();return u({mutationFn:({botId:t,role:o})=>n(`/bot-accounts/${t}/roles/${encodeURIComponent(o)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:["bots"]})}})}export{m as a,d as b,l as c,q as d,S as e,p as f,f as g,y as h,b as u};
//# sourceMappingURL=bots-t1FPESbm.js.map
