@budibase/server 2.5.6-alpha.22 → 2.5.6-alpha.24
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/builder/assets/{index.34394b18.js → index.919ee825.js} +1 -1
- package/builder/index.html +1 -1
- package/dist/api/controllers/application.js +2 -3
- package/dist/api/controllers/dev.js +1 -1
- package/dist/api/controllers/row/ExternalRequest.js +21 -14
- package/dist/api/index.js +1 -2
- package/dist/integrations/base/sqlTable.js +9 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/rowProcessor/utils.js +4 -5
- package/package.json +7 -7
- package/src/api/controllers/application.ts +3 -3
- package/src/api/controllers/dev.ts +2 -2
- package/src/api/controllers/row/ExternalRequest.ts +21 -12
- package/src/api/index.ts +2 -3
- package/src/integration-test/postgres.spec.ts +2 -0
- package/src/integrations/base/sqlTable.ts +9 -2
- package/src/utilities/rowProcessor/utils.ts +9 -10
- package/tsconfig.build.json +3 -5
- package/tsconfig.json +2 -1
- package/dist/package.json +0 -180
|
@@ -916,7 +916,7 @@ Use Save As... to download, then click back to return to this page.`)&&(location
|
|
|
916
916
|
`),t=U("i"),i=Z(r),a=Z("?"),o=Z(`
|
|
917
917
|
This action cannot be undone.`)},m(l,s){w(l,e,s),w(l,t,s),H(t,i),H(t,a),w(l,o,s)},p(l,s){s&1&&r!==(r=l[0].name+"")&&Qe(i,r)},d(l){l&&$(e),l&&$(t),l&&$(o)}}}function Vyt(n){let e,t,r,i,a,o;e=new Es({props:{$$slots:{control:[Pyt],default:[Hyt]},$$scope:{ctx:n}}});let l={okText:"Delete Automation",onOk:n[3],title:"Confirm Deletion",$$slots:{default:[Ryt]},$$scope:{ctx:n}};r=new no({props:l}),n[5](r);let s={automation:n[0]};return a=new Oyt({props:s}),n[6](a),{c(){L(e.$$.fragment),t=P(),L(r.$$.fragment),i=P(),L(a.$$.fragment)},m(u,c){C(e,u,c),w(u,t,c),C(r,u,c),w(u,i,c),C(a,u,c),o=!0},p(u,[c]){const f={};c&134&&(f.$$scope={dirty:c,ctx:u}),e.$set(f);const d={};c&129&&(d.$$scope={dirty:c,ctx:u}),r.$set(d);const p={};c&1&&(p.automation=u[0]),a.$set(p)},i(u){o||(h(e.$$.fragment,u),h(r.$$.fragment,u),h(a.$$.fragment,u),o=!0)},o(u){_(e.$$.fragment,u),_(r.$$.fragment,u),_(a.$$.fragment,u),o=!1},d(u){E(e,u),u&&$(t),n[5](null),E(r,u),u&&$(i),n[6](null),E(a,u)}}}function Nyt(n,e,t){let{automation:r}=e,i,a;async function o(){try{await $r.actions.delete(r),ct.success("Automation deleted successfully")}catch{ct.error("Error deleting automation")}}async function l(){try{await $r.actions.duplicate(r),ct.success("Automation has been duplicated successfully")}catch{ct.error("Error duplicating automation")}}function s(c){Me[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Me[c?"unshift":"push"](()=>{a=c,t(2,a)})}return n.$$set=c=>{"automation"in c&&t(0,r=c.automation)},[r,i,a,o,l,s,u]}class Fyt extends ze{constructor(e){super(),Ae(this,e,Nyt,Vyt,we,{automation:0})}}function FX(n,e,t){const r=n.slice();return r[5]=e[t],r[7]=t,r}function Uyt(n){let e,t,r;return e=new Fyt({props:{automation:n[5]}}),{c(){L(e.$$.fragment),t=P()},m(i,a){C(e,i,a),w(i,t,a),r=!0},p(i,a){const o={};a&2&&(o.automation=i[5]),e.$set(o)},i(i){r||(h(e.$$.fragment,i),r=!0)},o(i){_(e.$$.fragment,i),r=!1},d(i){E(e,i),i&&$(t)}}}function UX(n){let e,t;function r(){return n[4](n[5])}return e=new vp({props:{border:n[7]>0,icon:"ShareAndroid",text:n[5].name,selected:n[5]._id===n[0],$$slots:{default:[Uyt]},$$scope:{ctx:n}}}),e.$on("click",r),{c(){L(e.$$.fragment)},m(i,a){C(e,i,a),t=!0},p(i,a){n=i;const o={};a&2&&(o.text=n[5].name),a&3&&(o.selected=n[5]._id===n[0]),a&258&&(o.$$scope={dirty:a,ctx:n}),e.$set(o)},i(i){t||(h(e.$$.fragment,i),t=!0)},o(i){_(e.$$.fragment,i),t=!1},d(i){E(e,i)}}}function jyt(n){let e,t,r=n[1].automations.sort(jX),i=[];for(let o=0;o<r.length;o+=1)i[o]=UX(FX(n,r,o));const a=o=>_(i[o],1,1,()=>{i[o]=null});return{c(){e=U("div");for(let o=0;o<i.length;o+=1)i[o].c();S(e,"class","automations-list svelte-1u2luni")},m(o,l){w(o,e,l);for(let s=0;s<i.length;s+=1)i[s]&&i[s].m(e,null);t=!0},p(o,[l]){if(l&7){r=o[1].automations.sort(jX);let s;for(s=0;s<r.length;s+=1){const u=FX(o,r,s);i[s]?(i[s].p(u,l),h(i[s],1)):(i[s]=UX(u),i[s].c(),h(i[s],1),i[s].m(e,null))}for(fe(),s=r.length;s<i.length;s+=1)a(s);de()}},i(o){if(!t){for(let l=0;l<r.length;l+=1)h(i[l]);t=!0}},o(o){i=i.filter(Boolean);for(let l=0;l<i.length;l+=1)_(i[l]);t=!1},d(o){o&&$(e),an(i,o)}}}const jX=n=>n.name;function qyt(n,e,t){let r,i,a;me(n,yc,s=>t(3,i=s)),me(n,$r,s=>t(1,a=s)),vn(async()=>{try{await $r.actions.fetch()}catch{ct.error("Error getting automations list")}});function o(s){$r.actions.select(s)}const l=s=>o(s._id);return n.$$.update=()=>{n.$$.dirty&8&&t(0,r=i==null?void 0:i._id)},[r,a,o,i,l]}class Wyt extends ze{constructor(e){super(),Ae(this,e,qyt,jyt,we,{})}}function qX(n,e,t){const r=n.slice();return r[14]=e[t][0],r[15]=e[t][1],r}function Gyt(n){let e,t,r;return{c(){e=Z("Please name your automation, then select a trigger."),t=U("br"),r=Z(`
|
|
918
918
|
Every automation must start with a trigger.`)},m(i,a){w(i,e,a),w(i,t,a),w(i,r,a)},p:Ke,d(i){i&&$(e),i&&$(t),i&&$(r)}}}function Yyt(n){let e;return{c(){e=Z("Trigger")},m(t,r){w(t,e,r)},d(t){t&&$(e)}}}function Kyt(n){let e=n[15].name+"",t;return{c(){t=Z(e)},m(r,i){w(r,t,i)},p(r,i){i&8&&e!==(e=r[15].name+"")&&Qe(t,e)},d(r){r&&$(t)}}}function WX(n){let e,t,r,i,a,o,l,s,u,c;r=new Gt({props:{name:n[15].icon}}),o=new Bt({props:{size:"S",$$slots:{default:[Kyt]},$$scope:{ctx:n}}});function f(){return n[12](n[15])}return{c(){e=U("div"),t=U("div"),L(r.$$.fragment),i=P(),a=U("span"),L(o.$$.fragment),l=P(),S(a,"class","icon-spacing svelte-1735451"),S(t,"class","item-body svelte-1735451"),S(e,"class","item svelte-1735451"),ve(e,"selected",n[2]===n[15].name)},m(d,p){w(d,e,p),H(e,t),C(r,t,null),H(t,i),H(t,a),C(o,a,null),H(e,l),s=!0,u||(c=at(e,"click",f),u=!0)},p(d,p){n=d;const m={};p&8&&(m.name=n[15].icon),r.$set(m);const g={};p&262152&&(g.$$scope={dirty:p,ctx:n}),o.$set(g),(!s||p&12)&&ve(e,"selected",n[2]===n[15].name)},i(d){s||(h(r.$$.fragment,d),h(o.$$.fragment,d),s=!0)},o(d){_(r.$$.fragment,d),_(o.$$.fragment,d),s=!1},d(d){d&&$(e),E(r),E(o),u=!1,c()}}}function Xyt(n){let e,t,r,i;e=new Wt({props:{size:"S",$$slots:{default:[Yyt]},$$scope:{ctx:n}}});let a=n[3],o=[];for(let s=0;s<a.length;s+=1)o[s]=WX(qX(n,a,s));const l=s=>_(o[s],1,1,()=>{o[s]=null});return{c(){L(e.$$.fragment),t=P(),r=U("div");for(let s=0;s<o.length;s+=1)o[s].c();S(r,"class","item-list svelte-1735451")},m(s,u){C(e,s,u),w(s,t,u),w(s,r,u);for(let c=0;c<o.length;c+=1)o[c]&&o[c].m(r,null);i=!0},p(s,u){const c={};if(u&262144&&(c.$$scope={dirty:u,ctx:s}),e.$set(c),u&76){a=s[3];let f;for(f=0;f<a.length;f+=1){const d=qX(s,a,f);o[f]?(o[f].p(d,u),h(o[f],1)):(o[f]=WX(d),o[f].c(),h(o[f],1),o[f].m(r,null))}for(fe(),f=a.length;f<o.length;f+=1)l(f);de()}},i(s){if(!i){h(e.$$.fragment,s);for(let u=0;u<a.length;u+=1)h(o[u]);i=!0}},o(s){_(e.$$.fragment,s),o=o.filter(Boolean);for(let u=0;u<o.length;u+=1)_(o[u]);i=!1},d(s){E(e,s),s&&$(t),s&&$(r),an(o,s)}}}function Jyt(n){let e,t,r,i,a,o,l,s,u,c;e=new g6({props:{header:"You must publish your app to activate your automations.",message:"To test your automation before publishing, you can use the 'Run Test' functionality on the next screen."}}),r=new Bt({props:{size:"S",$$slots:{default:[Gyt]},$$scope:{ctx:n}}});function f(m){n[9](m)}function d(m){n[10](m)}let p={label:"Name"};return n[0]!==void 0&&(p.value=n[0]),n[4]!==void 0&&(p.error=n[4]),a=new gn({props:p}),Me.push(()=>je(a,"value",f)),Me.push(()=>je(a,"error",d)),a.$on("input",n[11]),u=new Ct({props:{noPadding:!0,gap:"XS",$$slots:{default:[Xyt]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment),t=P(),L(r.$$.fragment),i=P(),L(a.$$.fragment),s=P(),L(u.$$.fragment)},m(m,g){C(e,m,g),w(m,t,g),C(r,m,g),w(m,i,g),C(a,m,g),w(m,s,g),C(u,m,g),c=!0},p(m,g){const v={};g&262144&&(v.$$scope={dirty:g,ctx:m}),r.$set(v);const y={};!o&&g&1&&(o=!0,y.value=m[0],We(()=>o=!1)),!l&&g&16&&(l=!0,y.error=m[4],We(()=>l=!1)),a.$set(y);const k={};g&262156&&(k.$$scope={dirty:g,ctx:m}),u.$set(k)},i(m){c||(h(e.$$.fragment,m),h(r.$$.fragment,m),h(a.$$.fragment,m),h(u.$$.fragment,m),c=!0)},o(m){_(e.$$.fragment,m),_(r.$$.fragment,m),_(a.$$.fragment,m),_(u.$$.fragment,m),c=!1},d(m){E(e,m),m&&$(t),E(r,m),m&&$(i),E(a,m),m&&$(s),E(u,m)}}}function Qyt(n){let e,t;return e=new tr({props:{title:"Create Automation",confirmText:"Save",size:"M",onConfirm:n[5],disabled:!n[2]||!n[0],$$slots:{default:[Jyt]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,[i]){const a={};i&5&&(a.disabled=!r[2]||!r[0]),i&262175&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function Zyt(n,e,t){let r,i,a;me(n,$r,y=>t(8,a=y));let{webhookModal:o}=e,l,s,u=!1,c;async function f(){try{const y=$r.actions.constructBlock("TRIGGER",c.stepId,c);await $r.actions.create(l,y),c.stepId===a6.WEBHOOK&&o.show(),ct.success(`Automation ${l} created`)}catch{ct.error("Error creating automation")}}const d=y=>{c=y,t(2,s=y.name)};function p(y){l=y,t(0,l)}function m(y){r=y,t(4,r),t(1,u),t(0,l)}const g=()=>t(1,u=!0),v=y=>d(y);return n.$$set=y=>{"webhookModal"in y&&t(7,o=y.webhookModal)},n.$$.update=()=>{n.$$.dirty&3&&t(4,r=u&&!l?"Please specify a name for the automation.":null),n.$$.dirty&256&&t(3,i=Object.entries(a.blockDefinitions.TRIGGER))},[l,u,s,i,r,f,d,o,a,p,m,g,v]}class Fse extends ze{constructor(e){super(),Ae(this,e,Zyt,Qyt,we,{webhookModal:7})}}function xyt(n){let e;return{c(){e=Z("Add automation")},m(t,r){w(t,e,r)},d(t){t&&$(e)}}}function e$t(n){let e,t,r,i;return e=new nn({props:{cta:!0,$$slots:{default:[xyt]},$$scope:{ctx:n}}}),e.$on("click",function(){en(n[0].show)&&n[0].show.apply(this,arguments)}),r=new Wyt({}),{c(){L(e.$$.fragment),t=P(),L(r.$$.fragment)},m(a,o){C(e,a,o),w(a,t,o),C(r,a,o),i=!0},p(a,o){n=a;const l={};o&8&&(l.$$scope={dirty:o,ctx:n}),e.$set(l)},i(a){i||(h(e.$$.fragment,a),h(r.$$.fragment,a),i=!0)},o(a){_(e.$$.fragment,a),_(r.$$.fragment,a),i=!1},d(a){E(e,a),a&&$(t),E(r,a)}}}function t$t(n){let e,t;return e=new Ct({props:{paddingX:"L",paddingY:"XL",gap:"S",$$slots:{default:[e$t]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){const a={};i&9&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function n$t(n){let e,t;return e=new Fse({props:{webhookModal:n[1]}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){const a={};i&2&&(a.webhookModal=r[1]),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function r$t(n){let e,t,r,i;e=new Lc({props:{title:"Automations",borderRight:!0,$$slots:{default:[t$t]},$$scope:{ctx:n}}});let a={$$slots:{default:[n$t]},$$scope:{ctx:n}};return r=new Pn({props:a}),n[2](r),{c(){L(e.$$.fragment),t=P(),L(r.$$.fragment)},m(o,l){C(e,o,l),w(o,t,l),C(r,o,l),i=!0},p(o,[l]){const s={};l&9&&(s.$$scope={dirty:l,ctx:o}),e.$set(s);const u={};l&10&&(u.$$scope={dirty:l,ctx:o}),r.$set(u)},i(o){i||(h(e.$$.fragment,o),h(r.$$.fragment,o),i=!0)},o(o){_(e.$$.fragment,o),_(r.$$.fragment,o),i=!1},d(o){E(e,o),o&&$(t),n[2](null),E(r,o)}}}function i$t(n,e,t){let{modal:r}=e,{webhookModal:i}=e;function a(o){Me[o?"unshift":"push"](()=>{r=o,t(0,r)})}return n.$$set=o=>{"modal"in o&&t(0,r=o.modal),"webhookModal"in o&&t(1,i=o.webhookModal)},[r,i,a]}class a$t extends ze{constructor(e){super(),Ae(this,e,i$t,r$t,we,{modal:0,webhookModal:1})}}function GX(n,e,t){const r=n.slice();return r[8]=e[t],r[10]=t,r}function YX(n){var l;let e,t,r,i;function a(){return n[6](n[8])}e=new Nse({props:{open:!!n[3][n[8].id],isTrigger:n[10]===0,testResult:(l=n[2])==null?void 0:l[n[10]],showTestStatus:!0,block:n[8],idx:n[10]}}),e.$on("toggle",a);let o=n[3][n[8].id]&&KX(n);return{c(){L(e.$$.fragment),t=P(),o&&o.c(),r=lt()},m(s,u){C(e,s,u),w(s,t,u),o&&o.m(s,u),w(s,r,u),i=!0},p(s,u){var f;n=s;const c={};u&10&&(c.open=!!n[3][n[8].id]),u&4&&(c.testResult=(f=n[2])==null?void 0:f[n[10]]),u&2&&(c.block=n[8]),e.$set(c),n[3][n[8].id]?o?(o.p(n,u),u&10&&h(o,1)):(o=KX(n),o.c(),h(o,1),o.m(r.parentNode,r)):o&&(fe(),_(o,1,1,()=>{o=null}),de())},i(s){i||(h(e.$$.fragment,s),h(o),i=!0)},o(s){_(e.$$.fragment,s),_(o),i=!1},d(s){E(e,s),s&&$(t),o&&o.d(s),s&&$(r)}}}function KX(n){var s,u,c;let e,t,r,i,a,o;e=new Sr({props:{noMargin:!0}});let l=((c=(u=(s=n[2])==null?void 0:s[n[10]])==null?void 0:u.outputs)==null?void 0:c.iterations)&&XX(n);return a=new If({props:{noHorizPadding:!0,selected:"Input",$$slots:{default:[u$t]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment),t=P(),l&&l.c(),r=P(),i=U("div"),L(a.$$.fragment),S(i,"class","tabs svelte-17o92k4")},m(f,d){C(e,f,d),w(f,t,d),l&&l.m(f,d),w(f,r,d),w(f,i,d),C(a,i,null),o=!0},p(f,d){var m,g,v;(v=(g=(m=f[2])==null?void 0:m[f[10]])==null?void 0:g.outputs)!=null&&v.iterations?l?(l.p(f,d),d&4&&h(l,1)):(l=XX(f),l.c(),h(l,1),l.m(r.parentNode,r)):l&&(fe(),_(l,1,1,()=>{l=null}),de());const p={};d&2052&&(p.$$scope={dirty:d,ctx:f}),a.$set(p)},i(f){o||(h(e.$$.fragment,f),h(l),h(a.$$.fragment,f),o=!0)},o(f){_(e.$$.fragment,f),_(l),_(a.$$.fragment,f),o=!1},d(f){E(e,f),f&&$(t),l&&l.d(f),f&&$(r),f&&$(i),E(a)}}}function XX(n){let e,t,r,i,a,o;return t=new Gt({props:{name:"Reuse"}}),a=new Wt({props:{$$slots:{default:[o$t]},$$scope:{ctx:n}}}),{c(){e=U("div"),L(t.$$.fragment),r=P(),i=U("div"),L(a.$$.fragment),Zt(i,"margin-left","10px"),Zt(e,"display","flex"),Zt(e,"padding","10px 10px 0px 12px")},m(l,s){w(l,e,s),C(t,e,null),H(e,r),H(e,i),C(a,i,null),o=!0},p(l,s){const u={};s&2052&&(u.$$scope={dirty:s,ctx:l}),a.$set(u)},i(l){o||(h(t.$$.fragment,l),h(a.$$.fragment,l),o=!0)},o(l){_(t.$$.fragment,l),_(a.$$.fragment,l),o=!1},d(l){l&&$(e),E(t),E(a)}}}function o$t(n){var a,o;let e,t=((o=(a=n[2])==null?void 0:a[n[10]])==null?void 0:o.outputs.iterations)+"",r,i;return{c(){e=Z("This loop ran "),r=Z(t),i=Z(" times.")},m(l,s){w(l,e,s),w(l,r,s),w(l,i,s)},p(l,s){var u,c;s&4&&t!==(t=((c=(u=l[2])==null?void 0:u[l[10]])==null?void 0:c.outputs.iterations)+"")&&Qe(r,t)},d(l){l&&$(e),l&&$(r),l&&$(i)}}}function l$t(n){var r,i;let e,t;return e=new Df({props:{minHeight:"160px",disabled:!0,value:db((i=(r=n[2])==null?void 0:r[n[10]])==null?void 0:i.inputs,"No input")}}),{c(){L(e.$$.fragment)},m(a,o){C(e,a,o),t=!0},p(a,o){var s,u;const l={};o&4&&(l.value=db((u=(s=a[2])==null?void 0:s[a[10]])==null?void 0:u.inputs,"No input")),e.$set(l)},i(a){t||(h(e.$$.fragment,a),t=!0)},o(a){_(e.$$.fragment,a),t=!1},d(a){E(e,a)}}}function s$t(n){var r,i;let e,t;return e=new Df({props:{minHeight:"160px",disabled:!0,value:db((i=(r=n[2])==null?void 0:r[n[10]])==null?void 0:i.outputs,"No output")}}),{c(){L(e.$$.fragment)},m(a,o){C(e,a,o),t=!0},p(a,o){var s,u;const l={};o&4&&(l.value=db((u=(s=a[2])==null?void 0:s[a[10]])==null?void 0:u.outputs,"No output")),e.$set(l)},i(a){t||(h(e.$$.fragment,a),t=!0)},o(a){_(e.$$.fragment,a),t=!1},d(a){E(e,a)}}}function u$t(n){let e,t,r,i;return e=new ia({props:{title:"Input",$$slots:{default:[l$t]},$$scope:{ctx:n}}}),r=new ia({props:{title:"Output",$$slots:{default:[s$t]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment),t=P(),L(r.$$.fragment)},m(a,o){C(e,a,o),w(a,t,o),C(r,a,o),i=!0},p(a,o){const l={};o&2052&&(l.$$scope={dirty:o,ctx:a}),e.$set(l);const s={};o&2052&&(s.$$scope={dirty:o,ctx:a}),r.$set(s)},i(a){i||(h(e.$$.fragment,a),h(r.$$.fragment,a),i=!0)},o(a){_(e.$$.fragment,a),_(r.$$.fragment,a),i=!1},d(a){E(e,a),a&&$(t),E(r,a)}}}function JX(n){let e;return{c(){e=U("div"),S(e,"class","separator svelte-17o92k4")},m(t,r){w(t,e,r)},d(t){t&&$(e)}}}function QX(n){let e,t,r,i,a,o=n[8].stepId!==P2.LOOP&&YX(n),l=n[1].length-1!==n[10]&&JX();return{c(){e=U("div"),o&&o.c(),r=P(),l&&l.c(),i=lt(),S(e,"class","block svelte-17o92k4"),S(e,"style",t=n[0]?`width: ${n[0]}`:"")},m(s,u){w(s,e,u),o&&o.m(e,null),w(s,r,u),l&&l.m(s,u),w(s,i,u),a=!0},p(s,u){s[8].stepId!==P2.LOOP?o?(o.p(s,u),u&2&&h(o,1)):(o=YX(s),o.c(),h(o,1),o.m(e,null)):o&&(fe(),_(o,1,1,()=>{o=null}),de()),(!a||u&1&&t!==(t=s[0]?`width: ${s[0]}`:""))&&S(e,"style",t),s[1].length-1!==s[10]?l||(l=JX(),l.c(),l.m(i.parentNode,i)):l&&(l.d(1),l=null)},i(s){a||(h(o),a=!0)},o(s){_(o),a=!1},d(s){s&&$(e),o&&o.d(),s&&$(r),l&&l.d(s),s&&$(i)}}}function c$t(n){let e,t,r=n[1],i=[];for(let o=0;o<r.length;o+=1)i[o]=QX(GX(n,r,o));const a=o=>_(i[o],1,1,()=>{i[o]=null});return{c(){e=U("div");for(let o=0;o<i.length;o+=1)i[o].c();S(e,"class","container svelte-17o92k4")},m(o,l){w(o,e,l);for(let s=0;s<i.length;s+=1)i[s]&&i[s].m(e,null);t=!0},p(o,[l]){if(l&15){r=o[1];let s;for(s=0;s<r.length;s+=1){const u=GX(o,r,s);i[s]?(i[s].p(u,l),h(i[s],1)):(i[s]=QX(u),i[s].c(),h(i[s],1),i[s].m(e,null))}for(fe(),s=r.length;s<i.length;s+=1)a(s);de()}},i(o){if(!t){for(let l=0;l<r.length;l+=1)h(i[l]);t=!0}},o(o){i=i.filter(Boolean);for(let l=0;l<i.length;l+=1)_(i[l]);t=!1},d(o){o&&$(e),an(i,o)}}}function db(n,e){return n?JSON.stringify(n,null,2):e}function f$t(n,e,t){let r,{automation:i}=e,{testResults:a}=e,{width:o="400px"}=e,l={},s;function u(f){return f==null?void 0:f.steps.filter(d=>d.stepId!==P2.LOOP||[])}const c=f=>t(3,l[f.id]=!l[f.id],l);return n.$$set=f=>{"automation"in f&&t(4,i=f.automation),"testResults"in f&&t(5,a=f.testResults),"width"in f&&t(0,o=f.width)},n.$$.update=()=>{if(n.$$.dirty&32&&t(2,r=u(a)),n.$$.dirty&22){if(t(1,s=[]),i)i.definition.trigger&&s.push(i.definition.trigger),t(1,s=s.concat(i.definition.steps||[]).filter(f=>f.stepId!==P2.LOOP));else if(r){t(1,s=r||[]);let f=0;for(let d of s)d.id=f++}}},[o,s,r,l,i,a,c]}class Use extends ze{constructor(e){super(),Ae(this,e,f$t,c$t,we,{automation:4,testResults:5,width:0})}}function d$t(n){let e,t,r,i,a,o,l,s,u,c,f,d,p;return r=new Gt({props:{name:"MultipleCheck"}}),s=new Gt({props:{hoverable:!0,name:"Close"}}),s.$on("click",n[2]),c=new Sr({}),d=new Use({props:{automation:n[0],testResults:n[1].testResults}}),{c(){e=U("div"),t=U("div"),L(r.$$.fragment),i=P(),a=U("div"),a.textContent="Test Details",o=P(),l=U("div"),L(s.$$.fragment),u=P(),L(c.$$.fragment),f=P(),L(d.$$.fragment),Zt(a,"padding-left","var(--spacing-l)"),S(t,"class","title-text svelte-nwwj95"),Zt(l,"padding-right","var(--spacing-xl)"),S(e,"class","title svelte-nwwj95")},m(m,g){w(m,e,g),H(e,t),C(r,t,null),H(t,i),H(t,a),H(e,o),H(e,l),C(s,l,null),w(m,u,g),C(c,m,g),w(m,f,g),C(d,m,g),p=!0},p(m,[g]){const v={};g&1&&(v.automation=m[0]),g&2&&(v.testResults=m[1].testResults),d.$set(v)},i(m){p||(h(r.$$.fragment,m),h(s.$$.fragment,m),h(c.$$.fragment,m),h(d.$$.fragment,m),p=!0)},o(m){_(r.$$.fragment,m),_(s.$$.fragment,m),_(c.$$.fragment,m),_(d.$$.fragment,m),p=!1},d(m){m&&$(e),E(r),E(s),m&&$(u),E(c,m),m&&$(f),E(d,m)}}}function p$t(n,e,t){let r;me(n,$r,o=>t(1,r=o));let{automation:i}=e;const a=async()=>{oi($r,r.showTestPanel=!1,r)};return n.$$set=o=>{"automation"in o&&t(0,i=o.automation)},[i,r,a]}class m$t extends ze{constructor(e){super(),Ae(this,e,p$t,d$t,we,{automation:0})}}function h$t(n){let e,t,r,i;return r=new Ct({props:{gap:"S",justifyItems:"center",$$slots:{default:[y$t]},$$scope:{ctx:n}}}),{c(){e=U("div"),t=U("div"),L(r.$$.fragment),S(t,"class","main svelte-11vv4nq"),S(e,"class","centered svelte-11vv4nq")},m(a,o){w(a,e,o),H(e,t),C(r,t,null),i=!0},p(a,o){const l={};o&257&&(l.$$scope={dirty:o,ctx:a}),r.$set(l)},i(a){i||(h(r.$$.fragment,a),i=!0)},o(a){_(r.$$.fragment,a),i=!1},d(a){a&&$(e),E(r)}}}function g$t(n){let e;const t=n[4].default,r=yn(t,n,n[8],null);return{c(){r&&r.c()},m(i,a){r&&r.m(i,a),e=!0},p(i,a){r&&r.p&&(!e||a&256)&&wn(r,t,i,i[8],e?$n(t,i[8],a,null):kn(i[8]),null)},i(i){e||(h(r,i),e=!0)},o(i){_(r,i),e=!1},d(i){r&&r.d(i)}}}function _$t(n){let e;return{c(){e=Z("You have no automations")},m(t,r){w(t,e,r)},d(t){t&&$(e)}}}function v$t(n){let e;return{c(){e=Z("Let's fix that. Call the bots!")},m(t,r){w(t,e,r)},d(t){t&&$(e)}}}function b$t(n){let e;return{c(){e=Z("Create automation")},m(t,r){w(t,e,r)},d(t){t&&$(e)}}}function y$t(n){let e,t,r,i,a,o,l,s,u;return i=new hn({props:{size:"M",$$slots:{default:[_$t]},$$scope:{ctx:n}}}),o=new Bt({props:{size:"M",$$slots:{default:[v$t]},$$scope:{ctx:n}}}),s=new nn({props:{size:"M",cta:!0,$$slots:{default:[b$t]},$$scope:{ctx:n}}}),s.$on("click",n[5]),{c(){e=rt("svg"),t=rt("use"),r=P(),L(i.$$.fragment),a=P(),L(o.$$.fragment),l=P(),L(s.$$.fragment),Ar(t,"xlink:href","#spectrum-icon-18-WorkflowAdd"),S(e,"width","60px"),S(e,"height","60px"),S(e,"class","spectrum-Icon"),S(e,"focusable","false")},m(c,f){w(c,e,f),H(e,t),w(c,r,f),C(i,c,f),w(c,a,f),C(o,c,f),w(c,l,f),C(s,c,f),u=!0},p(c,f){const d={};f&256&&(d.$$scope={dirty:f,ctx:c}),i.$set(d);const p={};f&256&&(p.$$scope={dirty:f,ctx:c}),o.$set(p);const m={};f&256&&(m.$$scope={dirty:f,ctx:c}),s.$set(m)},i(c){u||(h(i.$$.fragment,c),h(o.$$.fragment,c),h(s.$$.fragment,c),u=!0)},o(c){_(i.$$.fragment,c),_(o.$$.fragment,c),_(s.$$.fragment,c),u=!1},d(c){c&&$(e),c&&$(r),E(i,c),c&&$(a),E(o,c),c&&$(l),E(s,c)}}}function ZX(n){let e,t,r;return t=new m$t({props:{automation:n[3]}}),{c(){e=U("div"),L(t.$$.fragment),S(e,"class","setup svelte-11vv4nq")},m(i,a){w(i,e,a),C(t,e,null),r=!0},p(i,a){const o={};a&8&&(o.automation=i[3]),t.$set(o)},i(i){r||(h(t.$$.fragment,i),r=!0)},o(i){_(t.$$.fragment,i),r=!1},d(i){i&&$(e),E(t)}}}function $$t(n){let e,t;return e=new Fse({props:{webhookModal:n[1]}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){const a={};i&2&&(a.webhookModal=r[1]),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function w$t(n){let e,t;return e=new lL({}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function k$t(n){let e,t,r,i,a,o,l,s,u,c,f,d;t=new a$t({props:{modal:n[0],webhookModal:n[1]}});const p=[g$t,h$t],m=[];function g(M,T){var O;return(O=M[2].automations)!=null&&O.length?0:1}a=g(n),o=m[a]=p[a](n);let v=n[2].showTestPanel&&ZX(n),y={$$slots:{default:[$$t]},$$scope:{ctx:n}};u=new Pn({props:y}),n[6](u);let k={width:"30%",$$slots:{default:[w$t]},$$scope:{ctx:n}};return f=new Pn({props:k}),n[7](f),{c(){e=U("div"),L(t.$$.fragment),r=P(),i=U("div"),o.c(),l=P(),v&&v.c(),s=P(),L(u.$$.fragment),c=P(),L(f.$$.fragment),S(i,"class","content svelte-11vv4nq"),S(e,"class","root svelte-11vv4nq")},m(M,T){w(M,e,T),C(t,e,null),H(e,r),H(e,i),m[a].m(i,null),H(e,l),v&&v.m(e,null),H(e,s),C(u,e,null),H(e,c),C(f,e,null),d=!0},p(M,[T]){const O={};T&1&&(O.modal=M[0]),T&2&&(O.webhookModal=M[1]),t.$set(O);let I=a;a=g(M),a===I?m[a].p(M,T):(fe(),_(m[I],1,1,()=>{m[I]=null}),de(),o=m[a],o?o.p(M,T):(o=m[a]=p[a](M),o.c()),h(o,1),o.m(i,null)),M[2].showTestPanel?v?(v.p(M,T),T&4&&h(v,1)):(v=ZX(M),v.c(),h(v,1),v.m(e,s)):v&&(fe(),_(v,1,1,()=>{v=null}),de());const B={};T&258&&(B.$$scope={dirty:T,ctx:M}),u.$set(B);const N={};T&256&&(N.$$scope={dirty:T,ctx:M}),f.$set(N)},i(M){d||(h(t.$$.fragment,M),h(o),h(v),h(u.$$.fragment,M),h(f.$$.fragment,M),d=!0)},o(M){_(t.$$.fragment,M),_(o),_(v),_(u.$$.fragment,M),_(f.$$.fragment,M),d=!1},d(M){M&&$(e),E(t),m[a].d(),v&&v.d(),n[6](null),E(u),n[7](null),E(f)}}}function A$t(n,e,t){let r,i;me(n,$r,p=>t(2,r=p)),me(n,yc,p=>t(3,i=p));let{$$slots:a={},$$scope:o}=e;const l=gp({urlParam:"automationId",stateKey:"selectedAutomationId",validate:p=>r.automations.some(m=>m._id===p),fallbackUrl:"./index",store:$r,up:$r.actions.select,routify:j3});let s,u;vn(()=>{oi($r,r.showTestPanel=!1,r)}),Cs(l);const c=()=>s.show();function f(p){Me[p?"unshift":"push"](()=>{s=p,t(0,s)})}function d(p){Me[p?"unshift":"push"](()=>{u=p,t(1,u)})}return n.$$set=p=>{"$$scope"in p&&t(8,o=p.$$scope)},[s,u,r,i,a,c,f,d,o]}class z$t extends ze{constructor(e){super(),Ae(this,e,A$t,k$t,we,{})}}function M$t(n){let e,t,r,i,a,o,l;function s(c){n[4](c)}let u={};return n[2]!==void 0&&(u.value=n[2]),a=new gn({props:u}),Me.push(()=>je(a,"value",s)),{c(){e=U("span"),e.textContent=`The changes you have made will be deleted and the application reverted
|
|
919
|
-
back to its production state.`,t=P(),r=U("span"),r.textContent="Please enter your app name to continue.",i=P(),L(a.$$.fragment)},m(c,f){w(c,e,f),w(c,t,f),w(c,r,f),w(c,i,f),C(a,c,f),l=!0},p(c,f){const d={};!o&&f&4&&(o=!0,d.value=c[2],We(()=>o=!1)),a.$set(d)},i(c){l||(h(a.$$.fragment,c),l=!0)},o(c){_(a.$$.fragment,c),l=!1},d(c){c&&$(e),c&&$(t),c&&$(r),c&&$(i),E(a,c)}}}function S$t(n){let e,t;return e=new tr({props:{title:"Revert Changes",confirmText:"Revert",onConfirm:n[3],disabled:n[2]!==n[0].name,$$slots:{default:[M$t]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){const a={};i&5&&(a.disabled=r[2]!==r[0].name),i&132&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function C$t(n){let e,t,r,i;e=new sr({props:{quiet:!0,icon:"Revert",size:"M",tooltip:"Revert changes"}}),e.$on("click",function(){en(n[1].show)&&n[1].show.apply(this,arguments)});let a={$$slots:{default:[S$t]},$$scope:{ctx:n}};return r=new Pn({props:a}),n[5](r),{c(){L(e.$$.fragment),t=P(),L(r.$$.fragment)},m(o,l){C(e,o,l),w(o,t,l),C(r,o,l),i=!0},p(o,[l]){n=o;const s={};l&133&&(s.$$scope={dirty:l,ctx:n}),r.$set(s)},i(o){i||(h(e.$$.fragment,o),h(r.$$.fragment,o),i=!0)},o(o){_(e.$$.fragment,o),_(r.$$.fragment,o),i=!1},d(o){E(e,o),o&&$(t),n[5](null),E(r,o)}}}function E$t(n,e,t){let r,i;me(n,Rt,c=>t(0,i=c));let a,o;const l=async()=>{try{await Vt.revertAppChanges(r);const c=await Vt.fetchAppPackage(r);await Rt.actions.initialise(c),ct.info("Changes reverted successfully")}catch(c){ct.error(`Error reverting changes: ${c}`)}};function s(c){o=c,t(2,o)}function u(c){Me[c?"unshift":"push"](()=>{a=c,t(1,a)})}return n.$$.update=()=>{n.$$.dirty&1&&(r=i.appId)},[i,a,o,l,s,u]}class L$t extends ze{constructor(e){super(),Ae(this,e,E$t,C$t,we,{})}}const T$t="@budibase/client",O$t="2.5.6-alpha.
|
|
919
|
+
back to its production state.`,t=P(),r=U("span"),r.textContent="Please enter your app name to continue.",i=P(),L(a.$$.fragment)},m(c,f){w(c,e,f),w(c,t,f),w(c,r,f),w(c,i,f),C(a,c,f),l=!0},p(c,f){const d={};!o&&f&4&&(o=!0,d.value=c[2],We(()=>o=!1)),a.$set(d)},i(c){l||(h(a.$$.fragment,c),l=!0)},o(c){_(a.$$.fragment,c),l=!1},d(c){c&&$(e),c&&$(t),c&&$(r),c&&$(i),E(a,c)}}}function S$t(n){let e,t;return e=new tr({props:{title:"Revert Changes",confirmText:"Revert",onConfirm:n[3],disabled:n[2]!==n[0].name,$$slots:{default:[M$t]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){const a={};i&5&&(a.disabled=r[2]!==r[0].name),i&132&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function C$t(n){let e,t,r,i;e=new sr({props:{quiet:!0,icon:"Revert",size:"M",tooltip:"Revert changes"}}),e.$on("click",function(){en(n[1].show)&&n[1].show.apply(this,arguments)});let a={$$slots:{default:[S$t]},$$scope:{ctx:n}};return r=new Pn({props:a}),n[5](r),{c(){L(e.$$.fragment),t=P(),L(r.$$.fragment)},m(o,l){C(e,o,l),w(o,t,l),C(r,o,l),i=!0},p(o,[l]){n=o;const s={};l&133&&(s.$$scope={dirty:l,ctx:n}),r.$set(s)},i(o){i||(h(e.$$.fragment,o),h(r.$$.fragment,o),i=!0)},o(o){_(e.$$.fragment,o),_(r.$$.fragment,o),i=!1},d(o){E(e,o),o&&$(t),n[5](null),E(r,o)}}}function E$t(n,e,t){let r,i;me(n,Rt,c=>t(0,i=c));let a,o;const l=async()=>{try{await Vt.revertAppChanges(r);const c=await Vt.fetchAppPackage(r);await Rt.actions.initialise(c),ct.info("Changes reverted successfully")}catch(c){ct.error(`Error reverting changes: ${c}`)}};function s(c){o=c,t(2,o)}function u(c){Me[c?"unshift":"push"](()=>{a=c,t(1,a)})}return n.$$.update=()=>{n.$$.dirty&1&&(r=i.appId)},[i,a,o,l,s,u]}class L$t extends ze{constructor(e){super(),Ae(this,e,E$t,C$t,we,{})}}const T$t="@budibase/client",O$t="2.5.6-alpha.23",D$t="MPL-2.0",I$t="dist/budibase-client.js",B$t="dist/budibase-client.js",H$t="module",P$t="src/index.js",R$t={".":{import:"./dist/budibase-client.js",require:"./dist/budibase-client.js"},"./package.json":"./package.json","./manifest.json":"./manifest.json"},V$t={build:"rollup -c","dev:builder":"rollup -cw"},N$t={"@budibase/bbui":"2.5.6-alpha.23","@budibase/frontend-core":"2.5.6-alpha.23","@budibase/shared-core":"2.5.6-alpha.23","@budibase/string-templates":"2.5.6-alpha.23","@budibase/types":"2.5.6-alpha.23","@spectrum-css/button":"^3.0.3","@spectrum-css/card":"^3.0.3","@spectrum-css/divider":"^1.0.3","@spectrum-css/link":"^3.1.3","@spectrum-css/page":"^3.0.1","@spectrum-css/tag":"^3.1.4","@spectrum-css/typography":"^3.0.2","@spectrum-css/vars":"^3.0.1",apexcharts:"^3.22.1",dayjs:"^1.10.5",downloadjs:"1.4.7","html5-qrcode":"^2.2.1",leaflet:"^1.7.1",regexparam:"^1.3.0","sanitize-html":"^2.7.0",screenfull:"^6.0.1",shortid:"^2.2.15","socket.io-client":"^4.5.1",svelte:"^3.49.0","svelte-apexcharts":"^1.0.2","svelte-flatpickr":"^3.1.0","svelte-spa-router":"^3.0.5"},F$t={"@rollup/plugin-alias":"^3.1.5","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-image":"^3.0.2","@rollup/plugin-node-resolve":"^11.2.1",postcss:"^8.2.10",rollup:"^2.44.0","rollup-plugin-json":"^4.0.0","rollup-plugin-polyfill-node":"^0.8.0","rollup-plugin-postcss":"^4.0.0","rollup-plugin-svelte":"^7.1.0","rollup-plugin-svg":"^2.0.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-visualizer":"^5.5.4"},U$t={"loader-utils":"1.4.1"},j$t="d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc",om={name:T$t,version:O$t,license:D$t,module:I$t,main:B$t,type:H$t,svelte:P$t,exports:R$t,scripts:V$t,dependencies:N$t,devDependencies:F$t,resolutions:U$t,gitHead:j$t};function xX(n){let e,t;return e=new K3({props:{hoverable:!0,notice:!0,$$slots:{default:[q$t]},$$scope:{ctx:n}}}),e.$on("click",function(){en(n[2].show)&&n[2].show.apply(this,arguments)}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){n=r;const a={};i&4096&&(a.$$scope={dirty:i,ctx:n}),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function q$t(n){let e;return{c(){e=Z("Update available")},m(t,r){w(t,e,r)},d(t){t&&$(e)}}}function W$t(n){let e,t;return e=new Bt({props:{size:"S",$$slots:{default:[Y$t]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){const a={};i&4098&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function G$t(n){let e,t;return e=new Bt({props:{size:"S",$$slots:{default:[K$t]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){const a={};i&4098&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function Y$t(n){let e,t,r=n[1].version+"",i,a;return{c(){e=Z("This app is currently using version "),t=U("b"),i=Z(r),a=Z(` which is the
|
|
920
920
|
latest version available.`)},m(o,l){w(o,e,l),w(o,t,l),H(t,i),w(o,a,l)},p(o,l){l&2&&r!==(r=o[1].version+"")&&Qe(i,r)},d(o){o&&$(e),o&&$(t),o&&$(a)}}}function K$t(n){let e,t,r=n[1].version+"",i,a,o,l;return{c(){e=Z("This app is currently using version "),t=U("b"),i=Z(r),a=Z(`, but version
|
|
921
921
|
`),o=U("b"),o.textContent=`${om.version}`,l=Z(` is available. Updates can contain new features,
|
|
922
922
|
performance improvements and bug fixes.`)},m(s,u){w(s,e,u),w(s,t,u),H(t,i),w(s,a,u),w(s,o,u),w(s,l,u)},p(s,u){u&2&&r!==(r=s[1].version+"")&&Qe(i,r)},d(s){s&&$(e),s&&$(t),s&&$(a),s&&$(o),s&&$(l)}}}function eJ(n){let e,t;return e=new Bt({props:{size:"S",$$slots:{default:[X$t]},$$scope:{ctx:n}}}),{c(){L(e.$$.fragment)},m(r,i){C(e,r,i),t=!0},p(r,i){const a={};i&4098&&(a.$$scope={dirty:i,ctx:r}),e.$set(a)},i(r){t||(h(e.$$.fragment,r),t=!0)},o(r){_(e.$$.fragment,r),t=!1},d(r){E(e,r)}}}function X$t(n){let e,t,r=n[1].revertableVersion+"",i,a;return{c(){e=Z(`You can revert this app to version
|
package/builder/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
|
9
9
|
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
|
|
10
10
|
rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="/builder/assets/index.
|
|
11
|
+
<script type="module" crossorigin src="/builder/assets/index.919ee825.js"></script>
|
|
12
12
|
<link rel="stylesheet" href="/builder/assets/index.754d53c4.css">
|
|
13
13
|
</head>
|
|
14
14
|
|
|
@@ -14,7 +14,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.updateAppPackage = exports.sync = exports.unpublish = exports.destroy = exports.revertClient = exports.updateClient = exports.update = exports.create = exports.fetchAppPackage = exports.fetchAppDefinition = exports.fetch = void 0;
|
|
16
16
|
const environment_1 = __importDefault(require("../../environment"));
|
|
17
|
-
const package_json_1 = __importDefault(require("../../../package.json"));
|
|
18
17
|
const staticViews_1 = require("../../db/views/staticViews");
|
|
19
18
|
const fileSystem_1 = require("../../utilities/fileSystem");
|
|
20
19
|
const utils_1 = require("../../db/utils");
|
|
@@ -209,7 +208,7 @@ function performAppCreate(ctx) {
|
|
|
209
208
|
_rev: undefined,
|
|
210
209
|
appId,
|
|
211
210
|
type: "app",
|
|
212
|
-
version:
|
|
211
|
+
version: backend_core_1.env.VERSION,
|
|
213
212
|
componentLibraries: ["@budibase/standard-components"],
|
|
214
213
|
name: name,
|
|
215
214
|
url: url,
|
|
@@ -377,7 +376,7 @@ function updateClient(ctx) {
|
|
|
377
376
|
yield (0, fileSystem_2.updateClientLibrary)(ctx.params.appId);
|
|
378
377
|
}
|
|
379
378
|
// Update versions in app package
|
|
380
|
-
const updatedToVersion =
|
|
379
|
+
const updatedToVersion = backend_core_1.env.VERSION;
|
|
381
380
|
const appPackageUpdates = {
|
|
382
381
|
version: updatedToVersion,
|
|
383
382
|
revertableVersion: currentVersion,
|
|
@@ -136,7 +136,7 @@ function revert(ctx) {
|
|
|
136
136
|
exports.revert = revert;
|
|
137
137
|
function getBudibaseVersion(ctx) {
|
|
138
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
-
const version =
|
|
139
|
+
const version = backend_core_1.env.VERSION;
|
|
140
140
|
ctx.body = {
|
|
141
141
|
version,
|
|
142
142
|
};
|
|
@@ -28,7 +28,6 @@ const types_1 = require("@budibase/types");
|
|
|
28
28
|
const utils_1 = require("../../../integrations/utils");
|
|
29
29
|
const utils_2 = require("./utils");
|
|
30
30
|
const constants_1 = require("../../../constants");
|
|
31
|
-
const utils_3 = require("../../../integrations/utils");
|
|
32
31
|
const string_templates_1 = require("@budibase/string-templates");
|
|
33
32
|
const fp_1 = require("lodash/fp");
|
|
34
33
|
const rowProcessor_1 = require("../../../utilities/rowProcessor");
|
|
@@ -146,7 +145,7 @@ function getEndpoint(tableId, operation) {
|
|
|
146
145
|
if (!tableId) {
|
|
147
146
|
return {};
|
|
148
147
|
}
|
|
149
|
-
const { datasourceId, tableName } = (0,
|
|
148
|
+
const { datasourceId, tableName } = (0, utils_1.breakExternalTableId)(tableId);
|
|
150
149
|
return {
|
|
151
150
|
datasourceId,
|
|
152
151
|
entityId: tableName,
|
|
@@ -214,7 +213,7 @@ class ExternalRequest {
|
|
|
214
213
|
if (!tableId) {
|
|
215
214
|
throw "Table ID is unknown, cannot find table";
|
|
216
215
|
}
|
|
217
|
-
const { tableName } = (0,
|
|
216
|
+
const { tableName } = (0, utils_1.breakExternalTableId)(tableId);
|
|
218
217
|
if (tableName) {
|
|
219
218
|
return this.tables[tableName];
|
|
220
219
|
}
|
|
@@ -250,7 +249,7 @@ class ExternalRequest {
|
|
|
250
249
|
newRow[key] = row[key];
|
|
251
250
|
continue;
|
|
252
251
|
}
|
|
253
|
-
const { tableName: linkTableName } = (0,
|
|
252
|
+
const { tableName: linkTableName } = (0, utils_1.breakExternalTableId)(field === null || field === void 0 ? void 0 : field.tableId);
|
|
254
253
|
// table has to exist for many to many
|
|
255
254
|
if (!linkTableName || !this.tables[linkTableName]) {
|
|
256
255
|
continue;
|
|
@@ -312,10 +311,18 @@ class ExternalRequest {
|
|
|
312
311
|
}
|
|
313
312
|
const display = linkedTable.primaryDisplay;
|
|
314
313
|
for (let key of Object.keys(row[relationship.column])) {
|
|
315
|
-
|
|
314
|
+
let relatedRow = row[relationship.column][key];
|
|
315
|
+
// add this row as context for the relationship
|
|
316
|
+
for (let col of Object.values(linkedTable.schema)) {
|
|
317
|
+
if (col.type === types_1.FieldType.LINK && col.tableId === table._id) {
|
|
318
|
+
relatedRow[col.name] = [row];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
relatedRow = (0, rowProcessor_1.processFormulas)(linkedTable, relatedRow);
|
|
322
|
+
const relatedDisplay = display ? relatedRow[display] : undefined;
|
|
316
323
|
row[relationship.column][key] = {
|
|
317
|
-
primaryDisplay:
|
|
318
|
-
_id:
|
|
324
|
+
primaryDisplay: relatedDisplay || "Invalid display column",
|
|
325
|
+
_id: relatedRow._id,
|
|
319
326
|
};
|
|
320
327
|
}
|
|
321
328
|
}
|
|
@@ -404,7 +411,7 @@ class ExternalRequest {
|
|
|
404
411
|
if (field.type !== constants_1.FieldTypes.LINK) {
|
|
405
412
|
continue;
|
|
406
413
|
}
|
|
407
|
-
const { tableName: linkTableName } = (0,
|
|
414
|
+
const { tableName: linkTableName } = (0, utils_1.breakExternalTableId)(field.tableId);
|
|
408
415
|
// no table to link to, this is not a valid relationships
|
|
409
416
|
if (!linkTableName || !this.tables[linkTableName]) {
|
|
410
417
|
continue;
|
|
@@ -422,7 +429,7 @@ class ExternalRequest {
|
|
|
422
429
|
column: fieldName,
|
|
423
430
|
};
|
|
424
431
|
if (field.through) {
|
|
425
|
-
const { tableName: throughTableName } = (0,
|
|
432
|
+
const { tableName: throughTableName } = (0, utils_1.breakExternalTableId)(field.through);
|
|
426
433
|
definition.through = throughTableName;
|
|
427
434
|
// don't support composite keys for relationships
|
|
428
435
|
definition.from = field.throughTo || table.primary[0];
|
|
@@ -441,7 +448,7 @@ class ExternalRequest {
|
|
|
441
448
|
lookupRelations(tableId, row) {
|
|
442
449
|
return __awaiter(this, void 0, void 0, function* () {
|
|
443
450
|
const related = {};
|
|
444
|
-
const { tableName } = (0,
|
|
451
|
+
const { tableName } = (0, utils_1.breakExternalTableId)(tableId);
|
|
445
452
|
if (!tableName) {
|
|
446
453
|
return related;
|
|
447
454
|
}
|
|
@@ -458,7 +465,7 @@ class ExternalRequest {
|
|
|
458
465
|
}
|
|
459
466
|
const isMany = field.relationshipType === types_1.RelationshipTypes.MANY_TO_MANY;
|
|
460
467
|
const tableId = isMany ? field.through : field.tableId;
|
|
461
|
-
const { tableName: relatedTableName } = (0,
|
|
468
|
+
const { tableName: relatedTableName } = (0, utils_1.breakExternalTableId)(tableId);
|
|
462
469
|
// @ts-ignore
|
|
463
470
|
const linkPrimaryKey = this.tables[relatedTableName].primary[0];
|
|
464
471
|
const manyKey = field.throughTo || primaryKey;
|
|
@@ -579,7 +586,7 @@ class ExternalRequest {
|
|
|
579
586
|
if (field.type !== constants_1.FieldTypes.LINK || !includeRelations) {
|
|
580
587
|
continue;
|
|
581
588
|
}
|
|
582
|
-
const { tableName: linkTableName } = (0,
|
|
589
|
+
const { tableName: linkTableName } = (0, utils_1.breakExternalTableId)(field.tableId);
|
|
583
590
|
if (linkTableName) {
|
|
584
591
|
const linkTable = this.tables[linkTableName];
|
|
585
592
|
if (linkTable) {
|
|
@@ -594,7 +601,7 @@ class ExternalRequest {
|
|
|
594
601
|
var _a;
|
|
595
602
|
return __awaiter(this, void 0, void 0, function* () {
|
|
596
603
|
const { operation, tableId } = this;
|
|
597
|
-
let { datasourceId, tableName } = (0,
|
|
604
|
+
let { datasourceId, tableName } = (0, utils_1.breakExternalTableId)(tableId);
|
|
598
605
|
if (!tableName) {
|
|
599
606
|
throw "Unable to run without a table name";
|
|
600
607
|
}
|
|
@@ -606,7 +613,7 @@ class ExternalRequest {
|
|
|
606
613
|
this.tables = this.datasource.entities;
|
|
607
614
|
}
|
|
608
615
|
const table = this.tables[tableName];
|
|
609
|
-
let isSql = (0,
|
|
616
|
+
let isSql = (0, utils_1.isSQL)(this.datasource);
|
|
610
617
|
if (!table) {
|
|
611
618
|
throw `Unable to process query, table "${tableName}" not defined.`;
|
|
612
619
|
}
|
package/dist/api/index.js
CHANGED
|
@@ -9,14 +9,13 @@ const backend_core_1 = require("@budibase/backend-core");
|
|
|
9
9
|
const currentapp_1 = __importDefault(require("../middleware/currentapp"));
|
|
10
10
|
const zlib_1 = __importDefault(require("zlib"));
|
|
11
11
|
const routes_1 = require("./routes");
|
|
12
|
-
const package_json_1 = __importDefault(require("../../package.json"));
|
|
13
12
|
const pro_1 = require("@budibase/pro");
|
|
14
13
|
var public_1 = require("./routes/public");
|
|
15
14
|
Object.defineProperty(exports, "shutdown", { enumerable: true, get: function () { return public_1.shutdown; } });
|
|
16
15
|
const compress = require("koa-compress");
|
|
17
16
|
exports.router = new router_1.default();
|
|
18
17
|
exports.router.get("/health", ctx => (ctx.status = 200));
|
|
19
|
-
exports.router.get("/version", ctx => (ctx.body =
|
|
18
|
+
exports.router.get("/version", ctx => (ctx.body = backend_core_1.env.VERSION));
|
|
20
19
|
exports.router.use(backend_core_1.middleware.errorHandling);
|
|
21
20
|
exports.router
|
|
22
21
|
.use(compress({
|
|
@@ -69,10 +69,17 @@ function generateSchema(schema, table, tables, oldTable = null, renamed) {
|
|
|
69
69
|
if (!relatedTable) {
|
|
70
70
|
throw "Referenced table doesn't exist";
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
const relatedPrimary = relatedTable.primary[0];
|
|
73
|
+
const externalType = relatedTable.schema[relatedPrimary].externalType;
|
|
74
|
+
if (externalType) {
|
|
75
|
+
schema.specificType(column.foreignKey, externalType);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
schema.integer(column.foreignKey).unsigned();
|
|
79
|
+
}
|
|
73
80
|
schema
|
|
74
81
|
.foreign(column.foreignKey)
|
|
75
|
-
.references(`${tableName}.${
|
|
82
|
+
.references(`${tableName}.${relatedPrimary}`);
|
|
76
83
|
}
|
|
77
84
|
break;
|
|
78
85
|
}
|