@autocode-cli/autocode 0.38.2 → 0.38.3
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/9gK7KPMv.js +1 -0
- package/.output/public/_nuxt/{DJjCRJhp.js → B0mo0uqY.js} +1 -1
- package/.output/public/_nuxt/{vmoRsjSo.js → B2kf_m6C.js} +1 -1
- package/.output/public/_nuxt/{D6PNtP0_.js → B4SA9X-a.js} +1 -1
- package/.output/public/_nuxt/B4wMOrGF.js +1 -0
- package/.output/public/_nuxt/{BYF8gHRW.js → BBj9FZvo.js} +1 -1
- package/.output/public/_nuxt/{CLW3obj5.js → BGp8YvuN.js} +1 -1
- package/.output/public/_nuxt/{DKgemWiE.js → BH_01oUJ.js} +1 -1
- package/.output/public/_nuxt/{RgNv66WU.js → BJMGsUpo.js} +1 -1
- package/.output/public/_nuxt/{ZwekkJkt.js → BLZ5VH7t.js} +1 -1
- package/.output/public/_nuxt/{_NYypPKu.js → BP5Ux6fH.js} +1 -1
- package/.output/public/_nuxt/{COSxhdDS.js → BQ3bbdDh.js} +1 -1
- package/.output/public/_nuxt/{6guOtdqw.js → BROSb6Q-.js} +1 -1
- package/.output/public/_nuxt/{oFSgMRDY.js → BTlB8J5k.js} +1 -1
- package/.output/public/_nuxt/{DNy56O1k.js → BWtNGTwE.js} +1 -1
- package/.output/public/_nuxt/{DTcXWbr5.js → BZgps0X6.js} +1 -1
- package/.output/public/_nuxt/{BVsyb2e6.js → BbxWU3pf.js} +1 -1
- package/.output/public/_nuxt/{Dred22d0.js → BeGS-B6D.js} +1 -1
- package/.output/public/_nuxt/{BnQis2Wb.js → Bgakki82.js} +1 -1
- package/.output/public/_nuxt/{DlO36yMp.js → BsdrvKkE.js} +1 -1
- package/.output/public/_nuxt/{BajA-R3t.js → Bt9SJD2w.js} +3 -3
- package/.output/public/_nuxt/CBB8YzCG.js +1 -0
- package/.output/public/_nuxt/{CRQzIZYM.js → CExZFYAd.js} +1 -1
- package/.output/public/_nuxt/{0HczxCVv.js → CIl_Ss5o.js} +1 -1
- package/.output/public/_nuxt/{CIrlkMnL.js → CKq-o50X.js} +1 -1
- package/.output/public/_nuxt/{BNy2STaj.js → CQWwIj8_.js} +1 -1
- package/.output/public/_nuxt/{DDABJbm9.js → CSScY24L.js} +1 -1
- package/.output/public/_nuxt/{B1XzNfSL.js → CUAkHKXg.js} +1 -1
- package/.output/public/_nuxt/{DQcftxMR.js → CX-W21V-.js} +1 -1
- package/.output/public/_nuxt/{0fb47W2G.js → Cb9gbUoa.js} +1 -1
- package/.output/public/_nuxt/{DKB4Mc1Q.js → CfX6M68B.js} +3 -3
- package/.output/public/_nuxt/{-f1liQz1.js → CgQoEUd2.js} +1 -1
- package/.output/public/_nuxt/{DxfoOa6c.js → CjUob8wT.js} +1 -1
- package/.output/public/_nuxt/{GnKgiMOf.js → Cjum7edO.js} +1 -1
- package/.output/public/_nuxt/{DEvRa3of.js → CjwSiblu.js} +1 -1
- package/.output/public/_nuxt/{B5fw33KK.js → CkKT-c7e.js} +1 -1
- package/.output/public/_nuxt/{DcNcSmJ0.js → ClyG0FEr.js} +1 -1
- package/.output/public/_nuxt/{C5fz81dA.js → Ct_UoqdU.js} +1 -1
- package/.output/public/_nuxt/{CxIMD2YC.js → Cvz8hXR5.js} +1 -1
- package/.output/public/_nuxt/{C_xNnhFc.js → D-5XOZh1.js} +1 -1
- package/.output/public/_nuxt/{Da1dX7RW.js → D0YsLD9c.js} +1 -1
- package/.output/public/_nuxt/{CDrMVkFg.js → D1ZHD2YO.js} +1 -1
- package/.output/public/_nuxt/{PakvrKeO.js → D9kSURBB.js} +1 -1
- package/.output/public/_nuxt/{BZ6FzmBL.js → DBbUUxUe.js} +1 -1
- package/.output/public/_nuxt/{B2RgqbNO.js → DCoyLE6i.js} +1 -1
- package/.output/public/_nuxt/{Bc3I1G9W.js → DM-FWuh7.js} +1 -1
- package/.output/public/_nuxt/{DU_LmBMB.js → DOBYm3ey.js} +1 -1
- package/.output/public/_nuxt/{rEg4ipuK.js → DQqeYRHW.js} +1 -1
- package/.output/public/_nuxt/{B3P4PwA5.js → DWVSbXSA.js} +1 -1
- package/.output/public/_nuxt/{DGy8YoXT.js → DeKcIehA.js} +1 -1
- package/.output/public/_nuxt/{DzaPzzsO.js → Di9DNWFc.js} +1 -1
- package/.output/public/_nuxt/{DqEU6TSY.js → DmrBSt6T.js} +1 -1
- package/.output/public/_nuxt/{N7kSzZAV.js → DoMHqyvz.js} +1 -1
- package/.output/public/_nuxt/{D0qgRfni.js → Drb7y3jx.js} +1 -1
- package/.output/public/_nuxt/{WK5WZELE.js → DsY01CVv.js} +1 -1
- package/.output/public/_nuxt/{DpcTyoGM.js → DtkAtC_w.js} +1 -1
- package/.output/public/_nuxt/{CBvW1gAI.js → DxKcaf4M.js} +1 -1
- package/.output/public/_nuxt/{PvSILeNu.js → Higd80F6.js} +1 -1
- package/.output/public/_nuxt/{Dy-CBgLm.js → ND3qLMiK.js} +1 -1
- package/.output/public/_nuxt/{jNB-5CTq.js → OGWprgQz.js} +1 -1
- package/.output/public/_nuxt/{CsTVNF-2.js → UOstWU-9.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/c43952fe-8633-4dd5-9431-caeec08106b1.json +1 -0
- package/.output/public/_nuxt/{BS8cve1k.js → dsUD-RPo.js} +1 -1
- package/.output/public/_nuxt/{BJqVHY5h.js → fZy4ko4U.js} +1 -1
- package/.output/public/_nuxt/{CZqTwjXm.js → lUhfo_8K.js} +1 -1
- package/.output/public/_nuxt/{tYdwqztA.js → qnjdBA9-.js} +1 -1
- package/.output/public/_nuxt/{CIXkncWO.js → wzNr8bfZ.js} +1 -1
- package/.output/public/api/_openapi.json +1 -1
- package/.output/public/docs/api/index.html +1 -1
- package/.output/public/docs/cli/index.html +1 -1
- package/.output/public/index.html +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/server.mjs +2 -2
- package/.output/server/chunks/build/styles.mjs +19 -19
- package/.output/server/chunks/nitro/nitro.mjs +405 -405
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/BCNjSdYq.js +0 -1
- package/.output/public/_nuxt/Bn4DFtby.js +0 -1
- package/.output/public/_nuxt/D4nTCY0i.js +0 -1
- package/.output/public/_nuxt/builds/meta/9a1c9664-8962-4c8a-9520-847d9c1906db.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as x}from"./
|
|
1
|
+
import{_ as x}from"./CSScY24L.js";import{_ as C}from"./DCoyLE6i.js";import{d as T,H as F,x as h,m as I,v as L,c as a,f as v,e as n,h as e,k as V,t,F as D,q as H,w as B,b as i,s as S,g as X,_ as A}from"./CfX6M68B.js";import{u as y}from"./BGp8YvuN.js";const E={class:"terminal-page"},R={class:"card"},q={class:"section-header"},z={class:"session-badge"},J={key:0,class:"column-badge"},O={key:0,class:"loading"},W={key:1,class:"error-message"},Y={key:2,class:"empty"},j={key:3,class:"terminal-content"},G={class:"log-time"},K={class:"log-level"},M={class:"log-message"},P={class:"actions"},Q=T({__name:"terminal",async setup(U){let o,c;const p=F(),l=p.params.id,u=p.params.sessionId,{data:r}=([o,c]=h(()=>y(`/api/issues/${l}`,"$WXwXsy2rDm")),o=await o,c(),o),f=I(()=>{if(!r.value)return null;const s={id:r.value.key,title:r.value.title,column:r.value.column_slug};return r.value.priority&&(s.priority=r.value.priority),s}),{data:d,status:$,error:g}=([o,c]=h(()=>y(`/api/issues/${l}/history/${u}/log`,"$7VJyO-YXL0")),o=await o,c(),o),k=s=>{const m=new Date(s);return isNaN(m.getTime())?s:m.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})};return L({title:`Terminal ${u} - ${l} - AutoCode`}),(s,m)=>{const w=x,b=C;return i(),a("div",E,[v(w,{issue:e(f),"active-tab":"history"},null,8,["issue"]),n("div",R,[n("div",q,[n("h2",null,t(s.$t("history.viewTerminal")),1),n("span",z,t(e(u)),1),e(d)?.column?(i(),a("span",J,t(e(d).column),1)):V("",!0)]),e($)==="pending"?(i(),a("div",O,t(s.$t("app.loading")),1)):e(g)?(i(),a("div",W,t(e(g).message),1)):e(d)?.logs?.length?(i(),a("div",j,[(i(!0),a(D,null,H(e(d).logs,(_,N)=>(i(),a("div",{key:N,class:S(["log-entry",`log-${_.level}`])},[n("span",G,t(k(_.timestamp)),1),n("span",K,t(_.level),1),n("span",M,t(_.message),1)],2))),128))])):(i(),a("div",Y,t(s.$t("terminal.noLogs")),1))]),n("div",P,[v(b,{to:`/issue/${e(l)}/history`,class:"btn-secondary"},{default:B(()=>[X(t(s.$t("nav.back")),1)]),_:1},8,["to"])])])}}}),os=A(Q,[["__scopeId","data-v-608b488c"]]);export{os as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as f}from"./
|
|
1
|
+
import{_ as f}from"./DCoyLE6i.js";import{d as x,u as y,v as h,c as n,e,f as v,w as D,t as o,h as t,F as p,q as r,b as i,g as _,k as u,_ as k}from"./CfX6M68B.js";const b={class:"docs-cli-page"},w={class:"docs-cli-header"},C={class:"docs-cli-subtitle"},A={class:"docs-cli-content"},j={class:"docs-cli-section"},P={class:"docs-cli-code-block"},N={class:"docs-cli-section"},E={class:"docs-cli-note"},L={class:"docs-cli-command-desc"},O={class:"docs-cli-syntax"},S={key:0,class:"docs-cli-options"},F={class:"docs-cli-options-table"},I={key:1,class:"docs-cli-examples"},T={class:"docs-cli-code-block"},U={class:"docs-cli-section"},V={class:"docs-cli-env-table"},z=x({__name:"cli",setup(B){const{t:s}=y();h({title:()=>s("docs.cli.title")+" | AutoCode"});const m=[{key:"server",commands:[{cmd:"serve",syntax:"autocode serve [options]",description:"serve",options:[{flag:"-p, --port <port>",desc:"portDesc"},{flag:"-e, --expose",desc:"exposeDesc"},{flag:"--debug",desc:"debugDesc"}],examples:["autocode","autocode serve -p 8080","autocode serve --expose"]},{cmd:"init",syntax:"autocode init",description:"init",options:[],examples:["autocode init"]}]},{key:"issues",commands:[{cmd:"new",syntax:"autocode new <title> [description]",description:"new",options:[{flag:"-p, --priority <P0-P3>",desc:"priorityDesc"},{flag:"-l, --labels <labels>",desc:"labelsDesc"},{flag:"-a, --acceptance <criteria>",desc:"acceptanceDesc"},{flag:"-c, --column <slug>",desc:"columnDesc"},{flag:"--parent <key>",desc:"parentDesc"}],examples:['autocode new "Fix login bug"','autocode new "Add feature" "Detailed description" -p P1']},{cmd:"new-child",syntax:"autocode new-child <parent-key> <title> [description]",description:"newChild",options:[{flag:"-p, --priority <P0-P3>",desc:"priorityDesc"},{flag:"-l, --labels <labels>",desc:"labelsDesc"},{flag:"-a, --acceptance <criteria>",desc:"acceptanceDesc"}],examples:['autocode new-child AC-000001 "Subtask title"','autocode new-child AC-000001 "Subtask" "Description" -p P2']},{cmd:"show",syntax:"autocode show <key>",description:"show",options:[{flag:"--json",desc:"jsonDesc"}],examples:["autocode show AC-000001","autocode show AC-000001 --json"]},{cmd:"list",syntax:"autocode list [options]",description:"list",options:[{flag:"-c, --column <slug>",desc:"filterColumnDesc"},{flag:"-p, --priority <P0-P3>",desc:"filterPriorityDesc"},{flag:"-l, --label <label>",desc:"filterLabelDesc"},{flag:"--parent <key>",desc:"filterParentDesc"},{flag:"--tree",desc:"treeDesc"},{flag:"--json",desc:"jsonDesc"}],examples:["autocode list","autocode list -c in-progress","autocode list --tree","autocode list -p P0 --json"]},{cmd:"history",syntax:"autocode history <key>",description:"history",options:[{flag:"--json",desc:"jsonFullDesc"},{flag:"--full",desc:"fullDesc"},{flag:"--limit <N>",desc:"limitDesc"}],examples:["autocode history AC-000001","autocode history AC-000001 --full --limit 5"]}]},{key:"workflow",commands:[{cmd:"start",syntax:"autocode start <key>",description:"start",options:[],examples:["autocode start AC-000001"]},{cmd:"next",syntax:"autocode next <key>",description:"next",options:[],examples:["autocode next AC-000001"]},{cmd:"move",syntax:"autocode move <key> <column>",description:"move",options:[{flag:"-f, --force",desc:"forceDesc"}],examples:["autocode move AC-000001 in-progress","autocode move AC-000001 done --force"]},{cmd:"comment",syntax:"autocode comment <key> <text>",description:"comment",options:[],examples:['autocode comment AC-000001 "Work in progress"']},{cmd:"parent",syntax:"autocode parent <key> [parent]",description:"parent",options:[],examples:["autocode parent AC-000002","autocode parent AC-000002 AC-000001","autocode parent AC-000002 --clear"]}]},{key:"monitoring",commands:[{cmd:"health",syntax:"autocode health",description:"health",options:[{flag:"--json",desc:"jsonDesc"},{flag:"-v, --verbose",desc:"verboseDesc"}],examples:["autocode health","autocode health -v"]},{cmd:"stats",syntax:"autocode stats",description:"stats",options:[{flag:"--json",desc:"jsonDesc"},{flag:"--session",desc:"sessionDesc"},{flag:"--totals",desc:"totalsDesc"}],examples:["autocode stats","autocode stats --session"]},{cmd:"columns",syntax:"autocode columns",description:"columns",options:[{flag:"--json",desc:"jsonDesc"}],examples:["autocode columns"]}]},{key:"pipeline",commands:[{cmd:"pipeline list",syntax:"autocode pipeline list",description:"pipelineList",options:[{flag:"--json",desc:"jsonDesc"}],examples:["autocode pipeline list"]},{cmd:"pipeline show",syntax:"autocode pipeline show <name>",description:"pipelineShow",options:[{flag:"--version <N>",desc:"versionDesc"},{flag:"--json",desc:"jsonDesc"}],examples:["autocode pipeline show default","autocode pipeline show default --version 2"]},{cmd:"pipeline create",syntax:"autocode pipeline create <name>",description:"pipelineCreate",options:[{flag:'--description "..."',desc:"pipelineDescDesc"}],examples:['autocode pipeline create sprint-workflow --description "Sprint-based flow"']},{cmd:"pipeline activate",syntax:"autocode pipeline activate <name>",description:"pipelineActivate",options:[{flag:"--version <N>",desc:"versionDesc"}],examples:["autocode pipeline activate default"]},{cmd:"pipeline draft",syntax:"autocode pipeline draft <name>",description:"pipelineDraft",options:[],examples:["autocode pipeline draft default"]},{cmd:"pipeline finalize",syntax:"autocode pipeline finalize <name>",description:"pipelineFinalize",options:[{flag:"--activate",desc:"activateDesc"}],examples:["autocode pipeline finalize default --activate"]},{cmd:"pipeline add-column",syntax:"autocode pipeline add-column <pipeline> <slug>",description:"pipelineAddColumn",options:[{flag:"--segment <segment>",desc:"segmentDesc"},{flag:"--position <N>",desc:"positionDesc"},{flag:'--name "..."',desc:"nameDesc"}],examples:["autocode pipeline add-column default review --segment action --position 2"]}]},{key:"catalog",commands:[{cmd:"catalog",syntax:"autocode catalog",description:"catalogList",options:[],examples:["autocode catalog"]},{cmd:"catalog add",syntax:"autocode catalog add <slug>",description:"catalogAdd",options:[{flag:"--segment <segment>",desc:"segmentDesc"},{flag:'--name "..."',desc:"nameDesc"}],examples:['autocode catalog add code-review --segment action --name "Code Review"']}]},{key:"maintenance",commands:[{cmd:"purge",syntax:"autocode purge",description:"purge",options:[{flag:"--force",desc:"forceConfirmDesc"}],examples:["autocode purge --force"]},{cmd:"help",syntax:"autocode help",description:"help",options:[],examples:["autocode help"]}]}];return(R,c)=>{const g=f;return i(),n("div",b,[e("div",w,[v(g,{to:"/",class:"docs-cli-back"},{default:D(()=>[c[0]||(c[0]=e("span",{class:"docs-cli-back-arrow"},"←",-1)),_(" "+o(t(s)("docs.cli.back")),1)]),_:1}),e("h1",null,o(t(s)("docs.cli.title")),1),e("p",C,o(t(s)("docs.cli.subtitle")),1)]),e("div",A,[e("section",j,[e("h2",null,o(t(s)("docs.cli.quickStart")),1),e("div",P,[e("pre",null,[e("code",null,"# "+o(t(s)("docs.cli.installGlobal"))+`
|
|
2
2
|
npm install -g @autocode-cli/autocode
|
|
3
3
|
|
|
4
4
|
# `+o(t(s)("docs.cli.initProject"))+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as me,aF as de,bd as fe,r as _,m as pe,n as K,o as xe,ar as be,j as M,b as k,w as p,f as v,g as U,e as y,c as W,h as t,F as G,q as L,D as he,s as q,t as T,k as P,A as ke,at as ge,ay as ye}from"./
|
|
1
|
+
import{d as me,aF as de,bd as fe,r as _,m as pe,n as K,o as xe,ar as be,j as M,b as k,w as p,f as v,g as U,e as y,c as W,h as t,F as G,q as L,D as he,s as q,t as T,k as P,A as ke,at as ge,ay as ye}from"./CfX6M68B.js";import{d as Ee,g as Ce,m as we,M as z,t as r,B as De,r as Q,T as Ie,av as _e,L as $e,k as je}from"./Bt9SJD2w.js";import{C as Me}from"./DQqeYRHW.js";import{m as Oe,g as Fe}from"./BJMGsUpo.js";import{_ as Ne,p as X}from"./DBbUUxUe.js";import{u as Se}from"./lUhfo_8K.js";import{x as Ve}from"./DeKcIehA.js";import{b as We}from"./CjwSiblu.js";import{M as ze,J as Be}from"./Drb7y3jx.js";import"./92s3wAHG.js";import"./BGp8YvuN.js";import"./DoMHqyvz.js";import"./DM-FWuh7.js";import"./BH_01oUJ.js";import"./OGWprgQz.js";import"./DOBYm3ey.js";import"./DsY01CVv.js";function Re(B,g){return{handleDragEnd:(m,c)=>{if(!m||!c)return;const{id:$,parentId:u}=m,{id:S,parentId:O,offset:V}=c;if(u!==O)return;const i=B.value.find(d=>d.uid===u);if(!i||!i["x-scalar-environments"])return;const x=i["x-scalar-environments"],f=Object.keys(x);({...x});const E=f.findIndex(d=>d===$);f.splice(E,1);const C=f.findIndex(d=>d===S)+(V===1?1:0);f.splice(C,0,$);const w=f.reduce((d,o)=>{const j=x[o];return j&&(d[o]=j),d},{});i["x-scalar-environments"]=w,g.edit(i.uid,"x-scalar-environments",i["x-scalar-environments"])},isDroppable:(m,c)=>m.parentId===c.parentId}}const Ae={class:"flex-1"},Je=["onClick"],Ke={class:"flex h-5 max-w-[14px] items-center justify-center"},rn=me({__name:"Environment",setup(B){const g=de(),m=fe(),{activeWorkspace:c,activeEnvironment:$,activeWorkspaceCollections:u,activeEnvVariables:S}=Ee(),{events:O,workspaceMutators:V,collectionMutators:i}=Ce(),{collapsedSidebarFolders:x,toggleSidebarFolder:f}=we(),E=z(),C=z(),w=z(),d=_(null),o=_("default"),j=_(""),D=_(void 0),b=_(void 0),F=_(void 0),{toast:R}=je(),Y=e=>JSON.parse(e);function A(e,a,n){e&&(a.uid===n?R(`Environment name already used in ${a.info?.title}`,"error"):R("Environment name already used in another collection","error"))}const I=pe(()=>u.value.filter(e=>e.info?.title!=="Drafts"));function Z(e){I.value.some(a=>{const n=Object.keys(a["x-scalar-environments"]||{}).includes(e.name);return A(n,a,e.collectionId),n})||(e.collectionId&&(i.addEnvironment(e.name,{variables:{},color:e.color},e.collectionId),x[e.collectionId]||f(e.collectionId),g.push({name:"environment.collection",params:{[r.Collection]:e.collectionId,[r.Environment]:e.name}})),C.hide())}function H(e){if(!$)return;const a=Y(e);if(o.value==="default")V.edit(c.value?.uid,"environments",a);else{const n=u.value.find(l=>l["x-scalar-environments"]?.[o.value??""]);if(n?.["x-scalar-environments"]?.[o.value??""]){const l=n["x-scalar-environments"][o.value??""];l&&(l.variables=a,i.edit(n.uid,"x-scalar-environments",n["x-scalar-environments"]))}}}const N=e=>{D.value=e,C.show()},ee=(e,a)=>{b.value=e,D.value=a,F.value=e,w.show()},ne=e=>{d.value=e,j.value=u.value.find(a=>a["x-scalar-environments"]?.[e])?.["x-scalar-environments"]?.[e]?.color??"",E.show()},ae=e=>{const a=d.value;typeof a=="string"&&(u.value.some(n=>n["x-scalar-environments"]?.[a])&&u.value.forEach(n=>{n["x-scalar-environments"]?.[a]&&(n["x-scalar-environments"][a].color=e,i.edit(n.uid,"x-scalar-environments",n["x-scalar-environments"]))}),E.hide())};function oe(e){I.value.forEach(n=>{i.removeEnvironment(e,n.uid)});const a=I.value.flatMap(n=>Object.keys(n["x-scalar-environments"]||{}));if(a.length>0){const n=a[a.length-1];if(!n)return;const l=u.value.find(s=>Object.keys(s["x-scalar-environments"]||{}).includes(n));o.value=n,g.push({name:"environment.collection",params:{[r.Collection]:l?.uid,[r.Environment]:n}}),l&&!x[l.uid]&&f(l.uid)}else o.value="default",g.push({name:"environment.default",params:{[r.Workspace]:c.value?.uid}})}const te=()=>o.value==="default"?"Global Environment":o.value,le=()=>o.value==="default"?JSON.stringify(c.value?.environments,null,2):JSON.stringify(u.value.find(e=>e["x-scalar-environments"]?.[o.value??""])?.["x-scalar-environments"]?.[o.value??""]?.variables,null,2),re=e=>x[e],J=e=>{e?.createNew&&m.name==="environment"&&N()};K(()=>[m.params[r.Collection],m.params[r.Environment]],([e,a])=>{e?o.value=a:o.value="default"}),xe(()=>{o.value=m.params[r.Environment]||"default",O.hotKeys.on(J);const e=m.params[r.Collection];e&&!x[e]&&f(e)}),be(()=>O.hotKeys.off(J));const se=(e,a,n)=>{const l=n?{name:"environment.collection",params:{[r.Workspace]:c.value?.uid,[r.Collection]:n,[r.Environment]:a}}:{name:"environment.default",params:{[r.Workspace]:c.value?.uid,[r.Environment]:a}};e.metaKey?window.open(g.resolve(l).href,"_blank"):g.push(l)};function ie(){b.value=void 0,D.value=void 0,F.value=void 0,w.hide()}function ce(e){I.value.some(a=>{const n=Object.keys(a["x-scalar-environments"]||{}).includes(e);return A(n,a,D.value),n})||(e&&b.value!=="default"&&u.value.forEach(a=>{if(a["x-scalar-environments"]?.[b.value??""]){const n=a["x-scalar-environments"],l={};Object.keys(n).forEach(s=>{const h=n[s];h&&(s===b.value?l[e]=h:l[s]=h)}),a["x-scalar-environments"]=l,i.edit(a.uid,"x-scalar-environments",a["x-scalar-environments"])}}),e&&o.value===b.value&&(o.value=e),b.value=void 0,D.value=void 0,F.value=void 0,w.hide())}const{handleDragEnd:ue,isDroppable:ve}=Re(u,i);return K(()=>m.query.openEnvironmentModal,e=>{e==="true"&&N()},{immediate:!0}),(e,a)=>(k(),M(Se,null,{default:p(()=>[v(Oe,{title:"Collections"},{content:p(()=>[y("div",Ae,[v(Ne,null,{default:p(()=>[(k(),M(X,{key:"default",class:"text-xs",isCopyable:!1,to:{name:"environment",params:{[t(r).Environment]:"default"}},type:"environment",variable:{name:"Global Environment",uid:"default",icon:"Globe",isDefault:!0}},null,8,["to"])),(k(!0),W(G,null,L(I.value,n=>(k(),W("li",{key:n.uid,class:"gap-1/2 flex flex-col"},[y("button",{class:"hover:bg-b-2 group flex w-full items-center gap-1.5 rounded p-1.5 text-left text-sm font-medium break-words",type:"button",onClick:l=>t(f)(n.uid)},[y("span",Ke,[v(t(De),{class:"text-sidebar-c-2 size-3.5 min-w-3.5 stroke-2 group-hover:hidden",src:n["x-scalar-icon"]||"interface-content-folder"},null,8,["src"]),y("div",{class:q({"rotate-90":t(x)[n.uid]})},[v(t(Q),{class:"text-c-3 hover:text-c-1 hidden text-sm group-hover:block",icon:"ChevronRight",size:"md"})],2)]),U(" "+T(n.info?.title??""),1)],8,Je),he(y("div",{class:q({"before:bg-border relative mb-[.5px] before:pointer-events-none before:absolute before:top-0 before:left-3 before:z-1 before:h-[calc(100%_+_.5px)] before:w-[.5px] last:mb-0 last:before:h-full":Object.keys(n["x-scalar-environments"]||{}).length>0})},[(k(!0),W(G,null,L(n["x-scalar-environments"],(l,s)=>(k(),M(X,{key:s,class:"text-xs",collectionId:n.uid,isCopyable:!1,isDeletable:!0,isRenameable:!0,isDraggable:!0,isDroppable:t(ve),to:{name:"environment.collection",params:{[t(r).Collection]:n.uid,[t(r).Environment]:s}},type:"environment",variable:{name:s,uid:s,color:l.color??"#FFFFFF",isDefault:!1},warningMessage:"Are you sure you want to delete this environment?",onClick:ke(h=>se(h,s,n.uid),["prevent"]),onColorModal:h=>ne(s),onDelete:h=>oe(s),onRename:h=>ee(s,n.uid),onOnDragEnd:t(ue)},null,8,["collectionId","isDroppable","to","variable","onClick","onColorModal","onDelete","onRename","onOnDragEnd"]))),128)),Object.keys(n["x-scalar-environments"]||{}).length===0?(k(),M(t(Ie),{key:0,class:"text-c-1 hover:bg-b-2 flex h-8 w-full justify-start gap-1.5 py-0 pl-6 text-xs",variant:"ghost",onClick:l=>N(n.uid)},{default:p(()=>[v(t(Q),{icon:"Add",size:"sm"}),a[2]||(a[2]=y("span",null,"Add Environment",-1))]),_:1},8,["onClick"])):P("",!0)],2),[[ge,re(n.uid)]])]))),128))]),_:1})])]),button:p(()=>[v(Fe,{click:N,hotkey:"N"},{title:p(()=>[...a[3]||(a[3]=[U(" Add Environment ",-1)])]),_:1})]),_:1}),v(Ve,{class:"flex-1"},{default:p(()=>[v(We,null,ye({default:p(()=>[o.value&&t(c)?(k(),M(_e,{key:0,class:"py-2 pr-2 pl-px md:px-4",envVariables:t(S),environment:t($),language:"json",lineNumbers:"",lint:"",modelValue:le(),workspace:t(c),"onUpdate:modelValue":H},null,8,["envVariables","environment","modelValue","workspace"])):P("",!0)]),_:2},[o.value?{name:"title",fn:p(()=>[y("span",null,T(te()),1)]),key:"0"}:void 0]),1024)]),_:1}),v(ze,{selectedColor:j.value,state:t(E),onCancel:a[0]||(a[0]=n=>t(E).hide()),onSubmit:ae},null,8,["selectedColor","state"]),v(Be,{activeWorkspaceCollections:I.value,collectionId:D.value,state:t(C),onCancel:a[1]||(a[1]=n=>t(C).hide()),onSubmit:Z},null,8,["activeWorkspaceCollections","collectionId","state"]),v(t($e),{size:"xxs",state:t(w),title:`Edit ${b.value}`},{default:p(()=>[v(Me,{name:F.value??"",onClose:ie,onEdit:ce},null,8,["name"])]),_:1},8,["state","title"])]),_:1}))}});export{rn as default};
|