UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 4.63 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./users.store-legacy-azRUgFdP.js","./constants-legacy-2_ytuuS3.js","./useRootStore-legacy-CC08el-l.js","./settings.store-legacy-I6rZOvfF.js"],(function(e,t){var a,n,i,s,o,c,l,d,r,u,f,b,y,p,v,x,w,m,C,T,D,g,h,A,j,S;return{setters:[function(e){a=e.Ft,n=e.S},function(e){i=e.Ai,s=e.Ci,o=e.Di,c=e.Ei,l=e.Mi,d=e.Ni,r=e.Oi,u=e.Si,f=e.Ti,b=e.ai,y=e.bi,p=e.ji,v=e.ki,x=e.si,w=e.vi,m=e.wi,C=e.xi,T=e.yi},function(e){D=e.Bo,g=e.Dr},function(e){h=e.T,A=e.t},function(e){j=e.t}],execute:function(){try{t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(I=(new t.Error).stack)&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[I]="bcc3b220-4e5e-4d4e-9d98-974ddcb0c46c",t._sentryDebugIdIdentifier="sentry-dbid-bcc3b220-4e5e-4d4e-9d98-974ddcb0c46c")}catch(t){}var t,I;e("n",S=(e,t,a)=>e.map((e=>e.index===t?{...e,index:a}:t<a&&e.index>t&&e.index<=a?{...e,index:e.index-1}:t>a&&e.index>=a&&e.index<t?{...e,index:e.index+1}:e))),e("t",h(g,(()=>{const e=A(),t=b(),g=j(),h=a([]),I=a(0),R=a(0),k=a("ok"),E=a({}),z=n((()=>D(t.currentProject?.scopes??t.personalProject?.scopes))),B=e=>Number((e/1024/1024).toFixed(2)),L=n((()=>Math.floor(g.settings?.dataTables?.maxSize/1024/1024))),O=n((()=>{const e={};for(const[t,a]of Object.entries(E.value))e[t]=B(a);return e})),_=n((()=>x(["rbac"],{rbac:{scope:"dataTable:list"}}))),F=async(t,a)=>{const n=await f(e.restApiContext,a,void 0,{projectId:a,id:t});return n.data.length>0?(h.value=n.data,n.data[0]):null};return{dataTables:h,totalCount:I,fetchDataTables:async(t,a,n,i,s)=>{const o=await f(e.restApiContext,t,{skip:(a-1)*n,take:n},i,s);h.value=o.data,I.value=o.count},fetchDataTableSize:async()=>{const t=await m(e.restApiContext);R.value=B(t.totalBytes),k.value=t.quotaStatus;const a={};for(const[e,n]of Object.entries(t.dataTables))a[e]=n.sizeBytes;return E.value=a,t},dataTableSize:n((()=>R.value)),dataTableSizeLimitState:n((()=>k.value)),dataTableSizes:O,maxSizeMB:L,createDataTable:async(a,n,i,s,o=!0)=>{const c=await T(e.restApiContext,a,n,i,s,o);if(!c.project&&n){const e=await t.fetchProject(n);e&&(c.project=e)}return h.value.push(c),I.value+=1,c},uploadCsvFile:async(t,a=!0)=>await d(e.restApiContext,t,a),importCsvToDataTable:async(t,a,n)=>await o(e.restApiContext,t,a,n),deleteDataTable:async(t,a)=>{const n=await y(e.restApiContext,t,a);return n&&(h.value=h.value.filter((e=>e.id!==t)),I.value-=1),n},updateDataTable:async(t,a,n)=>{const i=await p(e.restApiContext,t,a,n);if(i){const e=h.value.findIndex((e=>e.id===t));-1!==e&&(h.value[e]={...h.value[e],name:a})}return i},fetchDataTableDetails:F,fetchOrFindDataTable:async(e,t)=>{const a=h.value.find((t=>t.id===e));return a||await F(e,t)},addDataTableColumn:async(t,a,n)=>{const i=await w(e.restApiContext,t,a,n);if(i){const e=h.value.findIndex((e=>e.id===t));-1!==e&&h.value[e].columns.push(i)}return i},deleteDataTableColumn:async(t,a,n)=>{const i=await C(e.restApiContext,t,a,n);if(i){const e=h.value.findIndex((e=>e.id===t));-1!==e&&(h.value[e].columns=h.value[e].columns.filter((e=>e.id!==n)))}return i},moveDataTableColumn:async(t,a,n,i)=>{const s=await v(e.restApiContext,t,a,n,i);if(s){const e=h.value.findIndex((e=>e.id===t)),a=h.value[e].columns.findIndex((e=>e.id===n));h.value[e].columns=S(h.value[e].columns,a,i)}return s},renameDataTableColumn:async(t,a,n,s)=>{await i(e.restApiContext,t,a,n,s);const o=h.value.findIndex((e=>e.id===t));if(-1===o)return;const c=h.value[o].columns.find((e=>e.id===n));c&&(c.name=s)},fetchDataTableContent:async(t,a,n,i,s,o,l)=>await c(e.restApiContext,t,a,{skip:(n-1)*i,take:i,sortBy:s,filter:o,search:l}),insertEmptyRow:async(t,a)=>(await r(e.restApiContext,t,{},a))[0],updateRow:async(t,a,n,i)=>await l(e.restApiContext,t,n,i,a),deleteRows:async(t,a,n)=>await u(e.restApiContext,t,n,a),downloadDataTableCsv:async(t,a,n=!0)=>{const{csvContent:i,filename:o}=await s(e.restApiContext,t,a,n);((e,t)=>{const a=URL.createObjectURL(e),n=document.createElement("a");n.href=a,n.download=t,n.style.display="none",document.body.appendChild(n);try{n.click()}finally{document.body.contains(n)&&document.body.removeChild(n),URL.revokeObjectURL(a)}})((e=>new Blob(["\ufeff"+e],{type:"text/csv;charset=utf-8;"}))(i),o)},projectPermissions:z,canViewDataTables:_}})))}}})); //# sourceMappingURL=dataTable.store-legacy-CrFQcdTs.js.map