import{f as t}from"./main.js";const g={list:e=>t.get("v3/console/cs/config/list",{params:e}),searchDetail:e=>t.get("v3/console/cs/config/searchDetail",{params:e}),get:e=>t.get("v3/console/cs/config",{params:e}),publish:e=>t.post("v3/console/cs/config",e),delete:e=>t.delete("v3/console/cs/config",{params:e}),batchDelete:e=>t.delete("v3/console/cs/config/batchDelete",{params:e}),historyList:e=>t.get("v3/console/cs/history/list",{params:e}),historyDetail:e=>t.get("v3/console/cs/history",{params:e}),historyPrevious:e=>t.get("v3/console/cs/history/previous",{params:e}),listenersByConfig:e=>t.get("v3/console/cs/config/listener",{params:e}),listenersByIp:e=>t.get("v3/console/cs/config/listener/ip",{params:e}),getBeta:e=>t.get("v3/console/cs/config/beta",{params:e}),publishBeta:(e,s)=>t.post("v3/console/cs/config",e,{headers:{betaIps:s}}),stopBeta:e=>t.delete("v3/console/cs/config/beta",{params:e}),exportUrl:e=>{const s=t.defaults.baseURL||"",o=new URLSearchParams;o.set("namespaceId",e.namespaceId),e.ids!==void 0&&o.set("ids",e.ids),e.groupName&&o.set("groupName",e.groupName),e.appName&&o.set("appName",e.appName),e.dataId&&o.set("dataId",e.dataId);try{const n=localStorage.getItem("token");if(n){const c=JSON.parse(n);c.accessToken&&o.set("accessToken",c.accessToken),c.username&&o.set("username",c.username)}}catch{}return`${s}v3/console/cs/config/export2?${o.toString()}`},importFile:(e,s,o)=>{const n=new FormData;n.append("file",o);let c="",a="";try{const i=localStorage.getItem("token");if(i){const l=JSON.parse(i);a=l.accessToken||"",c=l.username||""}}catch{}return t.post("v3/console/cs/config/import",n,{params:{namespaceId:e,policy:s,accessToken:a,username:c},headers:{"Content-Type":"multipart/form-data"}})},clone:(e,s)=>t.post("v3/console/cs/config/clone",JSON.stringify(s),{params:{targetNamespaceId:e.targetNamespaceId,policy:e.policy,namespaceId:e.namespaceId},headers:{"Content-Type":"application/json"}})};export{g as c};
