import{d as y,eB as f,eA as C,G as _,b as g,c as I,u as w}from"./outputWidgets.470cd725.js";import{b as h}from"./index.d44cde0e.js";import"./authorManager.176ccd94.js";import{C as i}from"./connector.f6407e9e.js";import{a as k}from"./asyncComputed.72d91ef9.js";import{u as x,o as E}from"./icons.732210f6.js";import{C as D}from"./CrudView.e08250db.js";import"./index.cf4c23b9.js";import"./record.19f593f6.js";import"./pubsub.bb7b27fb.js";import"./gateway.6d700df7.js";import"./Title.edbac04b.js";import"./Text.fbb768c7.js";import"./FormItem.bd89e955.js";import"./hasIn.6bd3aa8a.js";import"./Form.bf13abb6.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.702cb95e.js";import"./router.bb51d819.js";import"./index.672f7932.js";import"./url.28fafd73.js";import"./index.e48b3db7.js";import"./index.2d4e9800.js";import"./index.52ab7ae6.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[r]="bd2bbdd1-96fc-4275-88ed-9e5879b1534b",o._sentryDebugIdIdentifier="sentry-dbid-bd2bbdd1-96fc-4275-88ed-9e5879b1534b")}catch{}})();const W=y({__name:"Connectors",setup(o){const r=f(),a=C(),c=r.params.projectId;async function s(e){const t=await i.create(c,e.name,e.type);a.push({name:"connectorEditor",params:{connectorId:t.id}})}const p=[{key:"name",label:"Connector name",type:"text"},{key:"type",label:"Connector type",type:Object.entries(h.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:m,result:d,refetch:l}=k(()=>i.list(c)),u=_(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=d.value)==null?void 0:e.map(n=>({key:n.id,cells:[{text:n.name,link:{name:"connectorEditor",params:{connectorId:n.id}}},{text:n.type},{text:"Actions",actions:[{icon:x,label:"Edit",onClick({key:b}){a.push({name:"connectorEditor",params:{connectorId:b}})}},{icon:E,label:"Delete",dangerous:!0,async onClick(){await n.delete(),l()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),I(D,{"entity-name":"connector",loading:w(m),title:"Connectors",description:"Each connector is a version of your app. You can create a new connector by deploying your app from the local editor.","empty-title":"No connectors here yet",table:u.value,fields:p,"create-button-text":"Create connector",onCreate:s},null,8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Connectors.48a4ef8c.js.map
