@iebh/tera-fy 1.3.1 → 1.3.2
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/CHANGELOG.md +8 -0
- package/dist/plugin.vue2.es2019.js +1 -1
- package/lib/terafy.client.js +1 -1
- package/lib/terafy.server.js +2 -7
- package/package.json +2 -2
- package/plugins/base.js +1 -1
- package/plugins/vue2.js +24 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.2](https://github.com/IEBH/TERA-fy/compare/v1.3.1...v1.3.2) (2024-04-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Various minor tweaks to keep ESLint happy ([c7e7f0d](https://github.com/IEBH/TERA-fy/commit/c7e7f0d26aff283acc85dd9f42f24015194f369d))
|
|
9
|
+
* Wrong API endpoint when setting file Blobs ([45aa6df](https://github.com/IEBH/TERA-fy/commit/45aa6df2bc3dafe056dfd9591c8b770bf0f66835))
|
|
10
|
+
|
|
3
11
|
## [1.3.1](https://github.com/IEBH/TERA-fy/compare/v1.3.0...v1.3.1) (2024-04-16)
|
|
4
12
|
|
|
5
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var fr=Object.defineProperty;var sr=(t,e,r)=>e in t?fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var k=(t,e,r)=>(sr(t,typeof e!="symbol"?e+"":e,r),r);var pr=typeof global=="object"&&global&&global.Object===Object&&global,q=pr;var ir=typeof self=="object"&&self&&self.Object===Object&&self,nr=q||ir||Function("return this")(),u=nr;var ur=u.Symbol,g=ur;var _t=Object.prototype,mr=_t.hasOwnProperty,lr=_t.toString,K=g?g.toStringTag:void 0;function dr(t){var e=mr.call(t,K),r=t[K];try{t[K]=void 0;var o=!0}catch{}var a=lr.call(t);return o&&(e?t[K]=r:delete t[K]),a}var At=dr;var cr=Object.prototype,xr=cr.toString;function gr(t){return xr.call(t)}var wt=gr;var hr="[object Null]",yr="[object Undefined]",St=g?g.toStringTag:void 0;function br(t){return t==null?t===void 0?yr:hr:St&&St in Object(t)?At(t):wt(t)}var h=br;function vr(t){return t!=null&&typeof t=="object"}var c=vr;var jr=Array.isArray,C=jr;function Tr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var x=Tr;var Or="[object AsyncFunction]",_r="[object Function]",Ar="[object GeneratorFunction]",wr="[object Proxy]";function Sr(t){if(!x(t))return!1;var e=h(t);return e==_r||e==Ar||e==Or||e==wr}var H=Sr;var Ir=u["__core-js_shared__"],$=Ir;var It=function(){var t=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Pr(t){return!!It&&It in t}var Pt=Pr;var Cr=Function.prototype,Er=Cr.toString;function Br(t){if(t!=null){try{return Er.call(t)}catch{}try{return t+""}catch{}}return""}var y=Br;var Lr=/[\\^$.*+?()[\]{}|]/g,Mr=/^\[object .+?Constructor\]$/,Dr=Function.prototype,Fr=Object.prototype,Nr=Dr.toString,Rr=Fr.hasOwnProperty,Ur=RegExp("^"+Nr.call(Rr).replace(Lr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gr(t){if(!x(t)||Pt(t))return!1;var e=H(t)?Ur:Mr;return e.test(y(t))}var Ct=Gr;function Wr(t,e){return t==null?void 0:t[e]}var Et=Wr;function Kr(t,e){var r=Et(t,e);return Ct(r)?r:void 0}var m=Kr;var Vr=m(u,"WeakMap"),J=Vr;var Bt=Object.create,zr=function(){function t(){}return function(e){if(!x(e))return{};if(Bt)return Bt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Lt=zr;function kr(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var Mt=kr;var qr=function(){try{var t=m(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ct=qr;function Hr(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}var Dt=Hr;var $r=9007199254740991,Jr=/^(?:0|[1-9]\d*)$/;function Yr(t,e){var r=typeof t;return e=e==null?$r:e,!!e&&(r=="number"||r!="symbol"&&Jr.test(t))&&t>-1&&t%1==0&&t<e}var Ft=Yr;function Xr(t,e,r){e=="__proto__"&&ct?ct(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Y=Xr;function Zr(t,e){return t===e||t!==t&&e!==e}var X=Zr;var Qr=Object.prototype,to=Qr.hasOwnProperty;function eo(t,e,r){var o=t[e];(!(to.call(t,e)&&X(o,r))||r===void 0&&!(e in t))&&Y(t,e,r)}var Z=eo;function ro(t,e,r,o){var a=!r;r||(r={});for(var f=-1,s=e.length;++f<s;){var n=e[f],l=o?o(r[n],t[n],n,r,t):void 0;l===void 0&&(l=t[n]),a?Y(r,n,l):Z(r,n,l)}return r}var T=ro;var oo=9007199254740991;function ao(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=oo}var Q=ao;function fo(t){return t!=null&&Q(t.length)&&!H(t)}var tt=fo;var so=Object.prototype;function po(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||so;return t===r}var E=po;function io(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Nt=io;var no="[object Arguments]";function uo(t){return c(t)&&h(t)==no}var xt=uo;var Rt=Object.prototype,mo=Rt.hasOwnProperty,lo=Rt.propertyIsEnumerable,co=xt(function(){return arguments}())?xt:function(t){return c(t)&&mo.call(t,"callee")&&!lo.call(t,"callee")},Ut=co;function xo(){return!1}var Gt=xo;var Vt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Vt&&typeof module=="object"&&module&&!module.nodeType&&module,go=Wt&&Wt.exports===Vt,Kt=go?u.Buffer:void 0,ho=Kt?Kt.isBuffer:void 0,yo=ho||Gt,et=yo;var bo="[object Arguments]",vo="[object Array]",jo="[object Boolean]",To="[object Date]",Oo="[object Error]",_o="[object Function]",Ao="[object Map]",wo="[object Number]",So="[object Object]",Io="[object RegExp]",Po="[object Set]",Co="[object String]",Eo="[object WeakMap]",Bo="[object ArrayBuffer]",Lo="[object DataView]",Mo="[object Float32Array]",Do="[object Float64Array]",Fo="[object Int8Array]",No="[object Int16Array]",Ro="[object Int32Array]",Uo="[object Uint8Array]",Go="[object Uint8ClampedArray]",Wo="[object Uint16Array]",Ko="[object Uint32Array]",i={};i[Mo]=i[Do]=i[Fo]=i[No]=i[Ro]=i[Uo]=i[Go]=i[Wo]=i[Ko]=!0;i[bo]=i[vo]=i[Bo]=i[jo]=i[Lo]=i[To]=i[Oo]=i[_o]=i[Ao]=i[wo]=i[So]=i[Io]=i[Po]=i[Co]=i[Eo]=!1;function Vo(t){return c(t)&&Q(t.length)&&!!i[h(t)]}var zt=Vo;function zo(t){return function(e){return t(e)}}var B=zo;var kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,V=kt&&typeof module=="object"&&module&&!module.nodeType&&module,ko=V&&V.exports===kt,gt=ko&&q.process,qo=function(){try{var t=V&&V.require&&V.require("util").types;return t||gt&>.binding&>.binding("util")}catch{}}(),b=qo;var qt=b&&b.isTypedArray,Ho=qt?B(qt):zt,Ht=Ho;var $o=Object.prototype,Jo=$o.hasOwnProperty;function Yo(t,e){var r=C(t),o=!r&&Ut(t),a=!r&&!o&&et(t),f=!r&&!o&&!a&&Ht(t),s=r||o||a||f,n=s?Nt(t.length,String):[],l=n.length;for(var d in t)(e||Jo.call(t,d))&&!(s&&(d=="length"||a&&(d=="offset"||d=="parent")||f&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ft(d,l)))&&n.push(d);return n}var rt=Yo;function Xo(t,e){return function(r){return t(e(r))}}var ot=Xo;var Zo=ot(Object.keys,Object),$t=Zo;var Qo=Object.prototype,ta=Qo.hasOwnProperty;function ea(t){if(!E(t))return $t(t);var e=[];for(var r in Object(t))ta.call(t,r)&&r!="constructor"&&e.push(r);return e}var Jt=ea;function ra(t){return tt(t)?rt(t):Jt(t)}var L=ra;function oa(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Yt=oa;var aa=Object.prototype,fa=aa.hasOwnProperty;function sa(t){if(!x(t))return Yt(t);var e=E(t),r=[];for(var o in t)o=="constructor"&&(e||!fa.call(t,o))||r.push(o);return r}var Xt=sa;function pa(t){return tt(t)?rt(t,!0):Xt(t)}var M=pa;var ia=m(Object,"create"),v=ia;function na(){this.__data__=v?v(null):{},this.size=0}var Zt=na;function ua(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Qt=ua;var ma="__lodash_hash_undefined__",la=Object.prototype,da=la.hasOwnProperty;function ca(t){var e=this.__data__;if(v){var r=e[t];return r===ma?void 0:r}return da.call(e,t)?e[t]:void 0}var te=ca;var xa=Object.prototype,ga=xa.hasOwnProperty;function ha(t){var e=this.__data__;return v?e[t]!==void 0:ga.call(e,t)}var ee=ha;var ya="__lodash_hash_undefined__";function ba(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=v&&e===void 0?ya:e,this}var re=ba;function D(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=Zt;D.prototype.delete=Qt;D.prototype.get=te;D.prototype.has=ee;D.prototype.set=re;var ht=D;function va(){this.__data__=[],this.size=0}var oe=va;function ja(t,e){for(var r=t.length;r--;)if(X(t[r][0],e))return r;return-1}var O=ja;var Ta=Array.prototype,Oa=Ta.splice;function _a(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Oa.call(e,r,1),--this.size,!0}var ae=_a;function Aa(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var fe=Aa;function wa(t){return O(this.__data__,t)>-1}var se=wa;function Sa(t,e){var r=this.__data__,o=O(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var pe=Sa;function F(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}F.prototype.clear=oe;F.prototype.delete=ae;F.prototype.get=fe;F.prototype.has=se;F.prototype.set=pe;var _=F;var Ia=m(u,"Map"),A=Ia;function Pa(){this.size=0,this.__data__={hash:new ht,map:new(A||_),string:new ht}}var ie=Pa;function Ca(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ne=Ca;function Ea(t,e){var r=t.__data__;return ne(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Ea;function Ba(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var ue=Ba;function La(t){return w(this,t).get(t)}var me=La;function Ma(t){return w(this,t).has(t)}var le=Ma;function Da(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var de=Da;function N(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=ie;N.prototype.delete=ue;N.prototype.get=me;N.prototype.has=le;N.prototype.set=de;var ce=N;function Fa(t,e){for(var r=-1,o=e.length,a=t.length;++r<o;)t[a+r]=e[r];return t}var at=Fa;var Na=ot(Object.getPrototypeOf,Object),ft=Na;function Ra(){this.__data__=new _,this.size=0}var xe=Ra;function Ua(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ge=Ua;function Ga(t){return this.__data__.get(t)}var he=Ga;function Wa(t){return this.__data__.has(t)}var ye=Wa;var Ka=200;function Va(t,e){var r=this.__data__;if(r instanceof _){var o=r.__data__;if(!A||o.length<Ka-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new ce(o)}return r.set(t,e),this.size=r.size,this}var be=Va;function R(t){var e=this.__data__=new _(t);this.size=e.size}R.prototype.clear=xe;R.prototype.delete=ge;R.prototype.get=he;R.prototype.has=ye;R.prototype.set=be;var ve=R;function za(t,e){return t&&T(e,L(e),t)}var je=za;function ka(t,e){return t&&T(e,M(e),t)}var Te=ka;var we=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oe=we&&typeof module=="object"&&module&&!module.nodeType&&module,qa=Oe&&Oe.exports===we,_e=qa?u.Buffer:void 0,Ae=_e?_e.allocUnsafe:void 0;function Ha(t,e){if(e)return t.slice();var r=t.length,o=Ae?Ae(r):new t.constructor(r);return t.copy(o),o}var Se=Ha;function $a(t,e){for(var r=-1,o=t==null?0:t.length,a=0,f=[];++r<o;){var s=t[r];e(s,r,t)&&(f[a++]=s)}return f}var Ie=$a;function Ja(){return[]}var st=Ja;var Ya=Object.prototype,Xa=Ya.propertyIsEnumerable,Pe=Object.getOwnPropertySymbols,Za=Pe?function(t){return t==null?[]:(t=Object(t),Ie(Pe(t),function(e){return Xa.call(t,e)}))}:st,U=Za;function Qa(t,e){return T(t,U(t),e)}var Ce=Qa;var tf=Object.getOwnPropertySymbols,ef=tf?function(t){for(var e=[];t;)at(e,U(t)),t=ft(t);return e}:st,pt=ef;function rf(t,e){return T(t,pt(t),e)}var Ee=rf;function of(t,e,r){var o=e(t);return C(t)?o:at(o,r(t))}var it=of;function af(t){return it(t,L,U)}var Be=af;function ff(t){return it(t,M,pt)}var Le=ff;var sf=m(u,"DataView"),nt=sf;var pf=m(u,"Promise"),ut=pf;var nf=m(u,"Set"),mt=nf;var Me="[object Map]",uf="[object Object]",De="[object Promise]",Fe="[object Set]",Ne="[object WeakMap]",Re="[object DataView]",mf=y(nt),lf=y(A),df=y(ut),cf=y(mt),xf=y(J),I=h;(nt&&I(new nt(new ArrayBuffer(1)))!=Re||A&&I(new A)!=Me||ut&&I(ut.resolve())!=De||mt&&I(new mt)!=Fe||J&&I(new J)!=Ne)&&(I=function(t){var e=h(t),r=e==uf?t.constructor:void 0,o=r?y(r):"";if(o)switch(o){case mf:return Re;case lf:return Me;case df:return De;case cf:return Fe;case xf:return Ne}return e});var G=I;var gf=Object.prototype,hf=gf.hasOwnProperty;function yf(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&hf.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Ue=yf;var bf=u.Uint8Array,yt=bf;function vf(t){var e=new t.constructor(t.byteLength);return new yt(e).set(new yt(t)),e}var W=vf;function jf(t,e){var r=e?W(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Ge=jf;var Tf=/\w*$/;function Of(t){var e=new t.constructor(t.source,Tf.exec(t));return e.lastIndex=t.lastIndex,e}var We=Of;var Ke=g?g.prototype:void 0,Ve=Ke?Ke.valueOf:void 0;function _f(t){return Ve?Object(Ve.call(t)):{}}var ze=_f;function Af(t,e){var r=e?W(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ke=Af;var wf="[object Boolean]",Sf="[object Date]",If="[object Map]",Pf="[object Number]",Cf="[object RegExp]",Ef="[object Set]",Bf="[object String]",Lf="[object Symbol]",Mf="[object ArrayBuffer]",Df="[object DataView]",Ff="[object Float32Array]",Nf="[object Float64Array]",Rf="[object Int8Array]",Uf="[object Int16Array]",Gf="[object Int32Array]",Wf="[object Uint8Array]",Kf="[object Uint8ClampedArray]",Vf="[object Uint16Array]",zf="[object Uint32Array]";function kf(t,e,r){var o=t.constructor;switch(e){case Mf:return W(t);case wf:case Sf:return new o(+t);case Df:return Ge(t,r);case Ff:case Nf:case Rf:case Uf:case Gf:case Wf:case Kf:case Vf:case zf:return ke(t,r);case If:return new o;case Pf:case Bf:return new o(t);case Cf:return We(t);case Ef:return new o;case Lf:return ze(t)}}var qe=kf;function qf(t){return typeof t.constructor=="function"&&!E(t)?Lt(ft(t)):{}}var He=qf;var Hf="[object Map]";function $f(t){return c(t)&&G(t)==Hf}var $e=$f;var Je=b&&b.isMap,Jf=Je?B(Je):$e,Ye=Jf;var Yf="[object Set]";function Xf(t){return c(t)&&G(t)==Yf}var Xe=Xf;var Ze=b&&b.isSet,Zf=Ze?B(Ze):Xe,Qe=Zf;var Qf=1,ts=2,es=4,tr="[object Arguments]",rs="[object Array]",os="[object Boolean]",as="[object Date]",fs="[object Error]",er="[object Function]",ss="[object GeneratorFunction]",ps="[object Map]",is="[object Number]",rr="[object Object]",ns="[object RegExp]",us="[object Set]",ms="[object String]",ls="[object Symbol]",ds="[object WeakMap]",cs="[object ArrayBuffer]",xs="[object DataView]",gs="[object Float32Array]",hs="[object Float64Array]",ys="[object Int8Array]",bs="[object Int16Array]",vs="[object Int32Array]",js="[object Uint8Array]",Ts="[object Uint8ClampedArray]",Os="[object Uint16Array]",_s="[object Uint32Array]",p={};p[tr]=p[rs]=p[cs]=p[xs]=p[os]=p[as]=p[gs]=p[hs]=p[ys]=p[bs]=p[vs]=p[ps]=p[is]=p[rr]=p[ns]=p[us]=p[ms]=p[ls]=p[js]=p[Ts]=p[Os]=p[_s]=!0;p[fs]=p[er]=p[ds]=!1;function lt(t,e,r,o,a,f){var s,n=e&Qf,l=e&ts,d=e&es;if(r&&(s=a?r(t,o,a,f):r(t)),s!==void 0)return s;if(!x(t))return t;var vt=C(t);if(vt){if(s=Ue(t),!n)return Mt(t,s)}else{var P=G(t),jt=P==er||P==ss;if(et(t))return Se(t,n);if(P==rr||P==tr||jt&&!a){if(s=l||jt?{}:He(t),!n)return l?Ee(t,Te(s,t)):Ce(t,je(s,t))}else{if(!p[P])return a?t:{};s=qe(t,P,n)}}f||(f=new ve);var Tt=f.get(t);if(Tt)return Tt;f.set(t,s),Qe(t)?t.forEach(function(j){s.add(lt(j,e,r,j,t,f))}):Ye(t)&&t.forEach(function(j,S){s.set(S,lt(j,e,r,S,t,f))});var ar=d?l?Le:Be:l?M:L,Ot=vt?void 0:ar(t);return Dt(Ot||t,function(j,S){Ot&&(S=j,j=t[S]),Z(s,S,lt(j,e,r,S,t,f))}),s}var or=lt;var As=1,ws=4;function Ss(t){return or(t,As|ws)}var dt=Ss;var z=class{init(){}constructor(e,r){}};var bt=class extends z{constructor(){super(...arguments);k(this,"Vue");k(this,"projects");k(this,"state",null)}bindProjectState(r){let o={component:null,componentKey:null,autoRequire:!0,write:!0,...r};return Promise.resolve().then(()=>Promise.all([this.getProjectState({autoRequire:o.autoRequire}),(()=>{if(!o.componentKey){for(let a=0;a<50;a++){let f=`terafy_${a}`;if(!Object.hasOwnProperty(o.component,f)){o.componentKey=f;return}}throw new Error("Unable to find unique key to allocate against Vue2 component")}})()])).then(([a])=>{this.debug("Got project snapshot",a);let f=this.Vue.observable(a);o.component[o.componentKey]=f;let s=0;if(o.read&&this.events.on(`update:projects/${f.id}`,n=>{s++,Object.assign(f,n)}),o.write){if(!o.component)throw new Error("bindProjectState requires a VueComponent specified as `component`");let n=dt(a);o.component.$watch(o.componentKey,l=>{if(s>0){s--;return}this.createProjectStatePatch(l,n),n=dt(a)},{deep:!0})}return f})}init(r){let o={app:null,Vue:null,globalName:"$tera",requireProject:!0,subscribeState:!0,subscribeProjects:!0,stateOptions:{read:!0,write:!0},...r};if(!o.Vue)throw new Error("Vue instance to use must be specified in init options as `Vue`");if(this.Vue=r.Vue,!this.settings.app)throw new Error("Need to specify the root level Vue2 app during init");return o.stateOptions.app=this.settings.app,this.projects=this.Vue.observable([]),o.globalName&&(this.Vue.prototype[o.globalName]=this),this.state=null,Promise.resolve().then(()=>o.requireProject&&this.requireProject()).then(()=>Promise.all([o.subscribeState&&this.bindProjectState({...o.stateOptions,component:this.settings.app.$root}).then(a=>this.state=a).then(()=>this.debug("INFO","Loaded project state",this.state)),o.subscribeProjects&&this.getProjects().then(a=>this.projects=this.Vue.observable(a)).then(()=>this.debug("INFO","Loaded projects",this.projects))]))}};export{bt as default};
|
|
1
|
+
var fr=Object.defineProperty;var sr=(t,e,r)=>e in t?fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var k=(t,e,r)=>(sr(t,typeof e!="symbol"?e+"":e,r),r);var pr=typeof global=="object"&&global&&global.Object===Object&&global,q=pr;var ir=typeof self=="object"&&self&&self.Object===Object&&self,nr=q||ir||Function("return this")(),u=nr;var ur=u.Symbol,g=ur;var _t=Object.prototype,mr=_t.hasOwnProperty,lr=_t.toString,V=g?g.toStringTag:void 0;function dr(t){var e=mr.call(t,V),r=t[V];try{t[V]=void 0;var o=!0}catch{}var a=lr.call(t);return o&&(e?t[V]=r:delete t[V]),a}var At=dr;var cr=Object.prototype,xr=cr.toString;function gr(t){return xr.call(t)}var wt=gr;var hr="[object Null]",yr="[object Undefined]",St=g?g.toStringTag:void 0;function br(t){return t==null?t===void 0?yr:hr:St&&St in Object(t)?At(t):wt(t)}var h=br;function vr(t){return t!=null&&typeof t=="object"}var c=vr;var jr=Array.isArray,C=jr;function Tr(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var x=Tr;var Or="[object AsyncFunction]",_r="[object Function]",Ar="[object GeneratorFunction]",wr="[object Proxy]";function Sr(t){if(!x(t))return!1;var e=h(t);return e==_r||e==Ar||e==Or||e==wr}var H=Sr;var Ir=u["__core-js_shared__"],$=Ir;var It=function(){var t=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Pr(t){return!!It&&It in t}var Pt=Pr;var Cr=Function.prototype,Er=Cr.toString;function Br(t){if(t!=null){try{return Er.call(t)}catch{}try{return t+""}catch{}}return""}var y=Br;var Lr=/[\\^$.*+?()[\]{}|]/g,Mr=/^\[object .+?Constructor\]$/,Dr=Function.prototype,Fr=Object.prototype,Nr=Dr.toString,Rr=Fr.hasOwnProperty,Ur=RegExp("^"+Nr.call(Rr).replace(Lr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gr(t){if(!x(t)||Pt(t))return!1;var e=H(t)?Ur:Mr;return e.test(y(t))}var Ct=Gr;function Wr(t,e){return t==null?void 0:t[e]}var Et=Wr;function Vr(t,e){var r=Et(t,e);return Ct(r)?r:void 0}var m=Vr;var Kr=m(u,"WeakMap"),J=Kr;var Bt=Object.create,zr=function(){function t(){}return function(e){if(!x(e))return{};if(Bt)return Bt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Lt=zr;function kr(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r<o;)e[r]=t[r];return e}var Mt=kr;var qr=function(){try{var t=m(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ct=qr;function Hr(t,e){for(var r=-1,o=t==null?0:t.length;++r<o&&e(t[r],r,t)!==!1;);return t}var Dt=Hr;var $r=9007199254740991,Jr=/^(?:0|[1-9]\d*)$/;function Yr(t,e){var r=typeof t;return e=e==null?$r:e,!!e&&(r=="number"||r!="symbol"&&Jr.test(t))&&t>-1&&t%1==0&&t<e}var Ft=Yr;function Xr(t,e,r){e=="__proto__"&&ct?ct(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Y=Xr;function Zr(t,e){return t===e||t!==t&&e!==e}var X=Zr;var Qr=Object.prototype,to=Qr.hasOwnProperty;function eo(t,e,r){var o=t[e];(!(to.call(t,e)&&X(o,r))||r===void 0&&!(e in t))&&Y(t,e,r)}var Z=eo;function ro(t,e,r,o){var a=!r;r||(r={});for(var f=-1,s=e.length;++f<s;){var n=e[f],l=o?o(r[n],t[n],n,r,t):void 0;l===void 0&&(l=t[n]),a?Y(r,n,l):Z(r,n,l)}return r}var T=ro;var oo=9007199254740991;function ao(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=oo}var Q=ao;function fo(t){return t!=null&&Q(t.length)&&!H(t)}var tt=fo;var so=Object.prototype;function po(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||so;return t===r}var E=po;function io(t,e){for(var r=-1,o=Array(t);++r<t;)o[r]=e(r);return o}var Nt=io;var no="[object Arguments]";function uo(t){return c(t)&&h(t)==no}var xt=uo;var Rt=Object.prototype,mo=Rt.hasOwnProperty,lo=Rt.propertyIsEnumerable,co=xt(function(){return arguments}())?xt:function(t){return c(t)&&mo.call(t,"callee")&&!lo.call(t,"callee")},Ut=co;function xo(){return!1}var Gt=xo;var Kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wt=Kt&&typeof module=="object"&&module&&!module.nodeType&&module,go=Wt&&Wt.exports===Kt,Vt=go?u.Buffer:void 0,ho=Vt?Vt.isBuffer:void 0,yo=ho||Gt,et=yo;var bo="[object Arguments]",vo="[object Array]",jo="[object Boolean]",To="[object Date]",Oo="[object Error]",_o="[object Function]",Ao="[object Map]",wo="[object Number]",So="[object Object]",Io="[object RegExp]",Po="[object Set]",Co="[object String]",Eo="[object WeakMap]",Bo="[object ArrayBuffer]",Lo="[object DataView]",Mo="[object Float32Array]",Do="[object Float64Array]",Fo="[object Int8Array]",No="[object Int16Array]",Ro="[object Int32Array]",Uo="[object Uint8Array]",Go="[object Uint8ClampedArray]",Wo="[object Uint16Array]",Vo="[object Uint32Array]",i={};i[Mo]=i[Do]=i[Fo]=i[No]=i[Ro]=i[Uo]=i[Go]=i[Wo]=i[Vo]=!0;i[bo]=i[vo]=i[Bo]=i[jo]=i[Lo]=i[To]=i[Oo]=i[_o]=i[Ao]=i[wo]=i[So]=i[Io]=i[Po]=i[Co]=i[Eo]=!1;function Ko(t){return c(t)&&Q(t.length)&&!!i[h(t)]}var zt=Ko;function zo(t){return function(e){return t(e)}}var B=zo;var kt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,K=kt&&typeof module=="object"&&module&&!module.nodeType&&module,ko=K&&K.exports===kt,gt=ko&&q.process,qo=function(){try{var t=K&&K.require&&K.require("util").types;return t||gt&>.binding&>.binding("util")}catch{}}(),b=qo;var qt=b&&b.isTypedArray,Ho=qt?B(qt):zt,Ht=Ho;var $o=Object.prototype,Jo=$o.hasOwnProperty;function Yo(t,e){var r=C(t),o=!r&&Ut(t),a=!r&&!o&&et(t),f=!r&&!o&&!a&&Ht(t),s=r||o||a||f,n=s?Nt(t.length,String):[],l=n.length;for(var d in t)(e||Jo.call(t,d))&&!(s&&(d=="length"||a&&(d=="offset"||d=="parent")||f&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ft(d,l)))&&n.push(d);return n}var rt=Yo;function Xo(t,e){return function(r){return t(e(r))}}var ot=Xo;var Zo=ot(Object.keys,Object),$t=Zo;var Qo=Object.prototype,ta=Qo.hasOwnProperty;function ea(t){if(!E(t))return $t(t);var e=[];for(var r in Object(t))ta.call(t,r)&&r!="constructor"&&e.push(r);return e}var Jt=ea;function ra(t){return tt(t)?rt(t):Jt(t)}var L=ra;function oa(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Yt=oa;var aa=Object.prototype,fa=aa.hasOwnProperty;function sa(t){if(!x(t))return Yt(t);var e=E(t),r=[];for(var o in t)o=="constructor"&&(e||!fa.call(t,o))||r.push(o);return r}var Xt=sa;function pa(t){return tt(t)?rt(t,!0):Xt(t)}var M=pa;var ia=m(Object,"create"),v=ia;function na(){this.__data__=v?v(null):{},this.size=0}var Zt=na;function ua(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Qt=ua;var ma="__lodash_hash_undefined__",la=Object.prototype,da=la.hasOwnProperty;function ca(t){var e=this.__data__;if(v){var r=e[t];return r===ma?void 0:r}return da.call(e,t)?e[t]:void 0}var te=ca;var xa=Object.prototype,ga=xa.hasOwnProperty;function ha(t){var e=this.__data__;return v?e[t]!==void 0:ga.call(e,t)}var ee=ha;var ya="__lodash_hash_undefined__";function ba(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=v&&e===void 0?ya:e,this}var re=ba;function D(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}D.prototype.clear=Zt;D.prototype.delete=Qt;D.prototype.get=te;D.prototype.has=ee;D.prototype.set=re;var ht=D;function va(){this.__data__=[],this.size=0}var oe=va;function ja(t,e){for(var r=t.length;r--;)if(X(t[r][0],e))return r;return-1}var O=ja;var Ta=Array.prototype,Oa=Ta.splice;function _a(t){var e=this.__data__,r=O(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Oa.call(e,r,1),--this.size,!0}var ae=_a;function Aa(t){var e=this.__data__,r=O(e,t);return r<0?void 0:e[r][1]}var fe=Aa;function wa(t){return O(this.__data__,t)>-1}var se=wa;function Sa(t,e){var r=this.__data__,o=O(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}var pe=Sa;function F(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}F.prototype.clear=oe;F.prototype.delete=ae;F.prototype.get=fe;F.prototype.has=se;F.prototype.set=pe;var _=F;var Ia=m(u,"Map"),A=Ia;function Pa(){this.size=0,this.__data__={hash:new ht,map:new(A||_),string:new ht}}var ie=Pa;function Ca(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ne=Ca;function Ea(t,e){var r=t.__data__;return ne(e)?r[typeof e=="string"?"string":"hash"]:r.map}var w=Ea;function Ba(t){var e=w(this,t).delete(t);return this.size-=e?1:0,e}var ue=Ba;function La(t){return w(this,t).get(t)}var me=La;function Ma(t){return w(this,t).has(t)}var le=Ma;function Da(t,e){var r=w(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}var de=Da;function N(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=ie;N.prototype.delete=ue;N.prototype.get=me;N.prototype.has=le;N.prototype.set=de;var ce=N;function Fa(t,e){for(var r=-1,o=e.length,a=t.length;++r<o;)t[a+r]=e[r];return t}var at=Fa;var Na=ot(Object.getPrototypeOf,Object),ft=Na;function Ra(){this.__data__=new _,this.size=0}var xe=Ra;function Ua(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ge=Ua;function Ga(t){return this.__data__.get(t)}var he=Ga;function Wa(t){return this.__data__.has(t)}var ye=Wa;var Va=200;function Ka(t,e){var r=this.__data__;if(r instanceof _){var o=r.__data__;if(!A||o.length<Va-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new ce(o)}return r.set(t,e),this.size=r.size,this}var be=Ka;function R(t){var e=this.__data__=new _(t);this.size=e.size}R.prototype.clear=xe;R.prototype.delete=ge;R.prototype.get=he;R.prototype.has=ye;R.prototype.set=be;var ve=R;function za(t,e){return t&&T(e,L(e),t)}var je=za;function ka(t,e){return t&&T(e,M(e),t)}var Te=ka;var we=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Oe=we&&typeof module=="object"&&module&&!module.nodeType&&module,qa=Oe&&Oe.exports===we,_e=qa?u.Buffer:void 0,Ae=_e?_e.allocUnsafe:void 0;function Ha(t,e){if(e)return t.slice();var r=t.length,o=Ae?Ae(r):new t.constructor(r);return t.copy(o),o}var Se=Ha;function $a(t,e){for(var r=-1,o=t==null?0:t.length,a=0,f=[];++r<o;){var s=t[r];e(s,r,t)&&(f[a++]=s)}return f}var Ie=$a;function Ja(){return[]}var st=Ja;var Ya=Object.prototype,Xa=Ya.propertyIsEnumerable,Pe=Object.getOwnPropertySymbols,Za=Pe?function(t){return t==null?[]:(t=Object(t),Ie(Pe(t),function(e){return Xa.call(t,e)}))}:st,U=Za;function Qa(t,e){return T(t,U(t),e)}var Ce=Qa;var tf=Object.getOwnPropertySymbols,ef=tf?function(t){for(var e=[];t;)at(e,U(t)),t=ft(t);return e}:st,pt=ef;function rf(t,e){return T(t,pt(t),e)}var Ee=rf;function of(t,e,r){var o=e(t);return C(t)?o:at(o,r(t))}var it=of;function af(t){return it(t,L,U)}var Be=af;function ff(t){return it(t,M,pt)}var Le=ff;var sf=m(u,"DataView"),nt=sf;var pf=m(u,"Promise"),ut=pf;var nf=m(u,"Set"),mt=nf;var Me="[object Map]",uf="[object Object]",De="[object Promise]",Fe="[object Set]",Ne="[object WeakMap]",Re="[object DataView]",mf=y(nt),lf=y(A),df=y(ut),cf=y(mt),xf=y(J),I=h;(nt&&I(new nt(new ArrayBuffer(1)))!=Re||A&&I(new A)!=Me||ut&&I(ut.resolve())!=De||mt&&I(new mt)!=Fe||J&&I(new J)!=Ne)&&(I=function(t){var e=h(t),r=e==uf?t.constructor:void 0,o=r?y(r):"";if(o)switch(o){case mf:return Re;case lf:return Me;case df:return De;case cf:return Fe;case xf:return Ne}return e});var G=I;var gf=Object.prototype,hf=gf.hasOwnProperty;function yf(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&hf.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Ue=yf;var bf=u.Uint8Array,yt=bf;function vf(t){var e=new t.constructor(t.byteLength);return new yt(e).set(new yt(t)),e}var W=vf;function jf(t,e){var r=e?W(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Ge=jf;var Tf=/\w*$/;function Of(t){var e=new t.constructor(t.source,Tf.exec(t));return e.lastIndex=t.lastIndex,e}var We=Of;var Ve=g?g.prototype:void 0,Ke=Ve?Ve.valueOf:void 0;function _f(t){return Ke?Object(Ke.call(t)):{}}var ze=_f;function Af(t,e){var r=e?W(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var ke=Af;var wf="[object Boolean]",Sf="[object Date]",If="[object Map]",Pf="[object Number]",Cf="[object RegExp]",Ef="[object Set]",Bf="[object String]",Lf="[object Symbol]",Mf="[object ArrayBuffer]",Df="[object DataView]",Ff="[object Float32Array]",Nf="[object Float64Array]",Rf="[object Int8Array]",Uf="[object Int16Array]",Gf="[object Int32Array]",Wf="[object Uint8Array]",Vf="[object Uint8ClampedArray]",Kf="[object Uint16Array]",zf="[object Uint32Array]";function kf(t,e,r){var o=t.constructor;switch(e){case Mf:return W(t);case wf:case Sf:return new o(+t);case Df:return Ge(t,r);case Ff:case Nf:case Rf:case Uf:case Gf:case Wf:case Vf:case Kf:case zf:return ke(t,r);case If:return new o;case Pf:case Bf:return new o(t);case Cf:return We(t);case Ef:return new o;case Lf:return ze(t)}}var qe=kf;function qf(t){return typeof t.constructor=="function"&&!E(t)?Lt(ft(t)):{}}var He=qf;var Hf="[object Map]";function $f(t){return c(t)&&G(t)==Hf}var $e=$f;var Je=b&&b.isMap,Jf=Je?B(Je):$e,Ye=Jf;var Yf="[object Set]";function Xf(t){return c(t)&&G(t)==Yf}var Xe=Xf;var Ze=b&&b.isSet,Zf=Ze?B(Ze):Xe,Qe=Zf;var Qf=1,ts=2,es=4,tr="[object Arguments]",rs="[object Array]",os="[object Boolean]",as="[object Date]",fs="[object Error]",er="[object Function]",ss="[object GeneratorFunction]",ps="[object Map]",is="[object Number]",rr="[object Object]",ns="[object RegExp]",us="[object Set]",ms="[object String]",ls="[object Symbol]",ds="[object WeakMap]",cs="[object ArrayBuffer]",xs="[object DataView]",gs="[object Float32Array]",hs="[object Float64Array]",ys="[object Int8Array]",bs="[object Int16Array]",vs="[object Int32Array]",js="[object Uint8Array]",Ts="[object Uint8ClampedArray]",Os="[object Uint16Array]",_s="[object Uint32Array]",p={};p[tr]=p[rs]=p[cs]=p[xs]=p[os]=p[as]=p[gs]=p[hs]=p[ys]=p[bs]=p[vs]=p[ps]=p[is]=p[rr]=p[ns]=p[us]=p[ms]=p[ls]=p[js]=p[Ts]=p[Os]=p[_s]=!0;p[fs]=p[er]=p[ds]=!1;function lt(t,e,r,o,a,f){var s,n=e&Qf,l=e&ts,d=e&es;if(r&&(s=a?r(t,o,a,f):r(t)),s!==void 0)return s;if(!x(t))return t;var vt=C(t);if(vt){if(s=Ue(t),!n)return Mt(t,s)}else{var P=G(t),jt=P==er||P==ss;if(et(t))return Se(t,n);if(P==rr||P==tr||jt&&!a){if(s=l||jt?{}:He(t),!n)return l?Ee(t,Te(s,t)):Ce(t,je(s,t))}else{if(!p[P])return a?t:{};s=qe(t,P,n)}}f||(f=new ve);var Tt=f.get(t);if(Tt)return Tt;f.set(t,s),Qe(t)?t.forEach(function(j){s.add(lt(j,e,r,j,t,f))}):Ye(t)&&t.forEach(function(j,S){s.set(S,lt(j,e,r,S,t,f))});var ar=d?l?Le:Be:l?M:L,Ot=vt?void 0:ar(t);return Dt(Ot||t,function(j,S){Ot&&(S=j,j=t[S]),Z(s,S,lt(j,e,r,S,t,f))}),s}var or=lt;var As=1,ws=4;function Ss(t){return or(t,As|ws)}var dt=Ss;var z=class{init(){}constructor(e,r){}};var bt=class extends z{constructor(){super(...arguments);k(this,"Vue");k(this,"projects");k(this,"state",null)}bindProjectState(r){let o={component:null,componentKey:null,autoRequire:!0,write:!0,...r};return Promise.resolve().then(()=>Promise.all([this.getProjectState({autoRequire:o.autoRequire}),(()=>{if(!o.componentKey){for(let a=0;a<50;a++){let f=`terafy_${a}`;if(!Object.hasOwnProperty(o.component,f)){o.componentKey=f;return}}throw new Error("Unable to find unique key to allocate against Vue2 component")}})()])).then(([a])=>{this.debug("Got project snapshot",a);let f=this.Vue.observable(a);o.component[o.componentKey]=f;let s=0;if(o.read&&this.events.on(`update:projects/${f.id}`,n=>{s++,this.merge(f,n)}),o.write){if(!o.component)throw new Error("bindProjectState requires a VueComponent specified as `component`");let n=dt(a);o.component.$watch(o.componentKey,l=>{if(s>0){s--;return}this.createProjectStatePatch(l,n),n=dt(a)},{deep:!0})}return f})}merge(r,o){return o.forEach(a=>Object.keys(a).forEach(f=>this.Vue.set(r,f,a[f]))),r}init(r){let o={app:null,Vue:null,globalName:"$tera",requireProject:!0,subscribeState:!0,subscribeProjects:!0,stateOptions:{read:!0,write:!0},...r};if(!o.Vue)throw new Error("Vue instance to use must be specified in init options as `Vue`");if(this.Vue=r.Vue,!this.settings.app)throw new Error("Need to specify the root level Vue2 app during init");return o.stateOptions.app=this.settings.app,this.projects=this.Vue.observable([]),o.globalName&&(this.Vue.prototype[o.globalName]=this),this.state=null,Promise.resolve().then(()=>o.requireProject&&this.requireProject()).then(()=>Promise.all([o.subscribeState&&this.bindProjectState({...o.stateOptions,component:this.settings.app.$root}).then(a=>this.state=a).then(()=>this.debug("INFO","Loaded project state",this.state)),o.subscribeProjects&&this.getProjects().then(a=>this.projects=this.Vue.observable(a)).then(()=>this.debug("INFO","Loaded projects",this.projects))]))}};export{bt as default};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
lodash-es/lodash.js:
|
package/lib/terafy.client.js
CHANGED
|
@@ -290,7 +290,7 @@ export default class TeraFy {
|
|
|
290
290
|
*
|
|
291
291
|
* @returns {Promise} A promise which will resolve when the operation has completed
|
|
292
292
|
*/
|
|
293
|
-
applyProjectStatePatchLocal(patch) {
|
|
293
|
+
applyProjectStatePatchLocal(patch) { // eslint-disable-line
|
|
294
294
|
throw new Error('applyProjectStatePatchLocal() has not been sub-classed by a plugin');
|
|
295
295
|
}
|
|
296
296
|
// }}}
|
package/lib/terafy.server.js
CHANGED
|
@@ -372,10 +372,7 @@ export default class TeraFyServer {
|
|
|
372
372
|
].filter(Boolean).join(' '),
|
|
373
373
|
isSubscribed: $subscriptions.isSubscribed,
|
|
374
374
|
} : null)
|
|
375
|
-
.catch(e =>
|
|
376
|
-
console.warn('Catch', e);
|
|
377
|
-
debugger;
|
|
378
|
-
})
|
|
375
|
+
.catch(e => console.warn('getUser() catch', e))
|
|
379
376
|
}
|
|
380
377
|
|
|
381
378
|
|
|
@@ -409,8 +406,6 @@ export default class TeraFyServer {
|
|
|
409
406
|
|
|
410
407
|
// Go back to start of auth checking loop and repull the user data
|
|
411
408
|
throw 'REDO';
|
|
412
|
-
|
|
413
|
-
break;
|
|
414
409
|
default:
|
|
415
410
|
// Pass - Implied - Cannot authenticate via other method so just fall through to scalding the user
|
|
416
411
|
}
|
|
@@ -972,7 +967,7 @@ export default class TeraFyServer {
|
|
|
972
967
|
* @returns {Promise} A promise which will resolve when the write operation has completed
|
|
973
968
|
*/
|
|
974
969
|
setProjectFile(path, contents) {
|
|
975
|
-
return app.service('$supabase').
|
|
970
|
+
return app.service('$supabase').fileSet(path, contents, {
|
|
976
971
|
overwrite: true,
|
|
977
972
|
toast: false,
|
|
978
973
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iebh/tera-fy",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "TERA website worker",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "esbuild --platform=browser --format=esm --bundle lib/terafy.client.js --outfile=dist/terafy.js --minify --serve --servedir=.",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build:plugins-vue2:es2019": "esbuild --platform=browser --format=esm --target=es2019 --bundle plugins/vue2.js --outfile=dist/plugin.vue2.es2019.js --minify",
|
|
11
11
|
"build:docs:api": "documentation build lib/terafy.client.js lib/projectFile.js --format html --config documentation.yml --output docs/",
|
|
12
12
|
"build:docs:markdown": "documentation build lib/terafy.client.js lib/projectFile.js --format md --markdown-toc --output api.md",
|
|
13
|
-
"lint": "eslint
|
|
13
|
+
"lint": "eslint lib plugins utils widgets",
|
|
14
14
|
"release": "release-it --increment=patch",
|
|
15
15
|
"watch": "nodemon --watch lib --exec npm run build"
|
|
16
16
|
},
|
package/plugins/base.js
CHANGED
|
@@ -19,6 +19,6 @@ export default class TeraFyPlugin {
|
|
|
19
19
|
* @param {TeraFy} terafy The TeraFy client this plugin is being initalized against
|
|
20
20
|
* @param {Object} [options] Additional options to mutate behaviour
|
|
21
21
|
*/
|
|
22
|
-
constructor(terafy, options) {
|
|
22
|
+
constructor(terafy, options) { // eslint-disable-line
|
|
23
23
|
}
|
|
24
24
|
}
|
package/plugins/vue2.js
CHANGED
|
@@ -31,6 +31,7 @@ export default class TeraFyPluginVue2 extends TeraFyPluginBase {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Local Vue@2 library to use, set during constuctor
|
|
34
|
+
*
|
|
34
35
|
* @type {Vue}
|
|
35
36
|
*/
|
|
36
37
|
Vue;
|
|
@@ -92,7 +93,7 @@ export default class TeraFyPluginVue2 extends TeraFyPluginBase {
|
|
|
92
93
|
if (settings.read) {
|
|
93
94
|
this.events.on(`update:projects/${stateObservable.id}`, newState => {
|
|
94
95
|
skipUpdate++; // Skip next update as we're updating our own state anyway
|
|
95
|
-
|
|
96
|
+
this.merge(stateObservable, newState);
|
|
96
97
|
});
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -128,9 +129,30 @@ export default class TeraFyPluginVue2 extends TeraFyPluginBase {
|
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Internal function to merge an existing Vue2 Observable with an incomming object
|
|
134
|
+
*
|
|
135
|
+
* @param {VueObservable} target The target object to merge with
|
|
136
|
+
* @param {Object} payload The sub-objects to merge into the Observable
|
|
137
|
+
* @returns {VueObservable} The input target with all payloads merged
|
|
138
|
+
*/
|
|
139
|
+
merge(target, payload) {
|
|
140
|
+
payload.forEach(pl =>
|
|
141
|
+
Object.keys(pl)
|
|
142
|
+
.forEach(k =>
|
|
143
|
+
this.Vue.set(target, k, pl[k])
|
|
144
|
+
)
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
return target;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
131
152
|
/**
|
|
132
153
|
* List of available projects for the current session
|
|
133
154
|
* Initalized during constructor
|
|
155
|
+
*
|
|
134
156
|
* @type {VueReactive<Array<Object>>}
|
|
135
157
|
*/
|
|
136
158
|
projects;
|
|
@@ -139,6 +161,7 @@ export default class TeraFyPluginVue2 extends TeraFyPluginBase {
|
|
|
139
161
|
/**
|
|
140
162
|
* The bound, reactive state of a Vue project
|
|
141
163
|
* When loaded this represents the state of a project as an object
|
|
164
|
+
*
|
|
142
165
|
* @type {Object}
|
|
143
166
|
*/
|
|
144
167
|
state = null;
|