pict 1.0.251 → 1.0.253
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/dist/pict.compatible.js +500 -476
- package/dist/pict.compatible.js.map +1 -1
- package/dist/pict.compatible.min.js +2 -2
- package/dist/pict.compatible.min.js.map +1 -1
- package/dist/pict.js +174 -150
- package/dist/pict.js.map +1 -1
- package/dist/pict.min.js +2 -2
- package/dist/pict.min.js.map +1 -1
- package/package.json +3 -3
- package/source/Pict-Meadow-EntityProvider.js +78 -1
- package/source/Pict.js +2 -0
- package/source/templates/Pict-Template-TemplateByReference.js +154 -0
- package/test/Pict_entityprovider_tests.js +6 -0
- package/test/Pict_template_tests.js +6 -0
- package/types/source/Pict-Meadow-EntityProvider.d.ts +1 -0
- package/types/source/Pict-Meadow-EntityProvider.d.ts.map +1 -1
- package/types/source/Pict.d.ts.map +1 -1
- package/types/source/templates/Pict-Template-TemplateByReference.d.ts +15 -0
- package/types/source/templates/Pict-Template-TemplateByReference.d.ts.map +1 -0
- package/types/source/templates/Pict-Template-TemplateSetWithPayload.d.ts +2 -2
- package/types/source/templates/Pict-Template-TemplateSetWithPayload.d.ts.map +1 -1
package/dist/pict.compatible.js
CHANGED
|
@@ -442,7 +442,7 @@ if(fPruneFunction(tmpNode.Datum,tmpNode.Hash,tmpNode)){tmpRemovedRecords.push(th
|
|
|
442
442
|
if(this._List.length<1){return fComplete(tmpRemovedRecords);}// Now prune based on expiration time
|
|
443
443
|
this.pruneBasedOnExpiration(function(fExpirationPruneComplete){// Now prune based on length, then return the removed records in the callback.
|
|
444
444
|
_this4.pruneBasedOnLength(fComplete,tmpRemovedRecords);},tmpRemovedRecords);}// Get a low level node (including metadata statistics) by hash from the cache
|
|
445
|
-
},{key:"getNode",value:function getNode(pHash){if(!this._HashMap.hasOwnProperty(pHash))return false;return this._HashMap[pHash];}}]);}(libFableServiceProviderBase);module.exports=CashMoney;},{"./LinkedList.js":24,"fable-serviceproviderbase":
|
|
445
|
+
},{key:"getNode",value:function getNode(pHash){if(!this._HashMap.hasOwnProperty(pHash))return false;return this._HashMap[pHash];}}]);}(libFableServiceProviderBase);module.exports=CashMoney;},{"./LinkedList.js":24,"fable-serviceproviderbase":59}],23:[function(require,module,exports){/**
|
|
446
446
|
* Double Linked List Node
|
|
447
447
|
*
|
|
448
448
|
* @author Steven Velozo <steven@velozo.com>
|
|
@@ -493,11 +493,78 @@ else tmpNode=tmpNode.RightNode;// Call the actual action
|
|
|
493
493
|
// I hate this pattern because long tails eventually cause stack overflows.
|
|
494
494
|
fAction(tmpNode.Datum,tmpNode.Hash,_fIterator);};// Now kick off the iterator
|
|
495
495
|
return _fIterator();}// Seek a specific node, 0 is the index of the first node.
|
|
496
|
-
},{key:"seek",value:function seek(pNodeIndex){if(!pNodeIndex)return false;if(this.length<1)return false;if(pNodeIndex>=this.length)return false;var tmpNode=this.head;for(var i=0;i<pNodeIndex;i++){tmpNode=tmpNode.RightNode;}return tmpNode;}}]);}();module.exports=LinkedList;},{"./LinkedList-Node.js":23}],25:[function(require,module,exports){'use strict';var bind=require('function-bind');var $apply=require('./functionApply');var $call=require('./functionCall');var $reflectApply=require('./reflectApply');/** @type {import('./actualApply')} */module.exports=$reflectApply||bind.call($call,$apply);},{"./functionApply":26,"./functionCall":27,"./reflectApply":29,"function-bind":102}],26:[function(require,module,exports){'use strict';/** @type {import('./functionApply')} */module.exports=Function.prototype.apply;},{}],27:[function(require,module,exports){'use strict';/** @type {import('./functionCall')} */module.exports=Function.prototype.call;},{}],28:[function(require,module,exports){'use strict';var bind=require('function-bind');var $TypeError=require('es-errors/type');var $call=require('./functionCall');var $actualApply=require('./actualApply');/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */module.exports=function callBindBasic(args){if(args.length<1||typeof args[0]!=='function'){throw new $TypeError('a function is required');}return $actualApply(bind,$call,args);};},{"./actualApply":25,"./functionCall":27,"es-errors/type":46,"function-bind":102}],29:[function(require,module,exports){'use strict';/** @type {import('./reflectApply')} */module.exports=typeof Reflect!=='undefined'&&Reflect&&Reflect.apply;},{}],30:[function(require,module,exports){'use strict';var GetIntrinsic=require('get-intrinsic');var callBindBasic=require('call-bind-apply-helpers');/** @type {(thisArg: string, searchString: string, position?: number) => number} */var $indexOf=callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);/** @type {import('.')} */module.exports=function callBoundIntrinsic(name,allowMissing){/* eslint no-extra-parens: 0 */var intrinsic=/** @type {(this: unknown, ...args: unknown[]) => unknown} */GetIntrinsic(name,!!allowMissing);if(typeof intrinsic==='function'&&$indexOf(name,'.prototype.')>-1){return callBindBasic(/** @type {const} */[intrinsic]);}return intrinsic;};},{"call-bind-apply-helpers":28,"get-intrinsic":103}],31:[function(require,module,exports){!function(t,e){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e();}(this,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function ordinal(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]";}},m=function m(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t;},v={s:m,z:function z(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0");},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0);},a:function a(t){return t<0?Math.ceil(t)||0:Math.floor(t);},p:function p(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"");},u:function u(t){return void 0===t;}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function S(t){return t instanceof _||!(!t||!t[p]);},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0]);}else{var a=e.name;D[a]=e,i=a;}return!r&&i&&(g=i),i||!r&&g;},O=function O(t,e){if(S(t))return t.clone();var n="object"==_typeof(e)?e:{};return n.date=t,n.args=arguments,new _(n);},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset});};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date();if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s);}}return new Date(e);}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b;},m.isValid=function(){return!(this.$d.toString()===l);},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e);},m.isAfter=function(t,e){return O(t)<this.startOf(e);},m.isBefore=function(t,e){return this.endOf(e)<O(t);},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t);},m.unix=function(){return Math.floor(this.valueOf()/1e3);},m.valueOf=function(){return this.$d.getTime();},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function l(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a);},$=function $(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n);},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone();}},m.endOf=function(t){return this.startOf(t,!1);},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this;},m.set=function(t,e){return this.clone().$set(t,e);},m.get=function(t){return this[b.p(t)]();},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function y(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l);};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this);},m.subtract=function(t,e){return this.add(-1*t,e);},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function h(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s);},d=function d(t){return b.s(s%12||12,t,"0");},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r;};return r.replace(y,function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i;}return null;}(t)||i.replace(":","");});},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15);},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function D(){return b.m(y,m);};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($);},m.daysInMonth=function(){return this.endOf(c).$D;},m.$locale=function(){return D[this.$L];},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n;},m.clone=function(){return b.w(this.$d,this);},m.toDate=function(){return new Date(this.valueOf());},m.toJSON=function(){return this.isValid()?this.toISOString():null;},m.toISOString=function(){return this.$d.toISOString();},m.toString=function(){return this.$d.toUTCString();},M;}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach(function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1]);};}),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O;},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t);},O.en=D[g],O.Ls=D,O.p={},O;});},{}],32:[function(require,module,exports){!function(e,t){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_advancedFormat=t();}(this,function(){"use strict";return function(e,t){var r=t.prototype,n=r.format;r.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return n.bind(this)(e);var s=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return r.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return r.ordinal(t.week(),"W");case"w":case"ww":return s.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return s.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return s.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e;}});return n.bind(this)(a);};};});},{}],33:[function(require,module,exports){!function(e,t){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isoWeek=t();}(this,function(){"use strict";var e="day";return function(t,i,s){var a=function a(t){return t.add(4-t.isoWeekday(),e);},d=i.prototype;d.isoWeekYear=function(){return a(this).year();},d.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var i,d,n,o,r=a(this),u=(i=this.isoWeekYear(),d=this.$u,n=(d?s.utc:s)().year(i).startOf("year"),o=4-n.isoWeekday(),n.isoWeekday()>4&&(o+=7),n.add(o,e));return r.diff(u,"week")+1;},d.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7);};var n=d.startOf;d.startOf=function(e,t){var i=this.$utils(),s=!!i.u(t)||t;return"isoweek"===i.p(e)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(e,t);};};});},{}],34:[function(require,module,exports){!function(r,e){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_relativeTime=e();}(this,function(){"use strict";return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o);}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break;}}if(n)return a;var M=s?l.future:l.past;return"function"==typeof M?M(a):M.replace("%s",a);},n.to=function(r,e){return i(r,e,this,!0);},n.from=function(r,e){return i(r,e,this);};var d=function d(r){return r.$u?t.utc():t();};n.toNow=function(r){return this.to(d(this),r);},n.fromNow=function(r){return this.from(d(this),r);};};});},{}],35:[function(require,module,exports){!function(t,e){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_timezone=e();}(this,function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,o){var r,a=function a(t,n,i){void 0===i&&(i={});var o=new Date(t),r=function(t,n){void 0===n&&(n={});var i=n.timeZoneName||"short",o=t+"|"+i,r=e[o];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),e[o]=r),r;}(n,i);return r.formatToParts(o);},u=function u(e,n){for(var i=a(e,n),r=[],u=0;u<i.length;u+=1){var f=i[u],s=f.type,m=f.value,c=t[s];c>=0&&(r[c]=parseInt(m,10));}var d=r[3],l=24===d?0:d,h=r[0]+"-"+r[1]+"-"+r[2]+" "+l+":"+r[4]+":"+r[5]+":000",v=+e;return(o.utc(h).valueOf()-(v-=v%1e3))/6e4;},f=i.prototype;f.tz=function(t,e){void 0===t&&(t=r);var n,i=this.utcOffset(),a=this.toDate(),u=a.toLocaleString("en-US",{timeZone:t}),f=Math.round((a-new Date(u))/1e3/60),s=15*-Math.round(a.getTimezoneOffset()/15)-f;if(!Number(s))n=this.utcOffset(0,e);else if(n=o(u,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(s,!0),e){var m=n.utcOffset();n=n.add(i-m,"minute");}return n.$x.$timezone=t,n;},f.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase();});return n&&n.value;};var s=f.startOf;f.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return s.call(this,t,e);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return s.call(n,t,e).tz(this.$x.$timezone,!0);},o.tz=function(t,e,n){var i=n&&e,a=n||e||r,f=u(+o(),a);if("string"!=typeof t)return o(t).tz(a);var s=function(t,e,n){var i=t-60*e*1e3,o=u(i,n);if(e===o)return[i,e];var r=u(i-=60*(o-e)*1e3,n);return o===r?[i,o]:[t-60*Math.min(o,r)*1e3,Math.max(o,r)];}(o.utc(t,i).valueOf(),f,a),m=s[0],c=s[1],d=o(m).utcOffset(c);return d.$x.$timezone=a,d;},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone;},o.tz.setDefault=function(t){r=t;};};});},{}],36:[function(require,module,exports){!function(t,i){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_utc=i();}(this,function(){"use strict";var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i);},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e;},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1});};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t);};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else r.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u;}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r;}else o=this.utc();return o;};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i);},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t;},u.isUTC=function(){return!!this.$u;},u.toISOString=function(){return this.toDate().toISOString();},u.toString=function(){return this.toDate().toUTCString();};var l=u.toDate;u.toDate=function(t){return"s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this);};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e);};};});},{}],37:[function(require,module,exports){!function(e,t){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekOfYear=t();}(this,function(){"use strict";var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1;}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o);},f.weeks=function(e){return void 0===e&&(e=null),this.week(e);};};});},{}],38:[function(require,module,exports){!function(e,t){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekday=t();}(this,function(){"use strict";return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(i<t?i+7:i)-t;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day");};};});},{}],39:[function(require,module,exports){'use strict';var callBind=require('call-bind-apply-helpers');var gOPD=require('gopd');var hasProtoAccessor;try{// eslint-disable-next-line no-extra-parens, no-proto
|
|
496
|
+
},{key:"seek",value:function seek(pNodeIndex){if(!pNodeIndex)return false;if(this.length<1)return false;if(pNodeIndex>=this.length)return false;var tmpNode=this.head;for(var i=0;i<pNodeIndex;i++){tmpNode=tmpNode.RightNode;}return tmpNode;}}]);}();module.exports=LinkedList;},{"./LinkedList-Node.js":23}],25:[function(require,module,exports){'use strict';var bind=require('function-bind');var $apply=require('./functionApply');var $call=require('./functionCall');var $reflectApply=require('./reflectApply');/** @type {import('./actualApply')} */module.exports=$reflectApply||bind.call($call,$apply);},{"./functionApply":26,"./functionCall":27,"./reflectApply":29,"function-bind":102}],26:[function(require,module,exports){'use strict';/** @type {import('./functionApply')} */module.exports=Function.prototype.apply;},{}],27:[function(require,module,exports){'use strict';/** @type {import('./functionCall')} */module.exports=Function.prototype.call;},{}],28:[function(require,module,exports){'use strict';var bind=require('function-bind');var $TypeError=require('es-errors/type');var $call=require('./functionCall');var $actualApply=require('./actualApply');/** @type {import('.')} */module.exports=function callBindBasic(args){if(args.length<1||typeof args[0]!=='function'){throw new $TypeError('a function is required');}return $actualApply(bind,$call,args);};},{"./actualApply":25,"./functionCall":27,"es-errors/type":47,"function-bind":102}],29:[function(require,module,exports){'use strict';/** @type {import('./reflectApply')} */module.exports=typeof Reflect!=='undefined'&&Reflect&&Reflect.apply;},{}],30:[function(require,module,exports){'use strict';var GetIntrinsic=require('get-intrinsic');var callBindBasic=require('call-bind-apply-helpers');/** @type {(thisArg: string, searchString: string, position?: number) => number} */var $indexOf=callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);/** @type {import('.')} */module.exports=function callBoundIntrinsic(name,allowMissing){// eslint-disable-next-line no-extra-parens
|
|
497
|
+
var intrinsic=/** @type {Parameters<typeof callBindBasic>[0][0]} */GetIntrinsic(name,!!allowMissing);if(typeof intrinsic==='function'&&$indexOf(name,'.prototype.')>-1){return callBindBasic([intrinsic]);}return intrinsic;};},{"call-bind-apply-helpers":28,"get-intrinsic":103}],31:[function(require,module,exports){/*!
|
|
498
|
+
* cookie
|
|
499
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
500
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
501
|
+
* MIT Licensed
|
|
502
|
+
*/'use strict';/**
|
|
503
|
+
* Module exports.
|
|
504
|
+
* @public
|
|
505
|
+
*/exports.parse=parse;exports.serialize=serialize;/**
|
|
506
|
+
* Module variables.
|
|
507
|
+
* @private
|
|
508
|
+
*/var __toString=Object.prototype.toString;/**
|
|
509
|
+
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
510
|
+
*
|
|
511
|
+
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
|
|
512
|
+
* field-vchar = VCHAR / obs-text
|
|
513
|
+
* obs-text = %x80-FF
|
|
514
|
+
*/var fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;/**
|
|
515
|
+
* Parse a cookie header.
|
|
516
|
+
*
|
|
517
|
+
* Parse the given cookie header string into an object
|
|
518
|
+
* The object has the various cookies as keys(names) => values
|
|
519
|
+
*
|
|
520
|
+
* @param {string} str
|
|
521
|
+
* @param {object} [options]
|
|
522
|
+
* @return {object}
|
|
523
|
+
* @public
|
|
524
|
+
*/function parse(str,options){if(typeof str!=='string'){throw new TypeError('argument str must be a string');}var obj={};var opt=options||{};var dec=opt.decode||decode;var index=0;while(index<str.length){var eqIdx=str.indexOf('=',index);// no more cookie pairs
|
|
525
|
+
if(eqIdx===-1){break;}var endIdx=str.indexOf(';',index);if(endIdx===-1){endIdx=str.length;}else if(endIdx<eqIdx){// backtrack on prior semicolon
|
|
526
|
+
index=str.lastIndexOf(';',eqIdx-1)+1;continue;}var key=str.slice(index,eqIdx).trim();// only assign once
|
|
527
|
+
if(undefined===obj[key]){var val=str.slice(eqIdx+1,endIdx).trim();// quoted values
|
|
528
|
+
if(val.charCodeAt(0)===0x22){val=val.slice(1,-1);}obj[key]=tryDecode(val,dec);}index=endIdx+1;}return obj;}/**
|
|
529
|
+
* Serialize data into a cookie header.
|
|
530
|
+
*
|
|
531
|
+
* Serialize the a name value pair into a cookie string suitable for
|
|
532
|
+
* http headers. An optional options object specified cookie parameters.
|
|
533
|
+
*
|
|
534
|
+
* serialize('foo', 'bar', { httpOnly: true })
|
|
535
|
+
* => "foo=bar; httpOnly"
|
|
536
|
+
*
|
|
537
|
+
* @param {string} name
|
|
538
|
+
* @param {string} val
|
|
539
|
+
* @param {object} [options]
|
|
540
|
+
* @return {string}
|
|
541
|
+
* @public
|
|
542
|
+
*/function serialize(name,val,options){var opt=options||{};var enc=opt.encode||encode;if(typeof enc!=='function'){throw new TypeError('option encode is invalid');}if(!fieldContentRegExp.test(name)){throw new TypeError('argument name is invalid');}var value=enc(val);if(value&&!fieldContentRegExp.test(value)){throw new TypeError('argument val is invalid');}var str=name+'='+value;if(null!=opt.maxAge){var maxAge=opt.maxAge-0;if(isNaN(maxAge)||!isFinite(maxAge)){throw new TypeError('option maxAge is invalid');}str+='; Max-Age='+Math.floor(maxAge);}if(opt.domain){if(!fieldContentRegExp.test(opt.domain)){throw new TypeError('option domain is invalid');}str+='; Domain='+opt.domain;}if(opt.path){if(!fieldContentRegExp.test(opt.path)){throw new TypeError('option path is invalid');}str+='; Path='+opt.path;}if(opt.expires){var expires=opt.expires;if(!isDate(expires)||isNaN(expires.valueOf())){throw new TypeError('option expires is invalid');}str+='; Expires='+expires.toUTCString();}if(opt.httpOnly){str+='; HttpOnly';}if(opt.secure){str+='; Secure';}if(opt.partitioned){str+='; Partitioned';}if(opt.priority){var priority=typeof opt.priority==='string'?opt.priority.toLowerCase():opt.priority;switch(priority){case'low':str+='; Priority=Low';break;case'medium':str+='; Priority=Medium';break;case'high':str+='; Priority=High';break;default:throw new TypeError('option priority is invalid');}}if(opt.sameSite){var sameSite=typeof opt.sameSite==='string'?opt.sameSite.toLowerCase():opt.sameSite;switch(sameSite){case true:str+='; SameSite=Strict';break;case'lax':str+='; SameSite=Lax';break;case'strict':str+='; SameSite=Strict';break;case'none':str+='; SameSite=None';break;default:throw new TypeError('option sameSite is invalid');}}return str;}/**
|
|
543
|
+
* URL-decode string value. Optimized to skip native call when no %.
|
|
544
|
+
*
|
|
545
|
+
* @param {string} str
|
|
546
|
+
* @returns {string}
|
|
547
|
+
*/function decode(str){return str.indexOf('%')!==-1?decodeURIComponent(str):str;}/**
|
|
548
|
+
* URL-encode value.
|
|
549
|
+
*
|
|
550
|
+
* @param {string} val
|
|
551
|
+
* @returns {string}
|
|
552
|
+
*/function encode(val){return encodeURIComponent(val);}/**
|
|
553
|
+
* Determine if value is a Date.
|
|
554
|
+
*
|
|
555
|
+
* @param {*} val
|
|
556
|
+
* @private
|
|
557
|
+
*/function isDate(val){return __toString.call(val)==='[object Date]'||val instanceof Date;}/**
|
|
558
|
+
* Try decoding a string using a decoding function.
|
|
559
|
+
*
|
|
560
|
+
* @param {string} str
|
|
561
|
+
* @param {function} decode
|
|
562
|
+
* @private
|
|
563
|
+
*/function tryDecode(str,decode){try{return decode(str);}catch(e){return str;}}},{}],32:[function(require,module,exports){!function(t,e){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs=e();}(this,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function ordinal(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]";}},m=function m(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t;},v={s:m,z:function z(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0");},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0);},a:function a(t){return t<0?Math.ceil(t)||0:Math.floor(t);},p:function p(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"");},u:function u(t){return void 0===t;}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function S(t){return t instanceof _||!(!t||!t[p]);},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0]);}else{var a=e.name;D[a]=e,i=a;}return!r&&i&&(g=i),i||!r&&g;},O=function O(t,e){if(S(t))return t.clone();var n="object"==_typeof(e)?e:{};return n.date=t,n.args=arguments,new _(n);},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset});};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date();if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s);}}return new Date(e);}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b;},m.isValid=function(){return!(this.$d.toString()===l);},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e);},m.isAfter=function(t,e){return O(t)<this.startOf(e);},m.isBefore=function(t,e){return this.endOf(e)<O(t);},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t);},m.unix=function(){return Math.floor(this.valueOf()/1e3);},m.valueOf=function(){return this.$d.getTime();},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function l(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a);},$=function $(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n);},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone();}},m.endOf=function(t){return this.startOf(t,!1);},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this;},m.set=function(t,e){return this.clone().$set(t,e);},m.get=function(t){return this[b.p(t)]();},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function y(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l);};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this);},m.subtract=function(t,e){return this.add(-1*t,e);},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function h(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s);},d=function d(t){return b.s(s%12||12,t,"0");},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r;};return r.replace(y,function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i;}return null;}(t)||i.replace(":","");});},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15);},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function D(){return b.m(y,m);};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($);},m.daysInMonth=function(){return this.endOf(c).$D;},m.$locale=function(){return D[this.$L];},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n;},m.clone=function(){return b.w(this.$d,this);},m.toDate=function(){return new Date(this.valueOf());},m.toJSON=function(){return this.isValid()?this.toISOString():null;},m.toISOString=function(){return this.$d.toISOString();},m.toString=function(){return this.$d.toUTCString();},M;}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach(function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1]);};}),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O;},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t);},O.en=D[g],O.Ls=D,O.p={},O;});},{}],33:[function(require,module,exports){!function(e,t){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_advancedFormat=t();}(this,function(){"use strict";return function(e,t){var r=t.prototype,n=r.format;r.format=function(e){var t=this,r=this.$locale();if(!this.isValid())return n.bind(this)(e);var s=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return r.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return r.ordinal(t.week(),"W");case"w":case"ww":return s.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return s.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return s.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e;}});return n.bind(this)(a);};};});},{}],34:[function(require,module,exports){!function(e,t){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isoWeek=t();}(this,function(){"use strict";var e="day";return function(t,i,s){var a=function a(t){return t.add(4-t.isoWeekday(),e);},d=i.prototype;d.isoWeekYear=function(){return a(this).year();},d.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),e);var i,d,n,o,r=a(this),u=(i=this.isoWeekYear(),d=this.$u,n=(d?s.utc:s)().year(i).startOf("year"),o=4-n.isoWeekday(),n.isoWeekday()>4&&(o+=7),n.add(o,e));return r.diff(u,"week")+1;},d.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7);};var n=d.startOf;d.startOf=function(e,t){var i=this.$utils(),s=!!i.u(t)||t;return"isoweek"===i.p(e)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(e,t);};};});},{}],35:[function(require,module,exports){!function(r,e){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).dayjs_plugin_relativeTime=e();}(this,function(){"use strict";return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o);}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break;}}if(n)return a;var M=s?l.future:l.past;return"function"==typeof M?M(a):M.replace("%s",a);},n.to=function(r,e){return i(r,e,this,!0);},n.from=function(r,e){return i(r,e,this);};var d=function d(r){return r.$u?t.utc():t();};n.toNow=function(r){return this.to(d(this),r);},n.fromNow=function(r){return this.from(d(this),r);};};});},{}],36:[function(require,module,exports){!function(t,e){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_timezone=e();}(this,function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,o){var r,a=function a(t,n,i){void 0===i&&(i={});var o=new Date(t),r=function(t,n){void 0===n&&(n={});var i=n.timeZoneName||"short",o=t+"|"+i,r=e[o];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),e[o]=r),r;}(n,i);return r.formatToParts(o);},u=function u(e,n){for(var i=a(e,n),r=[],u=0;u<i.length;u+=1){var f=i[u],s=f.type,m=f.value,c=t[s];c>=0&&(r[c]=parseInt(m,10));}var d=r[3],l=24===d?0:d,h=r[0]+"-"+r[1]+"-"+r[2]+" "+l+":"+r[4]+":"+r[5]+":000",v=+e;return(o.utc(h).valueOf()-(v-=v%1e3))/6e4;},f=i.prototype;f.tz=function(t,e){void 0===t&&(t=r);var n,i=this.utcOffset(),a=this.toDate(),u=a.toLocaleString("en-US",{timeZone:t}),f=Math.round((a-new Date(u))/1e3/60),s=15*-Math.round(a.getTimezoneOffset()/15)-f;if(!Number(s))n=this.utcOffset(0,e);else if(n=o(u,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(s,!0),e){var m=n.utcOffset();n=n.add(i-m,"minute");}return n.$x.$timezone=t,n;},f.offsetName=function(t){var e=this.$x.$timezone||o.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase();});return n&&n.value;};var s=f.startOf;f.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return s.call(this,t,e);var n=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return s.call(n,t,e).tz(this.$x.$timezone,!0);},o.tz=function(t,e,n){var i=n&&e,a=n||e||r,f=u(+o(),a);if("string"!=typeof t)return o(t).tz(a);var s=function(t,e,n){var i=t-60*e*1e3,o=u(i,n);if(e===o)return[i,e];var r=u(i-=60*(o-e)*1e3,n);return o===r?[i,o]:[t-60*Math.min(o,r)*1e3,Math.max(o,r)];}(o.utc(t,i).valueOf(),f,a),m=s[0],c=s[1],d=o(m).utcOffset(c);return d.$x.$timezone=a,d;},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone;},o.tz.setDefault=function(t){r=t;};};});},{}],37:[function(require,module,exports){!function(t,i){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).dayjs_plugin_utc=i();}(this,function(){"use strict";var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,e=/([+-]|\d\d)/g;return function(s,f,n){var u=f.prototype;n.utc=function(t){var i={date:t,utc:!0,args:arguments};return new f(i);},u.utc=function(i){var e=n(this.toDate(),{locale:this.$L,utc:!0});return i?e.add(this.utcOffset(),t):e;},u.local=function(){return n(this.toDate(),{locale:this.$L,utc:!1});};var o=u.parse;u.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t);};var r=u.init;u.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds();}else r.call(this);};var a=u.utcOffset;u.utcOffset=function(s,f){var n=this.$utils().u;if(n(s))return this.$u?0:n(this.$offset)?a.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(i);if(!s)return null;var f=(""+s[0]).match(e)||["-",0,0],n=f[0],u=60*+f[1]+ +f[2];return 0===u?0:"+"===n?u:-u;}(s),null===s))return this;var u=Math.abs(s)<=16?60*s:s,o=this;if(f)return o.$offset=u,o.$u=0===s,o;if(0!==s){var r=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(u+r,t)).$offset=u,o.$x.$localOffset=r;}else o=this.utc();return o;};var h=u.format;u.format=function(t){var i=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,i);},u.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t;},u.isUTC=function(){return!!this.$u;},u.toISOString=function(){return this.toDate().toISOString();},u.toString=function(){return this.toDate().toUTCString();};var l=u.toDate;u.toDate=function(t){return"s"===t&&this.$offset?n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this);};var c=u.diff;u.diff=function(t,i,e){if(t&&this.$u===t.$u)return c.call(this,t,i,e);var s=this.local(),f=n(t).local();return c.call(s,f,i,e);};};});},{}],38:[function(require,module,exports){!function(e,t){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekOfYear=t();}(this,function(){"use strict";var e="week",t="year";return function(i,n,r){var f=n.prototype;f.week=function(i){if(void 0===i&&(i=null),null!==i)return this.add(7*(i-this.week()),"day");var n=this.$locale().yearStart||1;if(11===this.month()&&this.date()>25){var f=r(this).startOf(t).add(1,t).date(n),s=r(this).endOf(e);if(f.isBefore(s))return 1;}var a=r(this).startOf(t).date(n).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o);},f.weeks=function(e){return void 0===e&&(e=null),this.week(e);};};});},{}],39:[function(require,module,exports){!function(e,t){"object"==_typeof(exports)&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_plugin_weekday=t();}(this,function(){"use strict";return function(e,t){t.prototype.weekday=function(e){var t=this.$locale().weekStart||0,i=this.$W,n=(i<t?i+7:i)-t;return this.$utils().u(e)?n:this.subtract(n,"day").add(e,"day");};};});},{}],40:[function(require,module,exports){'use strict';var callBind=require('call-bind-apply-helpers');var gOPD=require('gopd');var hasProtoAccessor;try{// eslint-disable-next-line no-extra-parens, no-proto
|
|
497
564
|
hasProtoAccessor=/** @type {{ __proto__?: typeof Array.prototype }} */[].__proto__===Array.prototype;}catch(e){if(!e||_typeof(e)!=='object'||!('code'in e)||e.code!=='ERR_PROTO_ACCESS'){throw e;}}// eslint-disable-next-line no-extra-parens
|
|
498
565
|
var desc=!!hasProtoAccessor&&gOPD&&gOPD(Object.prototype,/** @type {keyof typeof Object.prototype} */'__proto__');var $Object=Object;var $getPrototypeOf=$Object.getPrototypeOf;/** @type {import('./get')} */module.exports=desc&&typeof desc.get==='function'?callBind([desc.get]):typeof $getPrototypeOf==='function'?/** @type {import('./get')} */function getDunder(value){// eslint-disable-next-line eqeqeq
|
|
499
|
-
return $getPrototypeOf(value==null?value:$Object(value));}:false;},{"call-bind-apply-helpers":28,"gopd":108}],
|
|
500
|
-
$defineProperty=false;}}module.exports=$defineProperty;},{}],
|
|
566
|
+
return $getPrototypeOf(value==null?value:$Object(value));}:false;},{"call-bind-apply-helpers":28,"gopd":108}],41:[function(require,module,exports){'use strict';/** @type {import('.')} */var $defineProperty=Object.defineProperty||false;if($defineProperty){try{$defineProperty({},'a',{value:1});}catch(e){// IE 8 has a broken defineProperty
|
|
567
|
+
$defineProperty=false;}}module.exports=$defineProperty;},{}],42:[function(require,module,exports){'use strict';/** @type {import('./eval')} */module.exports=EvalError;},{}],43:[function(require,module,exports){'use strict';/** @type {import('.')} */module.exports=Error;},{}],44:[function(require,module,exports){'use strict';/** @type {import('./range')} */module.exports=RangeError;},{}],45:[function(require,module,exports){'use strict';/** @type {import('./ref')} */module.exports=ReferenceError;},{}],46:[function(require,module,exports){'use strict';/** @type {import('./syntax')} */module.exports=SyntaxError;},{}],47:[function(require,module,exports){'use strict';/** @type {import('./type')} */module.exports=TypeError;},{}],48:[function(require,module,exports){'use strict';/** @type {import('./uri')} */module.exports=URIError;},{}],49:[function(require,module,exports){'use strict';/** @type {import('.')} */module.exports=Object;},{}],50:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
501
568
|
//
|
|
502
569
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
503
570
|
// copy of this software and associated documentation files (the
|
|
@@ -546,7 +613,7 @@ for(i=listeners.length-1;i>=0;i--){this.removeListener(type,listeners[i]);}}retu
|
|
|
546
613
|
// EventEmitters, we do not listen for `error` events here.
|
|
547
614
|
emitter.addEventListener(name,function wrapListener(arg){// IE does not have builtin `{ once: true }` support so we
|
|
548
615
|
// have to do it manually.
|
|
549
|
-
if(flags.once){emitter.removeEventListener(name,wrapListener);}listener(arg);});}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+_typeof(emitter));}}},{}],
|
|
616
|
+
if(flags.once){emitter.removeEventListener(name,wrapListener);}listener(arg);});}else{throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+_typeof(emitter));}}},{}],51:[function(require,module,exports){module.exports={"name":"fable-log","version":"3.0.16","description":"A simple logging wrapper.","main":"source/Fable-Log.js","scripts":{"start":"node source/Fable-Log.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","test":"./node_modules/.bin/mocha -u tdd -R spec","tests":"npx mocha -u tdd --exit -R spec --grep"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"browser":{"./source/Fable-Log-DefaultProviders-Node.js":"./source/Fable-Log-DefaultProviders-Web.js"},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable-log.git"},"keywords":["logging"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable-log/issues"},"homepage":"https://github.com/stevenvelozo/fable-log","devDependencies":{"quackage":"^1.0.33"},"dependencies":{"fable-serviceproviderbase":"^3.0.15"}};},{}],52:[function(require,module,exports){/**
|
|
550
617
|
* Base Logger Class
|
|
551
618
|
*
|
|
552
619
|
*
|
|
@@ -562,18 +629,18 @@ _inherits(BaseLogger,_libFableServiceProvi2);return _createClass2(BaseLogger,[{k
|
|
|
562
629
|
// ..but good enough for unique log stream identifiers
|
|
563
630
|
var tmpRandomData=(tmpDate+Math.random()*16)%16|0;tmpDate=Math.floor(tmpDate/16);return(pCharacter=='x'?tmpRandomData:tmpRandomData&0x3|0x8).toString(16);});return tmpUUID;}},{key:"initialize",value:function initialize(){// No operation.
|
|
564
631
|
}},{key:"trace",value:function trace(pLogText,pLogObject){this.write("trace",pLogText,pLogObject);}},{key:"debug",value:function debug(pLogText,pLogObject){this.write("debug",pLogText,pLogObject);}},{key:"info",value:function info(pLogText,pLogObject){this.write("info",pLogText,pLogObject);}},{key:"warn",value:function warn(pLogText,pLogObject){this.write("warn",pLogText,pLogObject);}},{key:"error",value:function error(pLogText,pLogObject){this.write("error",pLogText,pLogObject);}},{key:"fatal",value:function fatal(pLogText,pLogObject){this.write("fatal",pLogText,pLogObject);}},{key:"write",value:function write(pLogLevel,pLogText,pLogObject){// The base logger does nothing.
|
|
565
|
-
return true;}}]);}(libFableServiceProviderBase);module.exports=BaseLogger;},{"fable-serviceproviderbase":
|
|
632
|
+
return true;}}]);}(libFableServiceProviderBase);module.exports=BaseLogger;},{"fable-serviceproviderbase":59}],53:[function(require,module,exports){/**
|
|
566
633
|
* Default Logger Provider Function
|
|
567
634
|
*
|
|
568
635
|
*
|
|
569
636
|
* @author Steven Velozo <steven@velozo.com>
|
|
570
637
|
*/// Return the providers that are available without extensions loaded
|
|
571
|
-
var getDefaultProviders=function getDefaultProviders(){var tmpDefaultProviders={};tmpDefaultProviders.console=require('./Fable-Log-Logger-Console.js');tmpDefaultProviders["default"]=tmpDefaultProviders.console;return tmpDefaultProviders;};module.exports=getDefaultProviders();},{"./Fable-Log-Logger-Console.js":
|
|
638
|
+
var getDefaultProviders=function getDefaultProviders(){var tmpDefaultProviders={};tmpDefaultProviders.console=require('./Fable-Log-Logger-Console.js');tmpDefaultProviders["default"]=tmpDefaultProviders.console;return tmpDefaultProviders;};module.exports=getDefaultProviders();},{"./Fable-Log-Logger-Console.js":55}],54:[function(require,module,exports){module.exports=[{"loggertype":"console","streamtype":"console","level":"trace"}];},{}],55:[function(require,module,exports){var libBaseLogger=require('./Fable-Log-BaseLogger.js');var ConsoleLogger=/*#__PURE__*/function(_libBaseLogger){function ConsoleLogger(pLogStreamSettings,pFableLog){var _this7;_classCallCheck2(this,ConsoleLogger);_this7=_callSuper(this,ConsoleLogger,[pLogStreamSettings]);_this7._ShowTimeStamps='showtimestamps'in _this7._Settings?_this7._Settings.showtimestamps==true:true;_this7._FormattedTimeStamps='formattedtimestamps'in _this7._Settings?_this7._Settings.formattedtimestamps==true:true;_this7._ContextMessage='Context'in _this7._Settings?"(".concat(_this7._Settings.Context,")"):'Product'in pFableLog._Settings?"(".concat(pFableLog._Settings.Product,")"):'Unnamed_Log_Context';// Allow the user to decide what gets output to the console
|
|
572
639
|
_this7._OutputLogLinesToConsole='outputloglinestoconsole'in _this7._Settings?_this7._Settings.outputloglinestoconsole:true;_this7._OutputObjectsToConsole='outputobjectstoconsole'in _this7._Settings?_this7._Settings.outputobjectstoconsole:true;// Precompute the prefix for each level
|
|
573
640
|
_this7.prefixCache={};for(var i=0;i<=_this7.levels.length;i++){_this7.prefixCache[_this7.levels[i]]="[".concat(_this7.levels[i],"] ").concat(_this7._ContextMessage,": ");if(_this7._ShowTimeStamps){// If there is a timestamp we need a to prepend space before the prefixcache string, since the timestamp comes first
|
|
574
641
|
_this7.prefixCache[_this7.levels[i]]=' '+_this7.prefixCache[_this7.levels[i]];}}return _this7;}_inherits(ConsoleLogger,_libBaseLogger);return _createClass2(ConsoleLogger,[{key:"write",value:function write(pLevel,pLogText,pObject){var tmpTimeStamp='';if(this._ShowTimeStamps&&this._FormattedTimeStamps){tmpTimeStamp=new Date().toISOString();}else if(this._ShowTimeStamps){tmpTimeStamp=+new Date();}var tmpLogLine="".concat(tmpTimeStamp).concat(this.prefixCache[pLevel]).concat(pLogText);if(this._OutputLogLinesToConsole){console.log(tmpLogLine);}// Write out the object on a separate line if it is passed in
|
|
575
642
|
if(this._OutputObjectsToConsole&&typeof pObject!=='undefined'){console.log(JSON.stringify(pObject,null,2));}// Provide an easy way to be overridden and be consistent
|
|
576
|
-
return tmpLogLine;}}]);}(libBaseLogger);module.exports=ConsoleLogger;},{"./Fable-Log-BaseLogger.js":
|
|
643
|
+
return tmpLogLine;}}]);}(libBaseLogger);module.exports=ConsoleLogger;},{"./Fable-Log-BaseLogger.js":52}],56:[function(require,module,exports){var libConsoleLog=require('./Fable-Log-Logger-Console.js');var libFS=require('fs');var libPath=require('path');var SimpleFlatFileLogger=/*#__PURE__*/function(_libConsoleLog){function SimpleFlatFileLogger(pLogStreamSettings,pFableLog){var _this8;_classCallCheck2(this,SimpleFlatFileLogger);_this8=_callSuper(this,SimpleFlatFileLogger,[pLogStreamSettings,pFableLog]);// If a path isn't provided for the logfile, it tries to use the ProductName or Context
|
|
577
644
|
_this8.logFileRawPath=_this8._Settings.hasOwnProperty('path')?_this8._Settings.path:"./".concat(_this8._ContextMessage,".log");_this8.logFilePath=libPath.normalize(_this8.logFileRawPath);_this8.logFileStreamOptions=_this8._Settings.hasOwnProperty('fileStreamoptions')?_this8._Settings.fileStreamOptions:{"flags":"a","encoding":"utf8"};_this8.fileWriter=libFS.createWriteStream(_this8.logFilePath,_this8.logFileStreamOptions);_this8.activelyWriting=false;_this8.logLineStrings=[];_this8.logObjectStrings=[];_this8.defaultWriteCompleteCallback=function(){};_this8.defaultBufferFlushCallback=function(){};return _this8;}_inherits(SimpleFlatFileLogger,_libConsoleLog);return _createClass2(SimpleFlatFileLogger,[{key:"closeWriter",value:function closeWriter(fCloseComplete){var tmpCloseComplete=typeof fCloseComplete=='function'?fCloseComplete:function(){};if(this.fileWriter){this.fileWriter.end('\n');return this.fileWriter.once('finish',tmpCloseComplete.bind(this));}}},{key:"completeBufferFlushToLogFile",value:function completeBufferFlushToLogFile(fFlushComplete){this.activelyWriting=false;var tmpFlushComplete=typeof fFlushComplete=='function'?fFlushComplete:this.defaultBufferFlushCallback;if(this.logLineStrings.length>0){this.flushBufferToLogFile(tmpFlushComplete);}else{return tmpFlushComplete();}}},{key:"flushBufferToLogFile",value:function flushBufferToLogFile(fFlushComplete){if(!this.activelyWriting){// Only want to be writing one thing at a time....
|
|
578
645
|
this.activelyWriting=true;var tmpFlushComplete=typeof fFlushComplete=='function'?fFlushComplete:this.defaultBufferFlushCallback;// Get the current buffer arrays. These should always have matching number of elements.
|
|
579
646
|
var tmpLineStrings=this.logLineStrings;var tmpObjectStrings=this.logObjectStrings;// Reset these to be filled while we process this queue...
|
|
@@ -582,7 +649,7 @@ var tmpConstructedBufferOutputString='';for(var i=0;i<tmpLineStrings.length;i++)
|
|
|
582
649
|
tmpConstructedBufferOutputString+="".concat(tmpLineStrings[i],"\n");if(tmpObjectStrings[i]!==false){tmpConstructedBufferOutputString+="".concat(tmpObjectStrings[i],"\n");}}if(!this.fileWriter.write(tmpConstructedBufferOutputString,'utf8')){// If the streamwriter returns false, we need to wait for it to drain.
|
|
583
650
|
this.fileWriter.once('drain',this.completeBufferFlushToLogFile.bind(this,tmpFlushComplete));}else{return this.completeBufferFlushToLogFile(tmpFlushComplete);}}}},{key:"write",value:function write(pLevel,pLogText,pObject){var tmpLogLine=_superPropGet(SimpleFlatFileLogger,"write",this,3)([pLevel,pLogText,pObject]);// Use a very simple array as the write buffer
|
|
584
651
|
this.logLineStrings.push(tmpLogLine);// Write out the object on a separate line if it is passed in
|
|
585
|
-
if(typeof pObject!=='undefined'){this.logObjectStrings.push(JSON.stringify(pObject,null,4));}else{this.logObjectStrings.push(false);}this.flushBufferToLogFile();}}]);}(libConsoleLog);module.exports=SimpleFlatFileLogger;},{"./Fable-Log-Logger-Console.js":
|
|
652
|
+
if(typeof pObject!=='undefined'){this.logObjectStrings.push(JSON.stringify(pObject,null,4));}else{this.logObjectStrings.push(false);}this.flushBufferToLogFile();}}]);}(libConsoleLog);module.exports=SimpleFlatFileLogger;},{"./Fable-Log-Logger-Console.js":55,"fs":19,"path":137}],57:[function(require,module,exports){/**
|
|
586
653
|
* Fable Logging Service
|
|
587
654
|
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;var libPackage=require('../package.json');var FableLog=/*#__PURE__*/function(_libFableServiceProvi3){function FableLog(pSettings,pServiceHash){var _this9;_classCallCheck2(this,FableLog);_this9=_callSuper(this,FableLog,[pSettings,pServiceHash]);_this9.serviceType='Logging';/** @type {Object} */_this9._Package=libPackage;var tmpSettings=_typeof(pSettings)==='object'?pSettings:{};_this9._Settings=tmpSettings;_this9._Providers=require('./Fable-Log-DefaultProviders-Node.js');_this9._StreamDefinitions='LogStreams'in tmpSettings?tmpSettings.LogStreams:require('./Fable-Log-DefaultStreams.json');_this9.logStreams=[];// This object gets decorated for one-time instantiated providers that
|
|
588
655
|
// have multiple outputs, such as bunyan.
|
|
@@ -594,7 +661,7 @@ switch(pLevel){case'trace':this.logStreamsTrace.push(pLogger);case'debug':this.l
|
|
|
594
661
|
for(var i=0;i<this._StreamDefinitions.length;i++){var tmpStreamDefinition=Object.assign({loggertype:'default',streamtype:'console',level:'info'},this._StreamDefinitions[i]);if(!(tmpStreamDefinition.loggertype in this._Providers)){console.log("Error initializing log stream: bad loggertype in stream definition ".concat(JSON.stringify(tmpStreamDefinition)));}else{this.addLogger(new this._Providers[tmpStreamDefinition.loggertype](tmpStreamDefinition,this),tmpStreamDefinition.level);}}// Now initialize each one.
|
|
595
662
|
for(var _i=0;_i<this.logStreams.length;_i++){this.logStreams[_i].initialize();}}},{key:"logTime",value:function logTime(pMessage,pDatum){var tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time';var tmpTime=new Date();this.info("".concat(tmpMessage," ").concat(tmpTime," (epoch ").concat(+tmpTime,")"),pDatum);}// Get a timestamp
|
|
596
663
|
},{key:"getTimeStamp",value:function getTimeStamp(){return+new Date();}},{key:"getTimeDelta",value:function getTimeDelta(pTimeStamp){var tmpEndTime=+new Date();return tmpEndTime-pTimeStamp;}// Log the delta between a timestamp, and now with a message
|
|
597
|
-
},{key:"logTimeDelta",value:function logTimeDelta(pTimeDelta,pMessage,pDatum){var tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time Measurement';var tmpDatum=_typeof(pDatum)==='object'?pDatum:{};var tmpEndTime=+new Date();this.info("".concat(tmpMessage," logged at (epoch ").concat(+tmpEndTime,") took (").concat(pTimeDelta,"ms)"),pDatum);}},{key:"logTimeDeltaHuman",value:function logTimeDeltaHuman(pTimeDelta,pMessage,pDatum){var tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time Measurement';var tmpEndTime=+new Date();var tmpMs=parseInt(pTimeDelta%1000);var tmpSeconds=parseInt(pTimeDelta/1000%60);var tmpMinutes=parseInt(pTimeDelta/(1000*60)%60);var tmpHours=parseInt(pTimeDelta/(1000*60*60));tmpMs=tmpMs<10?"00"+tmpMs:tmpMs<100?"0"+tmpMs:tmpMs;tmpSeconds=tmpSeconds<10?"0"+tmpSeconds:tmpSeconds;tmpMinutes=tmpMinutes<10?"0"+tmpMinutes:tmpMinutes;tmpHours=tmpHours<10?"0"+tmpHours:tmpHours;this.info("".concat(tmpMessage," logged at (epoch ").concat(+tmpEndTime,") took (").concat(pTimeDelta,"ms) or (").concat(tmpHours,":").concat(tmpMinutes,":").concat(tmpSeconds,".").concat(tmpMs,")"),pDatum);}},{key:"logTimeDeltaRelative",value:function logTimeDeltaRelative(pStartTime,pMessage,pDatum){this.logTimeDelta(this.getTimeDelta(pStartTime),pMessage,pDatum);}},{key:"logTimeDeltaRelativeHuman",value:function logTimeDeltaRelativeHuman(pStartTime,pMessage,pDatum){this.logTimeDeltaHuman(this.getTimeDelta(pStartTime),pMessage,pDatum);}}]);}(libFableServiceProviderBase);module.exports=FableLog;module.exports.LogProviderBase=require('./Fable-Log-BaseLogger.js');module.exports.LogProviderConsole=require('./Fable-Log-Logger-Console.js');module.exports.LogProviderFlatfile=require('./Fable-Log-Logger-SimpleFlatFile.js');},{"../package.json":
|
|
664
|
+
},{key:"logTimeDelta",value:function logTimeDelta(pTimeDelta,pMessage,pDatum){var tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time Measurement';var tmpDatum=_typeof(pDatum)==='object'?pDatum:{};var tmpEndTime=+new Date();this.info("".concat(tmpMessage," logged at (epoch ").concat(+tmpEndTime,") took (").concat(pTimeDelta,"ms)"),pDatum);}},{key:"logTimeDeltaHuman",value:function logTimeDeltaHuman(pTimeDelta,pMessage,pDatum){var tmpMessage=typeof pMessage!=='undefined'?pMessage:'Time Measurement';var tmpEndTime=+new Date();var tmpMs=parseInt(pTimeDelta%1000);var tmpSeconds=parseInt(pTimeDelta/1000%60);var tmpMinutes=parseInt(pTimeDelta/(1000*60)%60);var tmpHours=parseInt(pTimeDelta/(1000*60*60));tmpMs=tmpMs<10?"00"+tmpMs:tmpMs<100?"0"+tmpMs:tmpMs;tmpSeconds=tmpSeconds<10?"0"+tmpSeconds:tmpSeconds;tmpMinutes=tmpMinutes<10?"0"+tmpMinutes:tmpMinutes;tmpHours=tmpHours<10?"0"+tmpHours:tmpHours;this.info("".concat(tmpMessage," logged at (epoch ").concat(+tmpEndTime,") took (").concat(pTimeDelta,"ms) or (").concat(tmpHours,":").concat(tmpMinutes,":").concat(tmpSeconds,".").concat(tmpMs,")"),pDatum);}},{key:"logTimeDeltaRelative",value:function logTimeDeltaRelative(pStartTime,pMessage,pDatum){this.logTimeDelta(this.getTimeDelta(pStartTime),pMessage,pDatum);}},{key:"logTimeDeltaRelativeHuman",value:function logTimeDeltaRelativeHuman(pStartTime,pMessage,pDatum){this.logTimeDeltaHuman(this.getTimeDelta(pStartTime),pMessage,pDatum);}}]);}(libFableServiceProviderBase);module.exports=FableLog;module.exports.LogProviderBase=require('./Fable-Log-BaseLogger.js');module.exports.LogProviderConsole=require('./Fable-Log-Logger-Console.js');module.exports.LogProviderFlatfile=require('./Fable-Log-Logger-SimpleFlatFile.js');},{"../package.json":51,"./Fable-Log-BaseLogger.js":52,"./Fable-Log-DefaultProviders-Node.js":53,"./Fable-Log-DefaultStreams.json":54,"./Fable-Log-Logger-Console.js":55,"./Fable-Log-Logger-SimpleFlatFile.js":56,"fable-serviceproviderbase":59}],58:[function(require,module,exports){module.exports={"name":"fable-serviceproviderbase","version":"3.0.15","description":"Simple base classes for fable services.","main":"source/Fable-ServiceProviderBase.js","scripts":{"start":"node source/Fable-ServiceProviderBase.js","test":"npx mocha -u tdd -R spec","tests":"npx mocha -u tdd --exit -R spec --grep","coverage":"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec","build":"npx quack build"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable-serviceproviderbase.git"},"keywords":["entity","behavior"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable-serviceproviderbase/issues"},"homepage":"https://github.com/stevenvelozo/fable-serviceproviderbase","devDependencies":{"fable":"^3.0.143","quackage":"^1.0.33"}};},{}],59:[function(require,module,exports){/**
|
|
598
665
|
* Fable Service Base
|
|
599
666
|
* @author <steven@velozo.com>
|
|
600
667
|
*/var libPackage=require('../package.json');var FableServiceProviderBase=/*#__PURE__*/function(){// The constructor can be used in two ways:
|
|
@@ -608,7 +675,7 @@ if(this.fable){this.UUID=pFable.getUUID();this.options=_typeof(pOptions)==='obje
|
|
|
608
675
|
this.options=_typeof(pFable)==='object'&&!pFable.isFable?pFable:_typeof(pOptions)==='object'?pOptions:{};this.UUID="CORE-SVC-".concat(Math.floor(Math.random()*(99999-10000)+10000));}// It's expected that the deriving class will set this
|
|
609
676
|
this.serviceType="Unknown-".concat(this.UUID);// The service hash is used to identify the specific instantiation of the service in the services map
|
|
610
677
|
this.Hash=typeof pServiceHash==='string'?pServiceHash:!this.fable&&typeof pOptions==='string'?pOptions:"".concat(this.UUID);}return _createClass2(FableServiceProviderBase,[{key:"connectFable",value:function connectFable(pFable){if(_typeof(pFable)!=='object'||!pFable.isFable){var tmpErrorMessage="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(_typeof(pFable),"].}");console.log(tmpErrorMessage);return new Error(tmpErrorMessage);}if(!this.fable){this.fable=pFable;}if(!this.log){this.log=this.fable.Logging;}if(!this.services){this.services=this.fable.services;}if(!this.servicesMap){this.servicesMap=this.fable.servicesMap;}return true;}}]);}();_defineProperty2(FableServiceProviderBase,"isFableService",true);module.exports=FableServiceProviderBase;// This is left here in case we want to go back to having different code/base class for "core" services
|
|
611
|
-
module.exports.CoreServiceProviderBase=FableServiceProviderBase;},{"../package.json":
|
|
678
|
+
module.exports.CoreServiceProviderBase=FableServiceProviderBase;},{"../package.json":58}],60:[function(require,module,exports){module.exports={"name":"fable-settings","version":"3.0.12","description":"A simple, tolerant configuration chain.","main":"source/Fable-Settings.js","scripts":{"start":"node source/Fable-Settings.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","test":"./node_modules/.bin/mocha -u tdd -R spec","build":"./node_modules/.bin/gulp build","docker-dev-build-image":"docker build ./ -f Dockerfile_LUXURYCode -t retold/fable-settings:local","docker-dev-run":"docker run -it -d --name retold-fable-settings-dev -p 30003:8080 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable-settings\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" retold/fable-settings:local"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable-settings.git"},"keywords":["configuration"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable-settings/issues"},"homepage":"https://github.com/stevenvelozo/fable-settings","devDependencies":{"quackage":"^1.0.33"},"dependencies":{"fable-serviceproviderbase":"^3.0.15","precedent":"^1.0.15"}};},{}],61:[function(require,module,exports){module.exports={"Product":"ApplicationNameHere","ProductVersion":"0.0.0","ConfigFile":false,"LogStreams":[{"level":"trace"}]};},{}],62:[function(require,module,exports){(function(process){(function(){/**
|
|
612
679
|
* Fable Settings Template Processor
|
|
613
680
|
*
|
|
614
681
|
* This class allows environment variables to come in via templated expressions, and defaults to be set.
|
|
@@ -618,23 +685,23 @@ module.exports.CoreServiceProviderBase=FableServiceProviderBase;},{"../package.j
|
|
|
618
685
|
* @module Fable Settings
|
|
619
686
|
*/var libPrecedent=require('precedent');var FableSettingsTemplateProcessor=/*#__PURE__*/function(){function FableSettingsTemplateProcessor(pDependencies){_classCallCheck2(this,FableSettingsTemplateProcessor);// Use a no-dependencies templating engine to parse out environment variables
|
|
620
687
|
this.templateProcessor=new libPrecedent();// TODO: Make the environment variable wrap expression demarcation characters configurable?
|
|
621
|
-
this.templateProcessor.addPattern('${','}',function(pTemplateValue){var tmpTemplateValue=pTemplateValue.trim();var tmpSeparatorIndex=tmpTemplateValue.indexOf('|');var tmpDefaultValue=tmpSeparatorIndex>=0?tmpTemplateValue.substring(tmpSeparatorIndex+1):'';var tmpEnvironmentVariableName=tmpSeparatorIndex>-1?tmpTemplateValue.substring(0,tmpSeparatorIndex):tmpTemplateValue;if(tmpEnvironmentVariableName in process.env){return process.env[tmpEnvironmentVariableName];}else{return tmpDefaultValue;}});}return _createClass2(FableSettingsTemplateProcessor,[{key:"parseSetting",value:function parseSetting(pString){return this.templateProcessor.parseString(pString);}}]);}();module.exports=FableSettingsTemplateProcessor;}).call(this);}).call(this,require('_process'));},{"_process":149,"precedent":146}],
|
|
688
|
+
this.templateProcessor.addPattern('${','}',function(pTemplateValue){var tmpTemplateValue=pTemplateValue.trim();var tmpSeparatorIndex=tmpTemplateValue.indexOf('|');var tmpDefaultValue=tmpSeparatorIndex>=0?tmpTemplateValue.substring(tmpSeparatorIndex+1):'';var tmpEnvironmentVariableName=tmpSeparatorIndex>-1?tmpTemplateValue.substring(0,tmpSeparatorIndex):tmpTemplateValue;if(tmpEnvironmentVariableName in process.env){return process.env[tmpEnvironmentVariableName];}else{return tmpDefaultValue;}});}return _createClass2(FableSettingsTemplateProcessor,[{key:"parseSetting",value:function parseSetting(pString){return this.templateProcessor.parseString(pString);}}]);}();module.exports=FableSettingsTemplateProcessor;}).call(this);}).call(this,require('_process'));},{"_process":149,"precedent":146}],63:[function(require,module,exports){/**
|
|
622
689
|
* Fable Settings Add-on
|
|
623
690
|
*
|
|
624
691
|
*
|
|
625
692
|
* @author Steven Velozo <steven@velozo.com>
|
|
626
693
|
* @module Fable Settings
|
|
627
|
-
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;var libFableSettingsTemplateProcessor=require('./Fable-Settings-TemplateProcessor.js');var FableSettings=/*#__PURE__*/function(_libFableServiceProvi4){function FableSettings(pSettings,pServiceHash){var
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
var tmpSettings=
|
|
631
|
-
|
|
632
|
-
tmpSettings=
|
|
694
|
+
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;var libFableSettingsTemplateProcessor=require('./Fable-Settings-TemplateProcessor.js');var FableSettings=/*#__PURE__*/function(_libFableServiceProvi4){function FableSettings(pSettings,pServiceHash){var _this10;_classCallCheck2(this,FableSettings);_this10=_callSuper(this,FableSettings,[pSettings,pServiceHash]);_this10.serviceType='SettingsManager';_this10._Package=require('../package.json');// Initialize the settings value template processor
|
|
695
|
+
_this10.settingsTemplateProcessor=new libFableSettingsTemplateProcessor();// set straight away so anything that uses it respects the initial setting
|
|
696
|
+
_this10._configureEnvTemplating(pSettings);_this10["default"]=_this10.buildDefaultSettings();// Construct a new settings object
|
|
697
|
+
var tmpSettings=_this10.merge(pSettings,_this10.buildDefaultSettings());// The base settings object (what they were on initialization, before other actors have altered them)
|
|
698
|
+
_this10.base=JSON.parse(JSON.stringify(tmpSettings));if(tmpSettings.DefaultConfigFile){try{// If there is a DEFAULT configuration file, try to load and merge it.
|
|
699
|
+
tmpSettings=_this10.merge(require(tmpSettings.DefaultConfigFile),tmpSettings);}catch(pException){// Why this? Often for an app we want settings to work out of the box, but
|
|
633
700
|
// would potentially want to have a config file for complex settings.
|
|
634
701
|
console.log('Fable-Settings Warning: Default configuration file specified but there was a problem loading it. Falling back to base.');console.log(' Loading Exception: '+pException);}}if(tmpSettings.ConfigFile){try{// If there is a configuration file, try to load and merge it.
|
|
635
|
-
tmpSettings=
|
|
702
|
+
tmpSettings=_this10.merge(require(tmpSettings.ConfigFile),tmpSettings);}catch(pException){// Why this? Often for an app we want settings to work out of the box, but
|
|
636
703
|
// would potentially want to have a config file for complex settings.
|
|
637
|
-
console.log('Fable-Settings Warning: Configuration file specified but there was a problem loading it. Falling back to base.');console.log(' Loading Exception: '+pException);}}
|
|
704
|
+
console.log('Fable-Settings Warning: Configuration file specified but there was a problem loading it. Falling back to base.');console.log(' Loading Exception: '+pException);}}_this10.settings=tmpSettings;return _this10;}// Build a default settings object. Use the JSON jimmy to ensure it is always a new object.
|
|
638
705
|
_inherits(FableSettings,_libFableServiceProvi4);return _createClass2(FableSettings,[{key:"buildDefaultSettings",value:function buildDefaultSettings(){return JSON.parse(JSON.stringify(require('./Fable-Settings-Default')));}// Update the configuration for environment variable templating based on the current settings object
|
|
639
706
|
},{key:"_configureEnvTemplating",value:function _configureEnvTemplating(pSettings){// default environment variable templating to on
|
|
640
707
|
this._PerformEnvTemplating=!pSettings||pSettings.NoEnvReplacement!==true;}// Resolve (recursive) any environment variables found in settings object.
|
|
@@ -642,8 +709,8 @@ this._PerformEnvTemplating=!pSettings||pSettings.NoEnvReplacement!==true;}// Res
|
|
|
642
709
|
* Check to see if a value is an object (but not an array).
|
|
643
710
|
*/},{key:"_isObject",value:function _isObject(value){return _typeof(value)==='object'&&!Array.isArray(value);}/**
|
|
644
711
|
* Merge two plain objects. Keys that are objects in both will be merged property-wise.
|
|
645
|
-
*/},{key:"_deepMergeObjects",value:function _deepMergeObjects(toObject,fromObject){var
|
|
646
|
-
|
|
712
|
+
*/},{key:"_deepMergeObjects",value:function _deepMergeObjects(toObject,fromObject){var _this11=this;if(!fromObject||!this._isObject(fromObject)){return;}Object.keys(fromObject).forEach(function(key){var fromValue=fromObject[key];if(_this11._isObject(fromValue)){var toValue=toObject[key];if(toValue&&_this11._isObject(toValue)){// both are objects, so do a recursive merge
|
|
713
|
+
_this11._deepMergeObjects(toValue,fromValue);return;}}toObject[key]=fromValue;});return toObject;}// Merge some new object into the existing settings.
|
|
647
714
|
},{key:"merge",value:function merge(pSettingsFrom,pSettingsTo){// If an invalid settings from object is passed in (e.g. object constructor without passing in anything) this should still work
|
|
648
715
|
var tmpSettingsFrom=_typeof(pSettingsFrom)==='object'?pSettingsFrom:{};// Default to the settings object if none is passed in for the merge.
|
|
649
716
|
var tmpSettingsTo=_typeof(pSettingsTo)==='object'?pSettingsTo:this.settings;// do not mutate the From object property values
|
|
@@ -652,7 +719,7 @@ this._configureEnvTemplating(tmpSettingsTo);return tmpSettingsTo;}// Fill in set
|
|
|
652
719
|
},{key:"fill",value:function fill(pSettingsFrom){// If an invalid settings from object is passed in (e.g. object constructor without passing in anything) this should still work
|
|
653
720
|
var tmpSettingsFrom=_typeof(pSettingsFrom)==='object'?pSettingsFrom:{};// do not mutate the From object property values
|
|
654
721
|
var tmpSettingsFromCopy=JSON.parse(JSON.stringify(tmpSettingsFrom));this.settings=this._deepMergeObjects(tmpSettingsFromCopy,this.settings);return this.settings;}}]);}(libFableServiceProviderBase);;// This is for backwards compatibility
|
|
655
|
-
function autoConstruct(pSettings){return new FableSettings(pSettings);}module.exports=FableSettings;module.exports["new"]=autoConstruct;},{"../package.json":
|
|
722
|
+
function autoConstruct(pSettings){return new FableSettings(pSettings);}module.exports=FableSettings;module.exports["new"]=autoConstruct;},{"../package.json":60,"./Fable-Settings-Default":61,"./Fable-Settings-TemplateProcessor.js":62,"fable-serviceproviderbase":59}],64:[function(require,module,exports){module.exports={"name":"fable-uuid","version":"3.0.11","description":"A simple UUID Generator.","main":"source/Fable-UUID.js","scripts":{"start":"node source/Fable-UUID.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","test":"./node_modules/.bin/mocha -u tdd -R spec","build":"./node_modules/.bin/gulp build","docker-dev-build-image":"docker build ./ -f Dockerfile_LUXURYCode -t retold/fable-uuid:local","docker-dev-run":"docker run -it -d --name retold-fable-uuid-dev -p 30002:8080 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable-uuid\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" retold/fable-uuid:local"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable-uuid.git"},"keywords":["logging"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable-uuid/issues"},"browser":{"./source/Fable-UUID-Random.js":"./source/Fable-UUID-Random-Browser.js"},"homepage":"https://github.com/stevenvelozo/fable-uuid","devDependencies":{"quackage":"^1.0.33"},"dependencies":{"fable-serviceproviderbase":"^3.0.15"}};},{}],65:[function(require,module,exports){/**
|
|
656
723
|
* Random Byte Generator - Browser version
|
|
657
724
|
*
|
|
658
725
|
*
|
|
@@ -670,113 +737,47 @@ this.getRandomValues(tmpBuffer);return tmpBuffer;}// Math.random()-based (RNG)
|
|
|
670
737
|
},{key:"generateRandomBytes",value:function generateRandomBytes(){// If all else fails, use Math.random(). It's fast, but is of unspecified
|
|
671
738
|
// quality.
|
|
672
739
|
var tmpBuffer=new Uint8Array(16);// eslint-disable-line no-undef
|
|
673
|
-
for(var i=0,tmpValue;i<16;i++){if((i&0x03)===0){tmpValue=Math.random()*0x100000000;}tmpBuffer[i]=tmpValue>>>((i&0x03)<<3)&0xff;}return tmpBuffer;}},{key:"generate",value:function generate(){if(this.getRandomValues){return this.generateWhatWGBytes();}else{return this.generateRandomBytes();}}}]);}();module.exports=RandomBytes;},{}],
|
|
740
|
+
for(var i=0,tmpValue;i<16;i++){if((i&0x03)===0){tmpValue=Math.random()*0x100000000;}tmpBuffer[i]=tmpValue>>>((i&0x03)<<3)&0xff;}return tmpBuffer;}},{key:"generate",value:function generate(){if(this.getRandomValues){return this.generateWhatWGBytes();}else{return this.generateRandomBytes();}}}]);}();module.exports=RandomBytes;},{}],66:[function(require,module,exports){/**
|
|
674
741
|
* Fable UUID Generator
|
|
675
|
-
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;0;var libRandomByteGenerator=require('./Fable-UUID-Random.js');var libPackage=require('../package.json');var FableUUID=/*#__PURE__*/function(_libFableServiceProvi5){function FableUUID(pSettings,pServiceHash){var
|
|
742
|
+
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;0;var libRandomByteGenerator=require('./Fable-UUID-Random.js');var libPackage=require('../package.json');var FableUUID=/*#__PURE__*/function(_libFableServiceProvi5){function FableUUID(pSettings,pServiceHash){var _this12;_classCallCheck2(this,FableUUID);_this12=_callSuper(this,FableUUID,[pSettings,pServiceHash]);_this12.serviceType='UUID';/** @type {Object} */_this12._Package=libPackage;// Determine if the module is in "Random UUID Mode" which means just use the random character function rather than the v4 random UUID spec.
|
|
676
743
|
// Note this allows UUIDs of various lengths (including very short ones) although guaranteed uniqueness goes downhill fast.
|
|
677
|
-
|
|
744
|
+
_this12._UUIDModeRandom=_typeof(pSettings)==='object'&&'UUIDModeRandom'in pSettings?pSettings.UUIDModeRandom==true:false;// These two properties are only useful if we are in Random mode. Otherwise it generates a v4 spec
|
|
678
745
|
// Length for "Random UUID Mode" is set -- if not set it to 8
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
746
|
+
_this12._UUIDLength=_typeof(pSettings)==='object'&&'UUIDLength'in pSettings?pSettings.UUIDLength+0:8;// Dictionary for "Random UUID Mode"
|
|
747
|
+
_this12._UUIDRandomDictionary=_typeof(pSettings)==='object'&&'UUIDDictionary'in pSettings?pSettings.UUIDDictionary+0:'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';_this12.randomByteGenerator=new libRandomByteGenerator();// Lookup table for hex codes
|
|
748
|
+
_this12._HexLookup=[];for(var i=0;i<256;++i){_this12._HexLookup[i]=(i+0x100).toString(16).substr(1);}return _this12;}// Adapted from node-uuid (https://github.com/kelektiv/node-uuid)
|
|
682
749
|
_inherits(FableUUID,_libFableServiceProvi5);return _createClass2(FableUUID,[{key:"bytesToUUID",value:function bytesToUUID(pBuffer){var i=0;// join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
|
|
683
750
|
return[this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],'-',this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],'-',this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],'-',this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],'-',this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]],this._HexLookup[pBuffer[i++]]].join('');}// Adapted from node-uuid (https://github.com/kelektiv/node-uuid)
|
|
684
751
|
},{key:"generateUUIDv4",value:function generateUUIDv4(){var tmpBuffer=new Array(16);var tmpRandomBytes=this.randomByteGenerator.generate();// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
685
752
|
tmpRandomBytes[6]=tmpRandomBytes[6]&0x0f|0x40;tmpRandomBytes[8]=tmpRandomBytes[8]&0x3f|0x80;return this.bytesToUUID(tmpRandomBytes);}// Simple random UUID generation
|
|
686
753
|
},{key:"generateRandom",value:function generateRandom(){var tmpUUID='';for(var i=0;i<this._UUIDLength;i++){tmpUUID+=this._UUIDRandomDictionary.charAt(Math.floor(Math.random()*(this._UUIDRandomDictionary.length-1)));}return tmpUUID;}// Adapted from node-uuid (https://github.com/kelektiv/node-uuid)
|
|
687
754
|
},{key:"getUUID",value:function getUUID(){if(this._UUIDModeRandom){return this.generateRandom();}else{return this.generateUUIDv4();}}}]);}(libFableServiceProviderBase);// This is for backwards compatibility
|
|
688
|
-
function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports["new"]=autoConstruct;},{"../package.json":
|
|
689
|
-
* cookie
|
|
690
|
-
* Copyright(c) 2012-2014 Roman Shtylman
|
|
691
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
692
|
-
* MIT Licensed
|
|
693
|
-
*/'use strict';/**
|
|
694
|
-
* Module exports.
|
|
695
|
-
* @public
|
|
696
|
-
*/exports.parse=parse;exports.serialize=serialize;/**
|
|
697
|
-
* Module variables.
|
|
698
|
-
* @private
|
|
699
|
-
*/var __toString=Object.prototype.toString;/**
|
|
700
|
-
* RegExp to match field-content in RFC 7230 sec 3.2
|
|
701
|
-
*
|
|
702
|
-
* field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
|
|
703
|
-
* field-vchar = VCHAR / obs-text
|
|
704
|
-
* obs-text = %x80-FF
|
|
705
|
-
*/var fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;/**
|
|
706
|
-
* Parse a cookie header.
|
|
707
|
-
*
|
|
708
|
-
* Parse the given cookie header string into an object
|
|
709
|
-
* The object has the various cookies as keys(names) => values
|
|
710
|
-
*
|
|
711
|
-
* @param {string} str
|
|
712
|
-
* @param {object} [options]
|
|
713
|
-
* @return {object}
|
|
714
|
-
* @public
|
|
715
|
-
*/function parse(str,options){if(typeof str!=='string'){throw new TypeError('argument str must be a string');}var obj={};var opt=options||{};var dec=opt.decode||decode;var index=0;while(index<str.length){var eqIdx=str.indexOf('=',index);// no more cookie pairs
|
|
716
|
-
if(eqIdx===-1){break;}var endIdx=str.indexOf(';',index);if(endIdx===-1){endIdx=str.length;}else if(endIdx<eqIdx){// backtrack on prior semicolon
|
|
717
|
-
index=str.lastIndexOf(';',eqIdx-1)+1;continue;}var key=str.slice(index,eqIdx).trim();// only assign once
|
|
718
|
-
if(undefined===obj[key]){var val=str.slice(eqIdx+1,endIdx).trim();// quoted values
|
|
719
|
-
if(val.charCodeAt(0)===0x22){val=val.slice(1,-1);}obj[key]=tryDecode(val,dec);}index=endIdx+1;}return obj;}/**
|
|
720
|
-
* Serialize data into a cookie header.
|
|
721
|
-
*
|
|
722
|
-
* Serialize the a name value pair into a cookie string suitable for
|
|
723
|
-
* http headers. An optional options object specified cookie parameters.
|
|
724
|
-
*
|
|
725
|
-
* serialize('foo', 'bar', { httpOnly: true })
|
|
726
|
-
* => "foo=bar; httpOnly"
|
|
727
|
-
*
|
|
728
|
-
* @param {string} name
|
|
729
|
-
* @param {string} val
|
|
730
|
-
* @param {object} [options]
|
|
731
|
-
* @return {string}
|
|
732
|
-
* @public
|
|
733
|
-
*/function serialize(name,val,options){var opt=options||{};var enc=opt.encode||encode;if(typeof enc!=='function'){throw new TypeError('option encode is invalid');}if(!fieldContentRegExp.test(name)){throw new TypeError('argument name is invalid');}var value=enc(val);if(value&&!fieldContentRegExp.test(value)){throw new TypeError('argument val is invalid');}var str=name+'='+value;if(null!=opt.maxAge){var maxAge=opt.maxAge-0;if(isNaN(maxAge)||!isFinite(maxAge)){throw new TypeError('option maxAge is invalid');}str+='; Max-Age='+Math.floor(maxAge);}if(opt.domain){if(!fieldContentRegExp.test(opt.domain)){throw new TypeError('option domain is invalid');}str+='; Domain='+opt.domain;}if(opt.path){if(!fieldContentRegExp.test(opt.path)){throw new TypeError('option path is invalid');}str+='; Path='+opt.path;}if(opt.expires){var expires=opt.expires;if(!isDate(expires)||isNaN(expires.valueOf())){throw new TypeError('option expires is invalid');}str+='; Expires='+expires.toUTCString();}if(opt.httpOnly){str+='; HttpOnly';}if(opt.secure){str+='; Secure';}if(opt.partitioned){str+='; Partitioned';}if(opt.priority){var priority=typeof opt.priority==='string'?opt.priority.toLowerCase():opt.priority;switch(priority){case'low':str+='; Priority=Low';break;case'medium':str+='; Priority=Medium';break;case'high':str+='; Priority=High';break;default:throw new TypeError('option priority is invalid');}}if(opt.sameSite){var sameSite=typeof opt.sameSite==='string'?opt.sameSite.toLowerCase():opt.sameSite;switch(sameSite){case true:str+='; SameSite=Strict';break;case'lax':str+='; SameSite=Lax';break;case'strict':str+='; SameSite=Strict';break;case'none':str+='; SameSite=None';break;default:throw new TypeError('option sameSite is invalid');}}return str;}/**
|
|
734
|
-
* URL-decode string value. Optimized to skip native call when no %.
|
|
735
|
-
*
|
|
736
|
-
* @param {string} str
|
|
737
|
-
* @returns {string}
|
|
738
|
-
*/function decode(str){return str.indexOf('%')!==-1?decodeURIComponent(str):str;}/**
|
|
739
|
-
* URL-encode value.
|
|
740
|
-
*
|
|
741
|
-
* @param {string} val
|
|
742
|
-
* @returns {string}
|
|
743
|
-
*/function encode(val){return encodeURIComponent(val);}/**
|
|
744
|
-
* Determine if value is a Date.
|
|
745
|
-
*
|
|
746
|
-
* @param {*} val
|
|
747
|
-
* @private
|
|
748
|
-
*/function isDate(val){return __toString.call(val)==='[object Date]'||val instanceof Date;}/**
|
|
749
|
-
* Try decoding a string using a decoding function.
|
|
750
|
-
*
|
|
751
|
-
* @param {string} str
|
|
752
|
-
* @param {function} decode
|
|
753
|
-
* @private
|
|
754
|
-
*/function tryDecode(str,decode){try{return decode(str);}catch(e){return str;}}},{}],67:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.10","description":"A service dependency injection, configuration and logging library.","main":"source/Fable.js","scripts":{"start":"node source/Fable.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","test":"./node_modules/.bin/mocha -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t fable-image:local","docker-dev-run":"docker run -it -d --name fable-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" fable-image:local","docker-dev-shell":"docker exec -it fable-dev /bin/bash","tests":"./node_modules/mocha/bin/_mocha -u tdd --exit -R spec --grep"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"browser":{"./source/service/Fable-Service-EnvironmentData.js":"./source/service/Fable-Service-EnvironmentData-Web.js","./source/service/Fable-Service-FilePersistence.js":"./source/service/Fable-Service-FilePersistence-Web.js"},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable.git"},"keywords":["entity","behavior"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable/issues"},"homepage":"https://github.com/stevenvelozo/fable","devDependencies":{"quackage":"^1.0.41"},"dependencies":{"async.eachlimit":"^0.5.2","async.waterfall":"^0.5.2","big.js":"^6.2.2","cachetrax":"^1.0.4","cookie":"^0.6.0","data-arithmatic":"^1.0.7","dayjs":"^1.11.13","fable-log":"^3.0.16","fable-serviceproviderbase":"^3.0.15","fable-settings":"^3.0.12","fable-uuid":"^3.0.11","manyfest":"^1.0.38","simple-get":"^4.0.1"}};},{}],68:[function(require,module,exports){/**
|
|
755
|
+
function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports["new"]=autoConstruct;},{"../package.json":64,"./Fable-UUID-Random.js":65,"fable-serviceproviderbase":59}],67:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.10","description":"A service dependency injection, configuration and logging library.","main":"source/Fable.js","scripts":{"start":"node source/Fable.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","test":"./node_modules/.bin/mocha -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t fable-image:local","docker-dev-run":"docker run -it -d --name fable-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" fable-image:local","docker-dev-shell":"docker exec -it fable-dev /bin/bash","tests":"./node_modules/mocha/bin/_mocha -u tdd --exit -R spec --grep"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"browser":{"./source/service/Fable-Service-EnvironmentData.js":"./source/service/Fable-Service-EnvironmentData-Web.js","./source/service/Fable-Service-FilePersistence.js":"./source/service/Fable-Service-FilePersistence-Web.js"},"repository":{"type":"git","url":"https://github.com/stevenvelozo/fable.git"},"keywords":["entity","behavior"],"author":"Steven Velozo <steven@velozo.com> (http://velozo.com/)","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/fable/issues"},"homepage":"https://github.com/stevenvelozo/fable","devDependencies":{"quackage":"^1.0.41"},"dependencies":{"async.eachlimit":"^0.5.2","async.waterfall":"^0.5.2","big.js":"^6.2.2","cachetrax":"^1.0.4","cookie":"^0.6.0","data-arithmatic":"^1.0.7","dayjs":"^1.11.13","fable-log":"^3.0.16","fable-serviceproviderbase":"^3.0.15","fable-settings":"^3.0.12","fable-uuid":"^3.0.11","manyfest":"^1.0.38","simple-get":"^4.0.1"}};},{}],68:[function(require,module,exports){/**
|
|
755
756
|
* Fable Application Services Support Library
|
|
756
757
|
* @author <steven@velozo.com>
|
|
757
758
|
*/// Pre-init services
|
|
758
|
-
var libFableSettings=require('fable-settings');var libFableUUID=require('fable-uuid');var libFableLog=require('fable-log');var libPackage=require('../package.json');var libFableServiceBase=require('fable-serviceproviderbase');var Fable=/*#__PURE__*/function(_libFableServiceBase$){function Fable(pSettings){var
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
759
|
+
var libFableSettings=require('fable-settings');var libFableUUID=require('fable-uuid');var libFableLog=require('fable-log');var libPackage=require('../package.json');var libFableServiceBase=require('fable-serviceproviderbase');var Fable=/*#__PURE__*/function(_libFableServiceBase$){function Fable(pSettings){var _this13;_classCallCheck2(this,Fable);_this13=_callSuper(this,Fable,[pSettings]);// Initialization Phase 0: Set up the lowest level state (fable is a utility service manager at heart)
|
|
760
|
+
_this13.serviceType='ServiceManager';/** @type {Object} */_this13._Package=libPackage;// An array of the types of services available
|
|
761
|
+
_this13.serviceTypes=[];// A map of instantiated services
|
|
762
|
+
_this13.servicesMap={};// A map of the default instantiated service by type
|
|
763
|
+
_this13.services={};// A map of class constructors for services
|
|
764
|
+
_this13.serviceClasses={};// If we need extra service initialization capabilities
|
|
765
|
+
_this13.extraServiceInitialization=false;// Set how noisy the system is about signaling complexity
|
|
766
|
+
_this13.LogNoisiness=0;// Initialization Phase 1: Set up the core utility services
|
|
766
767
|
// These are things like power, water, and sewage. They are required for fable to run (e.g. logging, settings, etc)
|
|
767
768
|
// Instantiate the default Settings Manager
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
769
|
+
_this13.SettingsManager=new libFableSettings(pSettings);_this13.SettingsManager=_this13.SettingsManager;// Instantiate the UUID generator
|
|
770
|
+
_this13.UUID=new libFableUUID(_this13.SettingsManager.settings);// Instantiate the logging system
|
|
771
|
+
_this13.Logging=new libFableLog(_this13.SettingsManager.settings);_this13.Logging.initialize();// Initialization Phase 1.5: Instantiate the service manager
|
|
771
772
|
// This is the start actual bootstrapping point for fable.
|
|
772
773
|
// For consistency fable is treated as a service.
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
774
|
+
_this13.ServiceManager=_this13;// TODO: Remove this when Orator and meadow-endpoints are shifted to this new pattern
|
|
775
|
+
_this13.serviceManager=_this13;// END TODO
|
|
776
|
+
_this13.connectFable(_this13);// --> Bootstrapping of fable into the Service Manager is complete
|
|
776
777
|
// Initialization Phase 2: Map in the default services.
|
|
777
778
|
// They will then be available in the Default service provider set as well.
|
|
778
|
-
|
|
779
|
-
|
|
779
|
+
_this13.connectPreinitServiceProviderInstance(_this13.UUID);_this13.connectPreinitServiceProviderInstance(_this13.Logging);_this13.connectPreinitServiceProviderInstance(_this13.SettingsManager);// Initialize and instantiate the default baked-in Data Arithmatic service
|
|
780
|
+
_this13.addAndInstantiateServiceType('EnvironmentData',require('./services/Fable-Service-EnvironmentData.js'));_this13.addServiceType('Template',require('./services/Fable-Service-Template.js'));_this13.addServiceType('MetaTemplate',require('./services/Fable-Service-MetaTemplate.js'));_this13.addServiceType('Anticipate',require('./services/Fable-Service-Anticipate.js'));_this13.addAndInstantiateServiceType('Dates',require('./services/Fable-Service-DateManipulation.js'));_this13.addAndInstantiateServiceType('DataFormat',require('./services/Fable-Service-DataFormat.js'));_this13.addAndInstantiateServiceType('DataGeneration',require('./services/Fable-Service-DataGeneration.js'));_this13.addAndInstantiateServiceType('Utility',require('./services/Fable-Service-Utility.js'));_this13.addAndInstantiateServiceType('Logic',require('./services/Fable-Service-Logic.js'));_this13.addAndInstantiateServiceType('Math',require('./services/Fable-Service-Math.js'));_this13.addServiceType('ExpressionParser',require('./services/Fable-Service-ExpressionParser.js'));_this13.addServiceType('RestClient',require('./services/Fable-Service-RestClient.js'));_this13.addServiceType('Manifest',require('manyfest'));_this13.addServiceType('ObjectCache',require('cachetrax'));_this13.addAndInstantiateServiceType('ProgressTime',require('./services/Fable-Service-ProgressTime.js'));_this13.addServiceType('ProgressTrackerSet',require('./services/Fable-Service-ProgressTrackerSet.js'));_this13.addServiceType('Operation',require('./services/Fable-Service-Operation.js'));_this13.addServiceType('CSVParser',require('./services/Fable-Service-CSVParser.js'));_this13.addServiceType('FilePersistence',require('./services/Fable-Service-FilePersistence.js'));return _this13;}/* State Accessors */_inherits(Fable,_libFableServiceBase$);return _createClass2(Fable,[{key:"isFable",get:function get(){return true;}},{key:"settings",get:function get(){return this.SettingsManager.settings;}},{key:"settingsManager",get:function get(){return this.SettingsManager;}// For backwards compatibility
|
|
780
781
|
},{key:"getUUID",value:function getUUID(){return this.UUID.getUUID();}},{key:"newAnticipate",value:function newAnticipate(){return this.instantiateServiceProviderWithoutRegistration('Anticipate');}},{key:"newManyfest",value:function newManyfest(pManifestDefinition){return this.instantiateServiceProviderWithoutRegistration('Manifest',pManifestDefinition);}/* Service Manager Methods */},{key:"addServiceType",value:function addServiceType(pServiceType,pServiceClass){if(pServiceType in this.servicesMap){// TODO: Check if any services are running?
|
|
781
782
|
this.log.warn("Adding a service type [".concat(pServiceType,"] that already exists. This will change the default class prototype for this service."));}else{// Add the container for instantiated services to go in
|
|
782
783
|
this.servicesMap[pServiceType]={};// Add the type to the list of types
|
|
@@ -809,8 +810,8 @@ if(pServiceHash in this.servicesMap[pServiceType]){if(!(pServiceType in this)||t
|
|
|
809
810
|
* @param {Date} pDate - An optional javascript Date object to generate a datestamp for.
|
|
810
811
|
* @returns {string} - A string formatted as YYYY-MM-DD-HH-MM-SS
|
|
811
812
|
*/}],[{key:"generateFileNameDateStamp",value:function generateFileNameDateStamp(pDate){var tmpDate=pDate||new Date();var tmpYear=tmpDate.getFullYear();var tmpMonth=String(tmpDate.getMonth()+1).padStart(2,'0');var tmpDay=String(tmpDate.getDate()).padStart(2,'0');var tmpHour=String(tmpDate.getHours()).padStart(2,'0');var tmpMinute=String(tmpDate.getMinutes()).padStart(2,'0');var tmpSecond=String(tmpDate.getSeconds()).padStart(2,'0');return"".concat(tmpYear,"-").concat(tmpMonth,"-").concat(tmpDay,"-").concat(tmpHour,"-").concat(tmpMinute,"-").concat(tmpSecond);}}]);}(libFableServiceBase.CoreServiceProviderBase);// This is for backwards compatibility
|
|
812
|
-
function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports["new"]=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceBase;module.exports.CoreServiceProviderBase=libFableServiceBase.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"../package.json":67,"./services/Fable-Service-Anticipate.js":69,"./services/Fable-Service-CSVParser.js":70,"./services/Fable-Service-DataFormat.js":71,"./services/Fable-Service-DataGeneration.js":73,"./services/Fable-Service-DateManipulation.js":74,"./services/Fable-Service-EnvironmentData.js":75,"./services/Fable-Service-ExpressionParser.js":76,"./services/Fable-Service-FilePersistence.js":86,"./services/Fable-Service-Logic.js":87,"./services/Fable-Service-Math.js":88,"./services/Fable-Service-MetaTemplate.js":89,"./services/Fable-Service-Operation.js":93,"./services/Fable-Service-ProgressTime.js":94,"./services/Fable-Service-ProgressTrackerSet.js":96,"./services/Fable-Service-RestClient.js":97,"./services/Fable-Service-Template.js":98,"./services/Fable-Service-Utility.js":99,"cachetrax":22,"fable-log":
|
|
813
|
-
|
|
813
|
+
function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports["new"]=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceBase;module.exports.CoreServiceProviderBase=libFableServiceBase.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"../package.json":67,"./services/Fable-Service-Anticipate.js":69,"./services/Fable-Service-CSVParser.js":70,"./services/Fable-Service-DataFormat.js":71,"./services/Fable-Service-DataGeneration.js":73,"./services/Fable-Service-DateManipulation.js":74,"./services/Fable-Service-EnvironmentData.js":75,"./services/Fable-Service-ExpressionParser.js":76,"./services/Fable-Service-FilePersistence.js":86,"./services/Fable-Service-Logic.js":87,"./services/Fable-Service-Math.js":88,"./services/Fable-Service-MetaTemplate.js":89,"./services/Fable-Service-Operation.js":93,"./services/Fable-Service-ProgressTime.js":94,"./services/Fable-Service-ProgressTrackerSet.js":96,"./services/Fable-Service-RestClient.js":97,"./services/Fable-Service-Template.js":98,"./services/Fable-Service-Utility.js":99,"cachetrax":22,"fable-log":57,"fable-serviceproviderbase":59,"fable-settings":63,"fable-uuid":66,"manyfest":126}],69:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceAnticipate=/*#__PURE__*/function(_libFableServiceBase){function FableServiceAnticipate(pFable,pOptions,pServiceHash){var _this14;_classCallCheck2(this,FableServiceAnticipate);_this14=_callSuper(this,FableServiceAnticipate,[pFable,pOptions,pServiceHash]);_this14.serviceType='AsyncAnticipate';// The queue of operations waiting to run.
|
|
814
|
+
_this14.operationQueue=[];_this14.erroredOperations=[];_this14.executingOperationCount=0;_this14.completedOperationCount=0;_this14.callDepth=0;_this14.maxOperations=1;_this14.lastError=undefined;_this14.waitingFunctions=[];return _this14;}_inherits(FableServiceAnticipate,_libFableServiceBase);return _createClass2(FableServiceAnticipate,[{key:"checkQueue",value:function checkQueue(){// This could be combined with the last else if stanza but the logic for errors and non-errors would be blended and more complex to follow so keeping it unrolled.
|
|
814
815
|
if(this.lastError){// If there are no operations left, and we have waiting functions, call them.
|
|
815
816
|
for(var i=0;i<this.waitingFunctions.length;i++){//this.log.trace('Calling waiting function.')
|
|
816
817
|
this.waitingFunctions[i](this.lastError);}// Reset our state
|
|
@@ -823,7 +824,7 @@ this.lastError=undefined;this.waitingFunctions=[];}}// Expects a function fAsync
|
|
|
823
824
|
this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}},{key:"buildAnticipatorCallback",value:function buildAnticipatorCallback(){// This uses closure-scoped state to track the callback state
|
|
824
825
|
var tmpCallbackState={Called:false,Error:undefined,OperationSet:this};return hoistedCallback.bind(this);function hoistedCallback(pError){if(tmpCallbackState.Called){// If they call the callback twice, throw an error
|
|
825
826
|
throw new Error("Anticipation async callback called twice...");}tmpCallbackState.Called=true;this.lastError=pError;tmpCallbackState.OperationSet.executingOperationCount-=1;tmpCallbackState.OperationSet.completedOperationCount+=1;tmpCallbackState.OperationSet.callDepth++;// TODO: Figure out a better pattern for chaining templates so the call stack doesn't get abused.
|
|
826
|
-
if(tmpCallbackState.OperationSet.callDepth>400){tmpCallbackState.OperationSet.callDepth=0;setTimeout(tmpCallbackState.OperationSet.checkQueue.bind(this),0);}else{tmpCallbackState.OperationSet.checkQueue();}}}},{key:"wait",value:function wait(fCallback){this.waitingFunctions.push(fCallback);this.checkQueue();}}]);}(libFableServiceBase);module.exports=FableServiceAnticipate;},{"fable-serviceproviderbase":
|
|
827
|
+
if(tmpCallbackState.OperationSet.callDepth>400){tmpCallbackState.OperationSet.callDepth=0;setTimeout(tmpCallbackState.OperationSet.checkQueue.bind(this),0);}else{tmpCallbackState.OperationSet.checkQueue();}}}},{key:"wait",value:function wait(fCallback){this.waitingFunctions.push(fCallback);this.checkQueue();}}]);}(libFableServiceBase);module.exports=FableServiceAnticipate;},{"fable-serviceproviderbase":59}],70:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
827
828
|
* Parsing CSVs. Why? Because it's a thing that needs to be done.
|
|
828
829
|
*
|
|
829
830
|
* 1. And the other node CSV parsers had issues with the really messy files we had.
|
|
@@ -835,8 +836,8 @@ if(tmpCallbackState.OperationSet.callDepth>400){tmpCallbackState.OperationSet.ca
|
|
|
835
836
|
* do anything; unfortunately some files have a sequence issue with that.
|
|
836
837
|
*
|
|
837
838
|
* @class CSVParser
|
|
838
|
-
*/var CSVParser=/*#__PURE__*/function(_libFableServiceProvi6){function CSVParser(pFable,pOptions,pServiceHash){var
|
|
839
|
-
|
|
839
|
+
*/var CSVParser=/*#__PURE__*/function(_libFableServiceProvi6){function CSVParser(pFable,pOptions,pServiceHash){var _this15;_classCallCheck2(this,CSVParser);_this15=_callSuper(this,CSVParser,[pFable,pOptions,pServiceHash]);_this15.serviceType='CSVParser';_this15.Header=[];_this15.HeaderFieldNames=[];_this15.Delimiter=',';_this15.QuoteCharacter='"';_this15.CleanCharacters=['\r'];_this15.HeaderLineIndex=0;_this15.HasHeader=true;_this15.HasSetHeader=false;_this15.EmitHeader=false;_this15.EmitJSON=true;_this15.EscapedQuoteString='"';// Current Line Parsing State
|
|
840
|
+
_this15.CurrentLine='';_this15.CurrentRecord=[];_this15.InQuote=false;_this15.InEscapedQuote=false;_this15.LinesParsed=0;_this15.RowsEmitted=0;return _this15;}_inherits(CSVParser,_libFableServiceProvi6);return _createClass2(CSVParser,[{key:"marshalRowToJSON",value:function marshalRowToJSON(pRowArray){if(!Array.isArray(pRowArray)){return false;}for(var i=this.HeaderFieldNames.length;i<pRowArray.length;i++){this.HeaderFieldNames[i]="".concat(i);}var tmpObject={};for(var _i3=0;_i3<pRowArray.length;_i3++){tmpObject[this.HeaderFieldNames[_i3]]=pRowArray[_i3];}return tmpObject;}// Set the header data, for use in marshalling to JSON.
|
|
840
841
|
},{key:"setHeader",value:function setHeader(pHeaderArray){this.Header=pHeaderArray;for(var i=0;i<this.Header.length;i++){if(typeof this.Header[i]=='undefined'){this.HeaderFieldNames[i]="".concat(i);}else{this.HeaderFieldNames[i]=this.Header[i].toString().trim();}}}},{key:"resetRowState",value:function resetRowState(){this.CurrentRecord=[];}},{key:"pushLine",value:function pushLine(){for(var i=0;i<this.CleanCharacters.length;i++){this.CurrentLine=this.CurrentLine.replace(this.CleanCharacters[i],'');}this.CurrentRecord.push(this.CurrentLine);this.CurrentLine='';}},{key:"emitRow",value:function emitRow(pFormatAsJSON){var tmpFormatAsJSON=typeof pFormatAsJSON=='undefined'?this.EmitJSON:pFormatAsJSON;this.RowsEmitted++;var tmpCompletedRecord=this.CurrentRecord;this.CurrentRecord=[];if(tmpFormatAsJSON){return this.marshalRowToJSON(tmpCompletedRecord);}else{return tmpCompletedRecord;}}},{key:"parseCSVLine",value:function parseCSVLine(pLineString){this.LinesParsed++;for(var i=0;i<pLineString.length;i++){if(!this.InQuote&&pLineString[i]==this.Delimiter){this.pushLine();}else if(pLineString[i]==this.QuoteCharacter){// If we are in the second part of an escaped quote, ignore it.
|
|
841
842
|
if(this.InEscapedQuote){this.InEscapedQuote=false;}// If we aren't in a quote, enter quote
|
|
842
843
|
else if(!this.InQuote){this.InQuote=true;}// We are in a quote, so peek forward to see if this is an "escaped" quote pair
|
|
@@ -846,30 +847,30 @@ if(!this.InQuote){// Push the last remaining column from the buffer to the curre
|
|
|
846
847
|
this.pushLine();// Check to see if there is a header -- and if so, if this is the header row
|
|
847
848
|
if(this.HasHeader&&!this.HasSetHeader&&this.RowsEmitted==this.HeaderLineIndex){this.HasSetHeader=true;// Override the format as json bit
|
|
848
849
|
this.setHeader(this.emitRow(false));// No matter what, formatting this as JSON is silly and we don't want to go there anyway.
|
|
849
|
-
if(this.EmitHeader){return this.Header;}else{return false;}}else{return this.emitRow();}}else{return false;}}}]);}(libFableServiceProviderBase);module.exports=CSVParser;},{"fable-serviceproviderbase":
|
|
850
|
+
if(this.EmitHeader){return this.Header;}else{return false;}}else{return this.emitRow();}}else{return false;}}}]);}(libFableServiceProviderBase);module.exports=CSVParser;},{"fable-serviceproviderbase":59}],71:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
850
851
|
* Data Formatting and Translation Functions
|
|
851
852
|
*
|
|
852
853
|
* @class DataFormat
|
|
853
|
-
*/var DataFormat=/*#__PURE__*/function(_libFableServiceProvi7){function DataFormat(pFable,pOptions,pServiceHash){var
|
|
854
|
+
*/var DataFormat=/*#__PURE__*/function(_libFableServiceProvi7){function DataFormat(pFable,pOptions,pServiceHash){var _this16;_classCallCheck2(this,DataFormat);_this16=_callSuper(this,DataFormat,[pFable,pOptions,pServiceHash]);/**
|
|
854
855
|
* Pad the start of a string.
|
|
855
856
|
*
|
|
856
857
|
* @param {*} pString
|
|
857
858
|
* @param {number} pTargetLength
|
|
858
859
|
* @returns {string} pPadString
|
|
859
|
-
*/_defineProperty2(
|
|
860
|
+
*/_defineProperty2(_this16,"stringPadStart",function(pString,pTargetLength,pPadString){var tmpString=pString.toString();return this.stringGeneratePaddingString(tmpString,pTargetLength,pPadString)+tmpString;});/**
|
|
860
861
|
* Pad the end of a string.
|
|
861
862
|
*
|
|
862
863
|
* @param {*} pString
|
|
863
864
|
* @param {number} pTargetLength
|
|
864
865
|
* @returns {string} pPadString
|
|
865
|
-
*/_defineProperty2(
|
|
866
|
+
*/_defineProperty2(_this16,"stringPadEnd",function(pString,pTargetLength,pPadString){var tmpString=pString.toString();return tmpString+this.stringGeneratePaddingString(tmpString,pTargetLength,pPadString);});_this16.serviceType='DataArithmatic';// Regular Expressions (so they don't have to be recompiled every time)
|
|
866
867
|
// These could be defined as static, but I'm not sure if that will work with browserify ... and specifically the QT browser.
|
|
867
|
-
|
|
868
|
+
_this16._Regex_formatterInsertCommas=/.{1,3}/g;// Match Function:
|
|
868
869
|
// function(pMatch, pSign, pZeros, pBefore, pDecimal, pAfter)
|
|
869
870
|
// Thoughts about below: /^([+-]?)(0*)(\d+)(\.(\d+))?$/;
|
|
870
|
-
|
|
871
|
+
_this16._Regex_formatterAddCommasToNumber=/^([-+]?)(0?)(\d+)(.?)(\d+)$/g;_this16._Regex_formatterDollarsRemoveCommas=/,/gi;_this16._Regex_formatterCleanNonAlphaChar=/[^a-zA-Z]/gi;_this16._Regex_formatterCapitalizeEachWord=/([a-zA-Z]+)/g;_this16._Regex_matcherHTMLEntities=/&(#?[a-zA-Z0-9]+);/g;// TODO: Potentially pull these in from a configuration.
|
|
871
872
|
// TODO: Use locale data for this if it's defaults all the way down.
|
|
872
|
-
|
|
873
|
+
_this16._Value_MoneySign_Currency='$';_this16._Value_NaN_Currency='--';_this16._Value_GroupSeparator_Number=',';_this16._Value_Prefix_StringHash='HSH';_this16._Value_Clean_formatterCleanNonAlpha='';_this16._UseEngineStringStartsWith=typeof String.prototype.startsWith==='function';_this16._UseEngineStringEndsWith=typeof String.prototype.endsWith==='function';return _this16;}/*************************************************************************
|
|
873
874
|
* String Manipulation and Comparison Functions
|
|
874
875
|
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*//**
|
|
875
876
|
* Reverse a string
|
|
@@ -1134,11 +1135,11 @@ return'';}if(tmpEnclosedValueEndIndex>0&&tmpEnclosedValueEndIndex>tmpEnclosedVal
|
|
|
1134
1135
|
* @param {number} pEnclosureEnd
|
|
1135
1136
|
* @returns {string}
|
|
1136
1137
|
*/},{key:"stringRemoveEnclosureByIndex",value:function stringRemoveEnclosureByIndex(pString,pEnclosureIndexToRemove,pEnclosureStart,pEnclosureEnd){var tmpString=typeof pString=='string'?pString:'';var tmpEnclosureIndexToRemove=typeof pEnclosureIndexToRemove=='number'?pEnclosureIndexToRemove:0;var tmpEnclosureStart=typeof pEnclosureStart=='string'?pEnclosureStart:'(';var tmpEnclosureEnd=typeof pEnclosureEnd=='string'?pEnclosureEnd:')';var tmpEnclosureCount=0;var tmpEnclosureDepth=0;var tmpMatchedEnclosureIndex=false;var tmpEnclosureStartIndex=0;var tmpEnclosureEndIndex=0;for(var i=0;i<tmpString.length;i++){// This is the start of an enclosure
|
|
1137
|
-
if(tmpString[i]==tmpEnclosureStart){tmpEnclosureDepth++;if(tmpEnclosureDepth==1){tmpEnclosureCount++;if(tmpEnclosureIndexToRemove==tmpEnclosureCount-1){tmpMatchedEnclosureIndex=true;tmpEnclosureStartIndex=i;}}}else if(tmpString[i]==tmpEnclosureEnd){tmpEnclosureDepth--;if(tmpEnclosureDepth==0&&tmpMatchedEnclosureIndex&&tmpEnclosureEndIndex<=tmpEnclosureStartIndex){tmpEnclosureEndIndex=i;tmpMatchedEnclosureIndex=false;}}}if(tmpEnclosureCount<=tmpEnclosureIndexToRemove){return tmpString;}var tmpReturnString='';if(tmpEnclosureStartIndex>1){tmpReturnString=tmpString.substring(0,tmpEnclosureStartIndex);}if(tmpString.length>tmpEnclosureEndIndex+1&&tmpEnclosureEndIndex>tmpEnclosureStartIndex){tmpReturnString+=tmpString.substring(tmpEnclosureEndIndex+1);}return tmpReturnString;}}]);}(libFableServiceProviderBase);module.exports=DataFormat;},{"fable-serviceproviderbase":
|
|
1138
|
+
if(tmpString[i]==tmpEnclosureStart){tmpEnclosureDepth++;if(tmpEnclosureDepth==1){tmpEnclosureCount++;if(tmpEnclosureIndexToRemove==tmpEnclosureCount-1){tmpMatchedEnclosureIndex=true;tmpEnclosureStartIndex=i;}}}else if(tmpString[i]==tmpEnclosureEnd){tmpEnclosureDepth--;if(tmpEnclosureDepth==0&&tmpMatchedEnclosureIndex&&tmpEnclosureEndIndex<=tmpEnclosureStartIndex){tmpEnclosureEndIndex=i;tmpMatchedEnclosureIndex=false;}}}if(tmpEnclosureCount<=tmpEnclosureIndexToRemove){return tmpString;}var tmpReturnString='';if(tmpEnclosureStartIndex>1){tmpReturnString=tmpString.substring(0,tmpEnclosureStartIndex);}if(tmpString.length>tmpEnclosureEndIndex+1&&tmpEnclosureEndIndex>tmpEnclosureStartIndex){tmpReturnString+=tmpString.substring(tmpEnclosureEndIndex+1);}return tmpReturnString;}}]);}(libFableServiceProviderBase);module.exports=DataFormat;},{"fable-serviceproviderbase":59}],72:[function(require,module,exports){module.exports={"DefaultIntegerMinimum":0,"DefaultIntegerMaximum":9999999,"DefaultNumericStringLength":10,"MonthSet":["January","February","March","April","May","June","July","August","September","October","November","December"],"WeekDaySet":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"ColorSet":["Red","Orange","Yellow","Green","Blue","Indigo","Violet","Pink","Purple","Turquoise","Gold","Lime","Maroon","Navy","Coral","Teal","Brown","White","Black","Sky","Berry","Grey","Straw","Silver","Sapphire"],"SurNameSet":["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen","Sanchez","Wright","King","Scott","Green","Baker","Adams","Nelson","Hill","Ramirez","Campbell","Mitchell","Roberts","Carter","Phillips","Evans","Turner","Torres","Parker","Collins","Edwards","Stewart","Flores","Morris","Nguyen","Murphy","Rivera","Cook","Rogers","Morgan","Peterson","Cooper","Reed","Bailey","Bell","Gomez","Kelly","Howard","Ward","Cox","Diaz","Richardson","Wood","Watson","Brooks","Bennett","Gray","James","Reyes","Cruz","Hughes","Price","Myers","Long","Foster","Sanders","Ross","Morales","Powell","Sullivan","Russell","Ortiz","Jenkins","Gutierrez","Perry","Butler","Barnes","Fisher"],"NameSet":["Mary","Patricia","Jennifer","Linda","Elizabeth","Barbara","Susan","Jessica","Sarah","Karen","Lisa","Nancy","Betty","Sandra","Margaret","Ashley","Kimberly","Emily","Donna","Michelle","Carol","Amanda","Melissa","Deborah","Stephanie","Dorothy","Rebecca","Sharon","Laura","Cynthia","Amy","Kathleen","Angela","Shirley","Brenda","Emma","Anna","Pamela","Nicole","Samantha","Katherine","Christine","Helen","Debra","Rachel","Carolyn","Janet","Maria","Catherine","Heather","Diane","Olivia","Julie","Joyce","Victoria","Ruth","Virginia","Lauren","Kelly","Christina","Joan","Evelyn","Judith","Andrea","Hannah","Megan","Cheryl","Jacqueline","Martha","Madison","Teresa","Gloria","Sara","Janice","Ann","Kathryn","Abigail","Sophia","Frances","Jean","Alice","Judy","Isabella","Julia","Grace","Amber","Denise","Danielle","Marilyn","Beverly","Charlotte","Natalie","Theresa","Diana","Brittany","Doris","Kayla","Alexis","Lori","Marie","James","Robert","John","Michael","David","William","Richard","Joseph","Thomas","Christopher","Charles","Daniel","Matthew","Anthony","Mark","Donald","Steven","Andrew","Paul","Joshua","Kenneth","Kevin","Brian","George","Timothy","Ronald","Jason","Edward","Jeffrey","Ryan","Jacob","Gary","Nicholas","Eric","Jonathan","Stephen","Larry","Justin","Scott","Brandon","Benjamin","Samuel","Gregory","Alexander","Patrick","Frank","Raymond","Jack","Dennis","Jerry","Tyler","Aaron","Jose","Adam","Nathan","Henry","Zachary","Douglas","Peter","Kyle","Noah","Ethan","Jeremy","Walter","Christian","Keith","Roger","Terry","Austin","Sean","Gerald","Carl","Harold","Dylan","Arthur","Lawrence","Jordan","Jesse","Bryan","Billy","Bruce","Gabriel","Joe","Logan","Alan","Juan","Albert","Willie","Elijah","Wayne","Randy","Vincent","Mason","Roy","Ralph","Bobby","Russell","Bradley","Philip","Eugene"]};},{}],73:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
|
|
1138
1139
|
* FableServiceDataGeneration class provides various methods for generating random data.
|
|
1139
1140
|
*
|
|
1140
1141
|
* @extends libFableServiceBase
|
|
1141
|
-
*/var FableServiceDataGeneration=/*#__PURE__*/function(_libFableServiceBase2){function FableServiceDataGeneration(pFable,pOptions,pServiceHash){var
|
|
1142
|
+
*/var FableServiceDataGeneration=/*#__PURE__*/function(_libFableServiceBase2){function FableServiceDataGeneration(pFable,pOptions,pServiceHash){var _this17;_classCallCheck2(this,FableServiceDataGeneration);_this17=_callSuper(this,FableServiceDataGeneration,[pFable,pOptions,pServiceHash]);_this17.serviceType='DataGeneration';_this17.defaultData=require('./Fable-Service-DataGeneration-DefaultValues.json');return _this17;}/**
|
|
1142
1143
|
* Generates a random integer between the specified minimum and maximum values.
|
|
1143
1144
|
*
|
|
1144
1145
|
* @param {number} pMinimum - The minimum value (inclusive).
|
|
@@ -1194,22 +1195,22 @@ if(tmpString[i]==tmpEnclosureStart){tmpEnclosureDepth++;if(tmpEnclosureDepth==1)
|
|
|
1194
1195
|
* Generates a random surname from the default surname set.
|
|
1195
1196
|
*
|
|
1196
1197
|
* @returns {string} A random surname.
|
|
1197
|
-
*/},{key:"randomSurname",value:function randomSurname(){return this.defaultData.SurNameSet[this.randomIntegerUpTo(this.defaultData.SurNameSet.length-1)];}}]);}(libFableServiceBase);module.exports=FableServiceDataGeneration;},{"./Fable-Service-DataGeneration-DefaultValues.json":72,"fable-serviceproviderbase":
|
|
1198
|
+
*/},{key:"randomSurname",value:function randomSurname(){return this.defaultData.SurNameSet[this.randomIntegerUpTo(this.defaultData.SurNameSet.length-1)];}}]);}(libFableServiceBase);module.exports=FableServiceDataGeneration;},{"./Fable-Service-DataGeneration-DefaultValues.json":72,"fable-serviceproviderbase":59}],74:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
1198
1199
|
* Date management a la Moment using days.js
|
|
1199
1200
|
*
|
|
1200
1201
|
* @class DateManipulation
|
|
1201
|
-
*/var DateManipulation=/*#__PURE__*/function(_libFableServiceProvi8){function DateManipulation(pFable,pOptions,pServiceHash){var
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1202
|
+
*/var DateManipulation=/*#__PURE__*/function(_libFableServiceProvi8){function DateManipulation(pFable,pOptions,pServiceHash){var _this18;_classCallCheck2(this,DateManipulation);_this18=_callSuper(this,DateManipulation,[pFable,pOptions,pServiceHash]);_this18.serviceType='Dates';_this18.dayJS=require('dayjs');// Include the `weekOfYear` plugin
|
|
1203
|
+
_this18.plugin_weekOfYear=require('dayjs/plugin/weekOfYear');_this18.dayJS.extend(_this18.plugin_weekOfYear);// Include the `weekday` plugin
|
|
1204
|
+
_this18.plugin_weekday=require('dayjs/plugin/weekday');_this18.dayJS.extend(_this18.plugin_weekday);// Include the `isoWeek` plugin
|
|
1205
|
+
_this18.plugin_isoWeek=require('dayjs/plugin/isoWeek');_this18.dayJS.extend(_this18.plugin_isoWeek);// Include the `timezone` plugin
|
|
1206
|
+
_this18.plugin_timezone=require('dayjs/plugin/timezone');_this18.dayJS.extend(_this18.plugin_timezone);// Include the `relativetime` plugin
|
|
1207
|
+
_this18.plugin_relativetime=require('dayjs/plugin/relativeTime');_this18.dayJS.extend(_this18.plugin_relativetime);// Include the `utc` plugin
|
|
1208
|
+
_this18.plugin_utc=require('dayjs/plugin/utc');_this18.dayJS.extend(_this18.plugin_utc);// Include the `advancedFormat` plugin
|
|
1209
|
+
_this18.plugin_advancedFormat=require('dayjs/plugin/advancedFormat');_this18.dayJS.extend(_this18.plugin_advancedFormat);// A developer can include locales if they want
|
|
1209
1210
|
// You would do the following:
|
|
1210
1211
|
// const localeDE = require('dayjs/locale/de');
|
|
1211
1212
|
// _Fable.Dates.dayJS.locale('de');
|
|
1212
|
-
return
|
|
1213
|
+
return _this18;}/**
|
|
1213
1214
|
* Calculates the difference in days between two dates.
|
|
1214
1215
|
*
|
|
1215
1216
|
* @param {string|Date|number} pDateStart - The start date. Can be a string, Date object, or timestamp.
|
|
@@ -1245,7 +1246,7 @@ return tmpEndDate.diff(tmpStartDate,'month');}/**
|
|
|
1245
1246
|
*/},{key:"dateYearDifference",value:function dateYearDifference(pDateStart,pDateEnd){// If there is not a valid start date, return NaN
|
|
1246
1247
|
if(pDateStart===undefined||pDateStart===null||pDateStart===''){return NaN;}var tmpStartDate=this.dayJS(pDateStart);// Without a valid end date, dayJS defaults to the current date
|
|
1247
1248
|
var tmpEndDate=this.dayJS(pDateEnd);// Returns the difference in years between two dates
|
|
1248
|
-
return tmpEndDate.diff(tmpStartDate,'year');}}]);}(libFableServiceProviderBase);module.exports=DateManipulation;},{"dayjs":
|
|
1249
|
+
return tmpEndDate.diff(tmpStartDate,'year');}}]);}(libFableServiceProviderBase);module.exports=DateManipulation;},{"dayjs":32,"dayjs/plugin/advancedFormat":33,"dayjs/plugin/isoWeek":34,"dayjs/plugin/relativeTime":35,"dayjs/plugin/timezone":36,"dayjs/plugin/utc":37,"dayjs/plugin/weekOfYear":38,"dayjs/plugin/weekday":39,"fable-serviceproviderbase":59}],75:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceEnvironmentData=/*#__PURE__*/function(_libFableServiceBase3){function FableServiceEnvironmentData(pFable,pOptions,pServiceHash){var _this19;_classCallCheck2(this,FableServiceEnvironmentData);_this19=_callSuper(this,FableServiceEnvironmentData,[pFable,pOptions,pServiceHash]);_this19.serviceType='EnvironmentData';_this19.Environment="node.js";return _this19;}_inherits(FableServiceEnvironmentData,_libFableServiceBase3);return _createClass2(FableServiceEnvironmentData);}(libFableServiceBase);module.exports=FableServiceEnvironmentData;},{"fable-serviceproviderbase":59}],76:[function(require,module,exports){var _require3=require('big.js'),PE=_require3.PE;var libFableServiceBase=require('fable-serviceproviderbase');/* Trying a different pattern for this service ...
|
|
1249
1250
|
*
|
|
1250
1251
|
* This service is a simple expression parser that can handle math expressions, with magic(tm) lookup of addresses with a manifest.
|
|
1251
1252
|
*
|
|
@@ -1272,17 +1273,17 @@ return tmpEndDate.diff(tmpStartDate,'year');}}]);}(libFableServiceProviderBase);
|
|
|
1272
1273
|
* @param {Object} pFable - The Fable object.
|
|
1273
1274
|
* @param {Object} pOptions - The options for the service.
|
|
1274
1275
|
* @param {string} pServiceHash - The hash of the service.
|
|
1275
|
-
*/function FableServiceExpressionParser(pFable,pOptions,pServiceHash){var
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1276
|
+
*/function FableServiceExpressionParser(pFable,pOptions,pServiceHash){var _this20;_classCallCheck2(this,FableServiceExpressionParser);_this20=_callSuper(this,FableServiceExpressionParser,[pFable,pOptions,pServiceHash]);// The configuration for tokens that the solver recognizes, with precedence and friendly names.
|
|
1277
|
+
_this20.tokenMap=require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-TokenMap.json');// Keep track of maximum token precedence
|
|
1278
|
+
_this20.tokenMaxPrecedence=4;// This isn't exactly a radix tree but close enough. It's a map of the first character of the token to the token.
|
|
1279
|
+
_this20.tokenRadix={};var tmpTokenKeys=Object.keys(_this20.tokenMap);for(var i=0;i<tmpTokenKeys.length;i++){var tmpTokenKey=tmpTokenKeys[i];var tmpToken=_this20.tokenMap[tmpTokenKey];tmpToken.Token=tmpTokenKey;tmpToken.Length=tmpTokenKey.length;var tmpTokenStartCharacter=tmpToken.Token[0];if(!(tmpTokenStartCharacter in _this20.tokenRadix)){// With a token count of 1 and a literal of true, we can assume it being in the radix is the token.
|
|
1280
|
+
_this20.tokenRadix[tmpTokenStartCharacter]={TokenCount:0,Literal:false,TokenKeys:[],TokenMap:{}};}_this20.tokenRadix[tmpTokenStartCharacter].TokenCount++;if(tmpTokenKey==tmpTokenStartCharacter){_this20.tokenRadix[tmpTokenStartCharacter].Literal=true;}_this20.tokenRadix[tmpTokenStartCharacter].TokenMap[tmpToken.Token]=tmpToken;_this20.tokenRadix[tmpTokenStartCharacter].TokenKeys.push(tmpTokenKey);_this20.tokenRadix[tmpTokenStartCharacter].TokenKeys.sort(function(pLeft,pRight){return pRight.length-pLeft.length;});if(_this20.tokenMaxPrecedence<tmpToken.Precedence){_this20.tokenMaxPrecedence=tmpToken.Precedence;}}// The configuration for which functions are available to the solver.
|
|
1281
|
+
_this20.functionMap=require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json');_this20.serviceType='ExpressionParser';// These are sub-services for the tokenizer, linter, compiler, marshaler and solver.
|
|
1282
|
+
_this20.fable.addServiceTypeIfNotExists('ExpressionParser-Tokenizer',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ExpressionTokenizer.js'));_this20.fable.addServiceTypeIfNotExists('ExpressionParser-Linter',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Linter.js'));_this20.fable.addServiceTypeIfNotExists('ExpressionParser-Postfix',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Postfix.js'));_this20.fable.addServiceTypeIfNotExists('ExpressionParser-ValueMarshal',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ValueMarshal.js'));_this20.fable.addServiceTypeIfNotExists('ExpressionParser-Solver',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-SolvePostfixedExpression.js'));// And the sub-service for the friendly user messaging
|
|
1283
|
+
_this20.fable.addServiceTypeIfNotExists('ExpressionParser-Messaging',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Messaging.js'));// This code instantitates these fable services to child objects of this service, but does not pollute the main fable with them.
|
|
1284
|
+
_this20.Tokenizer=_this20.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Tokenizer');_this20.Linter=_this20.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Linter');_this20.Postfix=_this20.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Postfix');_this20.ValueMarshal=_this20.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-ValueMarshal');_this20.Solver=_this20.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Solver');_this20.Messaging=_this20.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Messaging');// Wire each sub service into this instance of the solver.
|
|
1285
|
+
_this20.Tokenizer.connectExpressionParser(_this20);_this20.Linter.connectExpressionParser(_this20);_this20.Postfix.connectExpressionParser(_this20);_this20.ValueMarshal.connectExpressionParser(_this20);_this20.Solver.connectExpressionParser(_this20);_this20.Messaging.connectExpressionParser(_this20);_this20.GenericManifest=_this20.fable.newManyfest();// This will look for a LogNoisiness on fable (or one that falls in from pict) and if it doesn't exist, set one for this service.
|
|
1286
|
+
_this20.LogNoisiness='LogNoisiness'in _this20.fable?_this20.fable.LogNoisiness:0;return _this20;}/**
|
|
1286
1287
|
* Tokenizes the given mathematical expression string.
|
|
1287
1288
|
*
|
|
1288
1289
|
* @param {string} pExpression - The expression to tokenize.
|
|
@@ -1330,10 +1331,10 @@ _this18.LogNoisiness='LogNoisiness'in _this18.fable?_this18.fable.LogNoisiness:0
|
|
|
1330
1331
|
*/},{key:"solve",value:function solve(pExpression,pDataSourceObject,pResultObject,pManifest,pDataDestinationObject){var tmpResultsObject=_typeof(pResultObject)==='object'?pResultObject:{};var tmpDataSourceObject=_typeof(pDataSourceObject)==='object'?pDataSourceObject:{};var tmpDataDestinationObject=_typeof(pDataDestinationObject)==='object'?pDataDestinationObject:{};// This is technically a "pre-compile" and we can keep this Results Object around to reuse for better performance. Not required.
|
|
1331
1332
|
this.tokenize(pExpression,tmpResultsObject);this.lintTokenizedExpression(tmpResultsObject.RawTokens,tmpResultsObject);this.buildPostfixedSolveList(tmpResultsObject.RawTokens,tmpResultsObject);// This is where the data from variables gets marshaled into their symbols (from AppData or the like)
|
|
1332
1333
|
this.substituteValuesInTokenizedObjects(tmpResultsObject.PostfixTokenObjects,tmpDataSourceObject,tmpResultsObject,pManifest);// Finally this is the expr solving method, which returns a string and also marshals it into tmpDataDestinationObject
|
|
1333
|
-
return this.solvePostfixedExpression(tmpResultsObject.PostfixSolveList,tmpDataDestinationObject,tmpResultsObject,pManifest);}}]);}(libFableServiceBase);module.exports=FableServiceExpressionParser;},{"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ExpressionTokenizer.js":78,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json":79,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Linter.js":80,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Messaging.js":81,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Postfix.js":82,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-SolvePostfixedExpression.js":83,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-TokenMap.json":84,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ValueMarshal.js":85,"big.js":17,"fable-serviceproviderbase":
|
|
1334
|
+
return this.solvePostfixedExpression(tmpResultsObject.PostfixSolveList,tmpDataDestinationObject,tmpResultsObject,pManifest);}}]);}(libFableServiceBase);module.exports=FableServiceExpressionParser;},{"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ExpressionTokenizer.js":78,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json":79,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Linter.js":80,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Messaging.js":81,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Postfix.js":82,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-SolvePostfixedExpression.js":83,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-TokenMap.json":84,"./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ValueMarshal.js":85,"big.js":17,"fable-serviceproviderbase":59}],77:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');var ExpressionParserOperationBase=/*#__PURE__*/function(_libFableServiceProvi9){function ExpressionParserOperationBase(pFable,pOptions,pServiceHash){var _this21;_classCallCheck2(this,ExpressionParserOperationBase);_this21=_callSuper(this,ExpressionParserOperationBase,[pFable,pOptions,pServiceHash]);_this21.serviceType='ExpressionParserOperationBase';_this21.numberTest=/^-{0,1}\d*\.{0,1}\d+$/;_this21.ExpressionParser=false;return _this21;}_inherits(ExpressionParserOperationBase,_libFableServiceProvi9);return _createClass2(ExpressionParserOperationBase,[{key:"connectExpressionParser",value:function connectExpressionParser(pExpressionParser){this.ExpressionParser=pExpressionParser;}},{key:"getTokenType",value:function getTokenType(pToken){if(pToken in this.ExpressionParser.tokenMap){return"Token.".concat(this.ExpressionParser.tokenMap[pToken].Type);}else if(pToken.length>2&&pToken[0]==='{'&&pToken[pToken.length-1]==='}'){return'Token.StateAddress';}else if(pToken.length>2&&pToken[0]==='"'&&pToken[pToken.length-1]==='"'){return'Token.String';}else if(this.numberTest.test(pToken)){return'Token.Constant';}else{return'Token.Symbol';}// Just for documentation sake:
|
|
1334
1335
|
// There is a fifth token type, VirtualSymbol
|
|
1335
1336
|
// This is a value that's added during solve and looked up by address in the VirtualSymbol object.
|
|
1336
|
-
}},{key:"getTokenContainerObject",value:function getTokenContainerObject(pToken,pTokenType){return{Token:pToken,Type:typeof pTokenType==='undefined'?this.getTokenType(pToken):pTokenType,Descriptor:pToken in this.ExpressionParser.tokenMap?this.ExpressionParser.tokenMap[pToken]:false};}}]);}(libFableServiceProviderBase);module.exports=ExpressionParserOperationBase;},{"fable-serviceproviderbase":
|
|
1337
|
+
}},{key:"getTokenContainerObject",value:function getTokenContainerObject(pToken,pTokenType){return{Token:pToken,Type:typeof pTokenType==='undefined'?this.getTokenType(pToken):pTokenType,Descriptor:pToken in this.ExpressionParser.tokenMap?this.ExpressionParser.tokenMap[pToken]:false};}}]);}(libFableServiceProviderBase);module.exports=ExpressionParserOperationBase;},{"fable-serviceproviderbase":59}],78:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionTokenizer=/*#__PURE__*/function(_libExpressionParserO){function ExpressionTokenizer(pFable,pOptions,pServiceHash){var _this22;_classCallCheck2(this,ExpressionTokenizer);_this22=_callSuper(this,ExpressionTokenizer,[pFable,pOptions,pServiceHash]);_this22.serviceType='ExpressionParser-Tokenizer';return _this22;}_inherits(ExpressionTokenizer,_libExpressionParserO);return _createClass2(ExpressionTokenizer,[{key:"tokenize",value:function tokenize(pExpression,pResultObject){var tmpResults=_typeof(pResultObject)==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.RawExpression=pExpression;tmpResults.RawTokens=[];tmpResults.ExpressionParserLog=[];if(typeof pExpression!=='string'){this.log.warn('ExpressionParser.tokenize was passed a non-string expression.');return tmpResults.RawTokens;}/* Tokenize the expression
|
|
1337
1338
|
*
|
|
1338
1339
|
* Current token types:
|
|
1339
1340
|
* - Value
|
|
@@ -1386,7 +1387,7 @@ tmpCurrentTokenType='Value';tmpCurrentToken+=tmpCharacter;// continue;
|
|
|
1386
1387
|
// }
|
|
1387
1388
|
// tmpResults.ExpressionParserLog.push(`ExpressionParser.tokenize found an unknown character code ${tmpCharCode} character ${tmpCharacter} in the expression: ${pExpression} at index ${i}`);
|
|
1388
1389
|
// this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);
|
|
1389
|
-
}if(tmpCurrentTokenType&&tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}return tmpResults.RawTokens;}}]);}(libExpressionParserOperationBase);module.exports=ExpressionTokenizer;},{"./Fable-Service-ExpressionParser-Base.js":77}],79:[function(require,module,exports){module.exports={"sqrt":{"Name":"Square Root","Address":"fable.Math.sqrtPrecise"},"percent":{"Name":"Compute Percent (in IS over OF format)","Address":"fable.Math.percentagePrecise"},"compare":{"Name":"Compare","Address":"fable.Math.comparePrecise"},"abs":{"Name":"Absolute Value","Address":"fable.Math.absPrecise"},"floor":{"Name":"Floor Value","Address":"fable.Math.floorPrecise"},"ceil":{"Name":"Ceiling Value","Address":"fable.Math.ceilPrecise"},"rad":{"Name":"Degrees to Radians","Address":"fable.Math.radPrecise"},"pi":{"Name":"Pi","Address":"fable.Math.piPrecise"},"euler":{"Name":"Euler","Address":"fable.Math.eulerPrecise"},"sin":{"Name":"Sine","Address":"fable.Math.sin"},"cos":{"Name":"Cosine","Address":"fable.Math.cos"},"tan":{"Name":"Tangent","Address":"fable.Math.tan"},"count":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"countset":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"sortset":{"Name":"Sort Set","Address":"fable.Math.sortSetPrecise"},"bucketset":{"Name":"Bucket Set","Address":"fable.Math.bucketSetPrecise"},"sorthistogram":{"Name":"Sort Histogram","Address":"fable.Math.sortHistogramPrecise"},"max":{"Name":"Maximum","Address":"fable.Math.maxPrecise"},"min":{"Name":"Minimum","Address":"fable.Math.minPrecise"},"sum":{"Name":"Sum","Address":"fable.Math.sumPrecise"},"avg":{"Name":"Average","Address":"fable.Math.averagePrecise"},"mean":{"Name":"Mean","Address":"fable.Math.meanPrecise"},"median":{"Name":"Median","Address":"fable.Math.medianPrecise"},"mode":{"Name":"Mode","Address":"fable.Math.modePrecise"},"round":{"Name":"Round","Address":"fable.Math.roundPrecise"},"tofixed":{"Name":"To Fixed","Address":"fable.Math.toFixedPrecise"},"cumulativesummation":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.cumulativeSummation"},"countsetelements":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.countSetElements"},"getvalue":{"Name":"Get Value from Application State or Services (AppData, etc.)","Address":"fable.Utility.getInternalValueByHash"},"flatten":{"Name":"flatten an array of values","Address":"fable.Utility.flattenArrayOfSolverInputs"},"findfirstvaluebyexactmatch":{"Name":"find + map on array of objects","Address":"fable.Utility.findFirstValueByExactMatchInternal"},"findfirstvaluebystringincludes":{"Name":"find + map on array of objects","Address":"fable.Utility.findFirstValueByStringIncludesInternal"},"resolvehtmlentities":{"Name":"resolve HTML entities","Address":"fable.DataFormat.resolveHtmlEntities"},"concat":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsInternal"},"concatraw":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsRawInternal"},"join":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsInternal"},"joinraw":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsRawInternal"},"if":{"Name":"perform a conditional operator on two values, and choose one of two outcomes based on the result","Address":"fable.Logic.checkIf"},"when":{"Name":"perform a 'truthy' check on one value, and return one of two outcomes based on the result","Address":"fable.Logic.when"},"entryinset":{"Name":"Entry in Set","Address":"fable.Math.entryInSet"},"smallestinset":{"Name":"Smallest in Set","Address":"fable.Math.smallestInSet"},"largestinset":{"Name":"Largest in Set","Address":"fable.Math.largestInSet"},"aggregationhistogram":{"Name":"Generate a Histogram by Exact Value Aggregation","Address":"fable.Math.histogramAggregationByExactValueFromInternalState"},"distributionhistogram":{"Name":"Generate a Histogram Based on Value Distribution","Address":"fable.Math.histogramDistributionByExactValueFromInternalState"},"setconcatenate":{"Name":"Set Concatenate","Address":"fable.Math.setConcatenate"},"getvaluearray":{"Name":"Get Value Array from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueArrayByHashParametersFromInternal"},"getvalueobject":{"Name":"Get Value Object from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueObjectByHashParametersFromInternal"},"cleanvaluearray":{"Name":"Clean Value Array","Address":"fable.Math.cleanValueArray"},"cleanvalueobject":{"Name":"Clean Value Object","Address":"fable.Math.cleanValueObject"},"randominteger":{"Name":"Random Integer","Address":"fable.DataGeneration.randomInteger"},"randomintegerbetween":{"Name":"Random Integer Between Two Numbers","Address":"fable.DataGeneration.randomIntegerBetween"},"randomintegerupto":{"Name":"Random Integer","Address":"fable.DataGeneration.randomIntegerUpTo"},"randomfloat":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloat"},"randomfloatbetween":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatBetween"},"randomfloatupto":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatUpTo"},"datedaydifference":{"Name":"Date Difference in Days","Address":"fable.Dates.dateDayDifference"},"dateweekdifference":{"Name":"Date Difference in Weeks","Address":"fable.Dates.dateWeekDifference"},"datemonthdifference":{"Name":"Date Difference in Months","Address":"fable.Dates.dateMonthDifference"},"dateyeardifference":{"Name":"Date Difference in Years","Address":"fable.Dates.dateYearDifference"},"createValueObjectByHashes":{"Name":"Create Value Object by Hashes","Address":"fable.Utility.createValueObjectByHashes"}};},{}],80:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserLinter=/*#__PURE__*/function(_libExpressionParserO2){function ExpressionParserLinter(pFable,pOptions,pServiceHash){var
|
|
1390
|
+
}if(tmpCurrentTokenType&&tmpCurrentToken.length>0){tmpResults.RawTokens.push(tmpCurrentToken);}return tmpResults.RawTokens;}}]);}(libExpressionParserOperationBase);module.exports=ExpressionTokenizer;},{"./Fable-Service-ExpressionParser-Base.js":77}],79:[function(require,module,exports){module.exports={"sqrt":{"Name":"Square Root","Address":"fable.Math.sqrtPrecise"},"percent":{"Name":"Compute Percent (in IS over OF format)","Address":"fable.Math.percentagePrecise"},"compare":{"Name":"Compare","Address":"fable.Math.comparePrecise"},"abs":{"Name":"Absolute Value","Address":"fable.Math.absPrecise"},"floor":{"Name":"Floor Value","Address":"fable.Math.floorPrecise"},"ceil":{"Name":"Ceiling Value","Address":"fable.Math.ceilPrecise"},"rad":{"Name":"Degrees to Radians","Address":"fable.Math.radPrecise"},"pi":{"Name":"Pi","Address":"fable.Math.piPrecise"},"euler":{"Name":"Euler","Address":"fable.Math.eulerPrecise"},"sin":{"Name":"Sine","Address":"fable.Math.sin"},"cos":{"Name":"Cosine","Address":"fable.Math.cos"},"tan":{"Name":"Tangent","Address":"fable.Math.tan"},"count":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"countset":{"Name":"Count Set Elements","Address":"fable.Math.countSetElements"},"sortset":{"Name":"Sort Set","Address":"fable.Math.sortSetPrecise"},"bucketset":{"Name":"Bucket Set","Address":"fable.Math.bucketSetPrecise"},"sorthistogram":{"Name":"Sort Histogram","Address":"fable.Math.sortHistogramPrecise"},"max":{"Name":"Maximum","Address":"fable.Math.maxPrecise"},"min":{"Name":"Minimum","Address":"fable.Math.minPrecise"},"sum":{"Name":"Sum","Address":"fable.Math.sumPrecise"},"avg":{"Name":"Average","Address":"fable.Math.averagePrecise"},"mean":{"Name":"Mean","Address":"fable.Math.meanPrecise"},"median":{"Name":"Median","Address":"fable.Math.medianPrecise"},"mode":{"Name":"Mode","Address":"fable.Math.modePrecise"},"round":{"Name":"Round","Address":"fable.Math.roundPrecise"},"tofixed":{"Name":"To Fixed","Address":"fable.Math.toFixedPrecise"},"cumulativesummation":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.cumulativeSummation"},"countsetelements":{"Name":"Count Set Elements in a Histogram or Value Map","Address":"fable.Math.countSetElements"},"getvalue":{"Name":"Get Value from Application State or Services (AppData, etc.)","Address":"fable.Utility.getInternalValueByHash"},"flatten":{"Name":"flatten an array of values","Address":"fable.Utility.flattenArrayOfSolverInputs"},"findfirstvaluebyexactmatch":{"Name":"find + map on array of objects","Address":"fable.Utility.findFirstValueByExactMatchInternal"},"findfirstvaluebystringincludes":{"Name":"find + map on array of objects","Address":"fable.Utility.findFirstValueByStringIncludesInternal"},"resolvehtmlentities":{"Name":"resolve HTML entities","Address":"fable.DataFormat.resolveHtmlEntities"},"concat":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsInternal"},"concatraw":{"Name":"concatenate an array of values and output a string","Address":"fable.DataFormat.concatenateStringsRawInternal"},"join":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsInternal"},"joinraw":{"Name":"join an array of values and output a string","Address":"fable.DataFormat.joinStringsRawInternal"},"if":{"Name":"perform a conditional operator on two values, and choose one of two outcomes based on the result","Address":"fable.Logic.checkIf"},"when":{"Name":"perform a 'truthy' check on one value, and return one of two outcomes based on the result","Address":"fable.Logic.when"},"entryinset":{"Name":"Entry in Set","Address":"fable.Math.entryInSet"},"smallestinset":{"Name":"Smallest in Set","Address":"fable.Math.smallestInSet"},"largestinset":{"Name":"Largest in Set","Address":"fable.Math.largestInSet"},"aggregationhistogram":{"Name":"Generate a Histogram by Exact Value Aggregation","Address":"fable.Math.histogramAggregationByExactValueFromInternalState"},"distributionhistogram":{"Name":"Generate a Histogram Based on Value Distribution","Address":"fable.Math.histogramDistributionByExactValueFromInternalState"},"setconcatenate":{"Name":"Set Concatenate","Address":"fable.Math.setConcatenate"},"getvaluearray":{"Name":"Get Value Array from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueArrayByHashParametersFromInternal"},"getvalueobject":{"Name":"Get Value Object from Application State or Services (AppData, etc.)","Address":"fable.Utility.createValueObjectByHashParametersFromInternal"},"cleanvaluearray":{"Name":"Clean Value Array","Address":"fable.Math.cleanValueArray"},"cleanvalueobject":{"Name":"Clean Value Object","Address":"fable.Math.cleanValueObject"},"randominteger":{"Name":"Random Integer","Address":"fable.DataGeneration.randomInteger"},"randomintegerbetween":{"Name":"Random Integer Between Two Numbers","Address":"fable.DataGeneration.randomIntegerBetween"},"randomintegerupto":{"Name":"Random Integer","Address":"fable.DataGeneration.randomIntegerUpTo"},"randomfloat":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloat"},"randomfloatbetween":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatBetween"},"randomfloatupto":{"Name":"Random Float","Address":"fable.DataGeneration.randomFloatUpTo"},"datedaydifference":{"Name":"Date Difference in Days","Address":"fable.Dates.dateDayDifference"},"dateweekdifference":{"Name":"Date Difference in Weeks","Address":"fable.Dates.dateWeekDifference"},"datemonthdifference":{"Name":"Date Difference in Months","Address":"fable.Dates.dateMonthDifference"},"dateyeardifference":{"Name":"Date Difference in Years","Address":"fable.Dates.dateYearDifference"},"createValueObjectByHashes":{"Name":"Create Value Object by Hashes","Address":"fable.Utility.createValueObjectByHashes"}};},{}],80:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserLinter=/*#__PURE__*/function(_libExpressionParserO2){function ExpressionParserLinter(pFable,pOptions,pServiceHash){var _this23;_classCallCheck2(this,ExpressionParserLinter);_this23=_callSuper(this,ExpressionParserLinter,[pFable,pOptions,pServiceHash]);_this23.serviceType='ExpressionParser-Linter';return _this23;}_inherits(ExpressionParserLinter,_libExpressionParserO2);return _createClass2(ExpressionParserLinter,[{key:"lintTokenizedExpression",value:function lintTokenizedExpression(pTokenizedExpression,pResultObject){var tmpResults=_typeof(pResultObject)==='object'?pResultObject:{ExpressionParserLog:[]};tmpResults.LinterResults=[];// Guard against bad data being passed in
|
|
1390
1391
|
if(!Array.isArray(pTokenizedExpression)){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.lintTokenizedExpression was passed a non-array tokenized expression.");tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return pTokenizedExpression;}if(pTokenizedExpression.length<1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.lintTokenizedExpression was passed an empty tokenized expression.");tmpResults.LinterResults.push(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return pTokenizedExpression;}// 1. Check for balanced parenthesis
|
|
1391
1392
|
var tmpParenthesisDepth=0;// If it is in a state address, we don't care about the parenthesis
|
|
1392
1393
|
// State addresses are between squiggly brackets
|
|
@@ -1409,11 +1410,11 @@ if(pTokenizedExpression[_i6]!=='+'&&pTokenizedExpression[_i6]!=='-'){tmpResults.
|
|
|
1409
1410
|
* Represents a user-friendly messaging service for the ExpressionParser compiler output.
|
|
1410
1411
|
* @class ExpressionParserMessaging
|
|
1411
1412
|
* @extends libExpressionParserOperationBase
|
|
1412
|
-
*/var ExpressionParserMessaging=/*#__PURE__*/function(_libExpressionParserO3){function ExpressionParserMessaging(pFable,pOptions,pServiceHash){var
|
|
1413
|
+
*/var ExpressionParserMessaging=/*#__PURE__*/function(_libExpressionParserO3){function ExpressionParserMessaging(pFable,pOptions,pServiceHash){var _this24;_classCallCheck2(this,ExpressionParserMessaging);_this24=_callSuper(this,ExpressionParserMessaging,[pFable,pOptions,pServiceHash]);_this24.serviceType='ExpressionParser-Messaging';return _this24;}_inherits(ExpressionParserMessaging,_libExpressionParserO3);return _createClass2(ExpressionParserMessaging,[{key:"getOperationVirtualSymbolName",value:function getOperationVirtualSymbolName(pOperationToken){return pOperationToken&&'VirtualSymbolName'in pOperationToken?pOperationToken.VirtualSymbolName:pOperationToken.Type==='Token.VirtualSymbol'?pOperationToken.Token:'NO_VIRTUAL_SYMBOL_NAME_FOUND';}},{key:"getVirtualTokenValue",value:function getVirtualTokenValue(pToken,pOperationResults){var tmpVirtualSymbol=this.getOperationVirtualSymbolName(pToken);if((pToken.Type=='Token.Symbol'||pToken.Type=='Token.Constant')&&pToken.Value){return pToken.Value.toString();}var tmpVirtualSymbolData='VirtualSymbols'in pOperationResults?pOperationResults.VirtualSymbols:{};if(this.ExpressionParser.GenericManifest.checkAddressExists(tmpVirtualSymbolData,tmpVirtualSymbol)){var tmpValue=this.ExpressionParser.GenericManifest.getValueAtAddress(tmpVirtualSymbolData,tmpVirtualSymbol);if(_typeof(tmpValue)==='object'){return"{".concat(Object.keys(tmpValue).length," values}");}if(Array.isArray(tmpValue)){return"[".concat(Object.keys(tmpValue).length," values]");}return tmpValue;}return'NO_VALUE_FOUND';}},{key:"getTokenAddressString",value:function getTokenAddressString(pToken){return pExpression.Token;}},{key:"getTokenSymbolString",value:function getTokenSymbolString(pExpressionToken){return pExpressionToken.Token;}},{key:"getOperationSymbolMessage",value:function getOperationSymbolMessage(pOperation){if(!pOperation){return'INVALID_OPERATION';}var tmpOperationVirtualSymbol=this.getOperationVirtualSymbolName(pOperation);var tmpOperationLeftValue=this.getTokenSymbolString(pOperation.LeftValue);var tmpOperationSymbol=this.getTokenSymbolString(pOperation.Operation);var tmpOperationRightValue=this.getTokenSymbolString(pOperation.RightValue);var tmpVirtualSymbolPrefix=tmpOperationVirtualSymbol.substring(0,3);if(tmpOperationSymbol==='='){// Assignment operators are special
|
|
1413
1414
|
return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationLeftValue);}if(tmpVirtualSymbolPrefix==='VFE'){// Virtual Function Expression
|
|
1414
1415
|
return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationSymbol,"(").concat(tmpOperationLeftValue,")");}return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationLeftValue," ").concat(tmpOperationSymbol," ").concat(tmpOperationRightValue);}},{key:"getOperationValueMessage",value:function getOperationValueMessage(pOperation,pResultObject){if(!pOperation){return'INVALID_OPERATION';}var tmpOperationVirtualSymbol=this.getOperationVirtualSymbolName(pOperation);var tmpOperationLeftValue=this.getVirtualTokenValue(pOperation.LeftValue,pResultObject);var tmpOperationSymbol=this.getTokenSymbolString(pOperation.Operation);var tmpOperationRightValue=this.getVirtualTokenValue(pOperation.RightValue,pResultObject);var tmpVirtualSymbolPrefix=tmpOperationVirtualSymbol.substring(0,3);if(tmpOperationSymbol==='='){// Assignment operators are special
|
|
1415
1416
|
return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationLeftValue);}if(tmpVirtualSymbolPrefix==='VFE'){// Virtual Function Expression
|
|
1416
|
-
return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationSymbol,"(").concat(tmpOperationLeftValue,")");}return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationLeftValue," ").concat(tmpOperationSymbol," ").concat(tmpOperationRightValue);}},{key:"getOperationOutcomeMessage",value:function getOperationOutcomeMessage(pToken,pOperationResults){if(!pToken){return'INVALID_TOKEN';}var tmpOperationVirtualSymbol=this.getOperationVirtualSymbolName(pToken);var tmpOperationOutcomeValue=this.getVirtualTokenValue(pToken,pOperationResults);return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationOutcomeValue);}},{key:"logFunctionOutcome",value:function logFunctionOutcome(pResultObject){if(_typeof(pResultObject)!=='object'){this.log.error("Solver results object was not an object. Cannot log outcome.");return;}var tmpAssignmentAddress='PostfixedAssignmentAddress'in pResultObject?pResultObject.PostfixedAssignmentAddress:'NO_ASSIGNMENT_ADDRESS_FOUND';var tmpRawExpression='RawExpression'in pResultObject?pResultObject.RawExpression:'NO_EXPRESSION_FOUND';var tmpRawResult='RawResult'in pResultObject?pResultObject.RawResult:'NO_RESULT_FOUND';this.log.info("Solved f(".concat(tmpAssignmentAddress,") = {").concat(tmpRawExpression,"}"));for(var i=0;i<pResultObject.PostfixSolveList.length;i++){var tmpToken=pResultObject.PostfixSolveList[i];var tmpTokenSymbolMessage=this.getOperationSymbolMessage(tmpToken);this.log.info("".concat(i," Symbols: ").concat(tmpTokenSymbolMessage));var tmpTokenValueMessage=this.getOperationValueMessage(tmpToken,pResultObject);this.log.info("".concat(i," Values: ").concat(tmpTokenValueMessage));var tmpTokenOutcome=this.getOperationOutcomeMessage(tmpToken,pResultObject);this.log.info("".concat(i," Outcome: ").concat(tmpTokenOutcome));}this.log.info("{".concat(tmpRawExpression,"} = ").concat(tmpRawResult));}},{key:"logFunctionSolve",value:function logFunctionSolve(pResultObject){if(_typeof(pResultObject)!=='object'){this.log.error("Solver results object was not an object. Cannot log the solve.");return;}if(!('PostfixSolveList'in pResultObject)||!Array.isArray(pResultObject.PostfixSolveList)){this.log.error("Solver results object did not contain a PostfixSolveList array. Cannot log the solve.");return;}for(var i=0;i<pResultObject.PostfixSolveList.length;i++){var tmpToken=pResultObject.PostfixSolveList[i];console.log("".concat(i,": ").concat(tmpToken.VirtualSymbolName," = (").concat(tmpToken.LeftValue.Token,"::").concat(tmpToken.LeftValue.Value,") ").concat(tmpToken.Operation.Token," (").concat(tmpToken.RightValue.Token,"::").concat(tmpToken.RightValue.Value,") "));}this.logFunctionOutcome(pResultObject);}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserMessaging;},{"./Fable-Service-ExpressionParser-Base.js":77,"big.js":17}],82:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserPostfix=/*#__PURE__*/function(_libExpressionParserO4){function ExpressionParserPostfix(pFable,pOptions,pServiceHash){var
|
|
1417
|
+
return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationSymbol,"(").concat(tmpOperationLeftValue,")");}return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationLeftValue," ").concat(tmpOperationSymbol," ").concat(tmpOperationRightValue);}},{key:"getOperationOutcomeMessage",value:function getOperationOutcomeMessage(pToken,pOperationResults){if(!pToken){return'INVALID_TOKEN';}var tmpOperationVirtualSymbol=this.getOperationVirtualSymbolName(pToken);var tmpOperationOutcomeValue=this.getVirtualTokenValue(pToken,pOperationResults);return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationOutcomeValue);}},{key:"logFunctionOutcome",value:function logFunctionOutcome(pResultObject){if(_typeof(pResultObject)!=='object'){this.log.error("Solver results object was not an object. Cannot log outcome.");return;}var tmpAssignmentAddress='PostfixedAssignmentAddress'in pResultObject?pResultObject.PostfixedAssignmentAddress:'NO_ASSIGNMENT_ADDRESS_FOUND';var tmpRawExpression='RawExpression'in pResultObject?pResultObject.RawExpression:'NO_EXPRESSION_FOUND';var tmpRawResult='RawResult'in pResultObject?pResultObject.RawResult:'NO_RESULT_FOUND';this.log.info("Solved f(".concat(tmpAssignmentAddress,") = {").concat(tmpRawExpression,"}"));for(var i=0;i<pResultObject.PostfixSolveList.length;i++){var tmpToken=pResultObject.PostfixSolveList[i];var tmpTokenSymbolMessage=this.getOperationSymbolMessage(tmpToken);this.log.info("".concat(i," Symbols: ").concat(tmpTokenSymbolMessage));var tmpTokenValueMessage=this.getOperationValueMessage(tmpToken,pResultObject);this.log.info("".concat(i," Values: ").concat(tmpTokenValueMessage));var tmpTokenOutcome=this.getOperationOutcomeMessage(tmpToken,pResultObject);this.log.info("".concat(i," Outcome: ").concat(tmpTokenOutcome));}this.log.info("{".concat(tmpRawExpression,"} = ").concat(tmpRawResult));}},{key:"logFunctionSolve",value:function logFunctionSolve(pResultObject){if(_typeof(pResultObject)!=='object'){this.log.error("Solver results object was not an object. Cannot log the solve.");return;}if(!('PostfixSolveList'in pResultObject)||!Array.isArray(pResultObject.PostfixSolveList)){this.log.error("Solver results object did not contain a PostfixSolveList array. Cannot log the solve.");return;}for(var i=0;i<pResultObject.PostfixSolveList.length;i++){var tmpToken=pResultObject.PostfixSolveList[i];console.log("".concat(i,": ").concat(tmpToken.VirtualSymbolName," = (").concat(tmpToken.LeftValue.Token,"::").concat(tmpToken.LeftValue.Value,") ").concat(tmpToken.Operation.Token," (").concat(tmpToken.RightValue.Token,"::").concat(tmpToken.RightValue.Value,") "));}this.logFunctionOutcome(pResultObject);}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserMessaging;},{"./Fable-Service-ExpressionParser-Base.js":77,"big.js":17}],82:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserPostfix=/*#__PURE__*/function(_libExpressionParserO4){function ExpressionParserPostfix(pFable,pOptions,pServiceHash){var _this25;_classCallCheck2(this,ExpressionParserPostfix);_this25=_callSuper(this,ExpressionParserPostfix,[pFable,pOptions,pServiceHash]);_this25.serviceType='ExpressionParser-Postfix';return _this25;}_inherits(ExpressionParserPostfix,_libExpressionParserO4);return _createClass2(ExpressionParserPostfix,[{key:"getPosfixSolveListOperation",value:function getPosfixSolveListOperation(pOperation,pLeftValue,pRightValue,pDepthSolveList,pDepthSolveIndex){var tmpOperation={VirtualSymbolName:pOperation.VirtualSymbolName,Operation:pOperation,LeftValue:pLeftValue,RightValue:pRightValue};var tmpDepthSolveList=Array.isArray(pDepthSolveList)?pDepthSolveList:false;/* These two if blocks are very complex -- they basically provide a
|
|
1417
1418
|
* way to deal with recursion that can be expressed to the user in
|
|
1418
1419
|
* a meaningful way.
|
|
1419
1420
|
*
|
|
@@ -1465,63 +1466,63 @@ tmpResults.PostfixLayerstackMap={};//FIXME: vet these - do we need a suffix vers
|
|
|
1465
1466
|
var unaryEligibleOperationTokens=['+','-'];var unaryOperationPrefixTriggerTypes=['Token.Operator','Token.Assignment'];for(var tmpSolveLayerIndex=0;tmpSolveLayerIndex<tmpSolveLayerKeys.length;tmpSolveLayerIndex++){var tmpSolveLayerTokens=tmpSolveLayerMap[tmpSolveLayerKeys[tmpSolveLayerIndex]];// For each precedence (this isn't strictly required here but makes the outcome for the user more readable)
|
|
1466
1467
|
for(var tmpPrecedence=0;tmpPrecedence<=this.ExpressionParser.tokenMaxPrecedence;tmpPrecedence++){// Enumerate all tokens in a layer's expression.
|
|
1467
1468
|
// There is a recursive way to do this, but given the short length of even the most complex equations we're favoring readability.
|
|
1468
|
-
for(var
|
|
1469
|
+
for(var _i10=0;_i10<tmpSolveLayerTokens.length;_i10++){var tmpToken=tmpSolveLayerTokens[_i10];if(unaryEligibleOperationTokens.includes(tmpToken.Token)&&(// promote to unary if:
|
|
1469
1470
|
// 1. we are the first token in our group
|
|
1470
1471
|
// 2. we are prefixed by a token type that is incompatible with us being binary
|
|
1471
|
-
|
|
1472
|
+
_i10==0||unaryOperationPrefixTriggerTypes.includes(tmpSolveLayerTokens[_i10-1].Type))){//FIXME: slow, but don't break the static data
|
|
1472
1473
|
tmpToken.Descriptor=JSON.parse(JSON.stringify(tmpToken.Descriptor));tmpToken.Descriptor.Precedence=1;}//FIXME: handle operators with dynamic precedence (ex. unary vs. bunary + and -)
|
|
1473
1474
|
// If the token is an operator and at the current precedence, add it to the postfix solve list and mutate the array.
|
|
1474
|
-
if(tmpSolveLayerTokens[
|
|
1475
|
-
if(tmpSolveLayerTokens.length===1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found a single operator in a solve layer expression at token index ".concat(
|
|
1476
|
-
else if(
|
|
1477
|
-
else if(
|
|
1478
|
-
else if(
|
|
1479
|
-
else if(
|
|
1475
|
+
if(tmpSolveLayerTokens[_i10].Type==='Token.Operator'&&tmpToken.Descriptor.Precedence===tmpPrecedence){// If there is a token and nothing else in this layer, then it's an error.
|
|
1476
|
+
if(tmpSolveLayerTokens.length===1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found a single operator in a solve layer expression at token index ".concat(_i10));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return tmpResults.PostfixSolveList;}// The - at the beginning of an expression is a number line orientation modifier
|
|
1477
|
+
else if(_i10==0&&(tmpToken.Token=='-'||tmpToken.Token=='+')){tmpToken.VirtualSymbolName="VNLO_".concat(tmpVirtualSymbolIndex);tmpResults.PostfixLayerstackMap[tmpToken.SolveLayerStack]=tmpToken.VirtualSymbolName;tmpVirtualSymbolIndex++;}// If the token is at the beginning of the expression and not a number line orientation modifier, it's an error.
|
|
1478
|
+
else if(_i10==0&&(tmpToken.Token!='+'||tmpToken.Token!='-')){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found an operator at the beginning of a solve layer expression at token index ".concat(_i10));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return tmpResults.PostfixSolveList;}// If the token is at the end of the expression, it is an error.
|
|
1479
|
+
else if(_i10==tmpSolveLayerTokens.length-1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found an operator at the end of a solve layer expression at token index ".concat(_i10));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return tmpResults.PostfixSolveList;}// The - after an operator or an open parenthesis is also a number line orientation modifier
|
|
1480
|
+
else if(_i10>0&&tmpToken.Token=='-'&&(tmpSolveLayerTokens[_i10-1].Type==='Token.Operator'||tmpSolveLayerTokens[_i10-1].Token==='(')){// The number line negation operator is a special case that generates a virtual constant (-1.0) and multiplies it by the next token
|
|
1480
1481
|
tmpToken.VirtualSymbolName="VNLO_".concat(tmpVirtualSymbolIndex);tmpVirtualSymbolIndex++;}// The + at the beginning is also a number line orientation modifier ... THAT WE IGNORE
|
|
1481
|
-
else if(
|
|
1482
|
-
else if(
|
|
1483
|
-
else if((tmpSolveLayerTokens[
|
|
1484
|
-
else{tmpToken.VirtualSymbolName="V_".concat(tmpVirtualSymbolIndex);tmpResults.PostfixLayerstackMap[tmpToken.SolveLayerStack]=tmpToken.VirtualSymbolName;tmpVirtualSymbolIndex++;}}else if(tmpSolveLayerTokens[
|
|
1482
|
+
else if(_i10==0&&tmpToken.Token=='+'){continue;}// The + after an operator or a parenthesis is also a number line orientation modifier ... THAT WE IGNORE
|
|
1483
|
+
else if(_i10>0&&tmpToken.Token=='+'&&(tmpSolveLayerTokens[_i10-1].Type==='Token.Operator'||tmpSolveLayerTokens[_i10-1].Token==='(')){continue;}// If the token is next to another operator it's a parsing error
|
|
1484
|
+
else if((tmpSolveLayerTokens[_i10-1].Type==='Token.Operator'||tmpSolveLayerTokens[_i10+1].Type==='Token.Operator')&&tmpSolveLayerTokens[_i10+1].Token!='-'&&tmpSolveLayerTokens[_i10+1].Token!='+'){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found an operator at token index ".concat(_i10," that is not surrounded by two values."));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return tmpResults.PostfixSolveList;}// Finally add a virtual symbol name to the dang thing.
|
|
1485
|
+
else{tmpToken.VirtualSymbolName="V_".concat(tmpVirtualSymbolIndex);tmpResults.PostfixLayerstackMap[tmpToken.SolveLayerStack]=tmpToken.VirtualSymbolName;tmpVirtualSymbolIndex++;}}else if(tmpSolveLayerTokens[_i10].Type==='Token.Function'&&tmpPrecedence===0){var _tmpToken=tmpSolveLayerTokens[_i10];_tmpToken.VirtualSymbolName="VFE_".concat(tmpVirtualSymbolIndex);tmpVirtualSymbolIndex++;tmpResults.PostfixLayerstackMap[_tmpToken.SolveLayerStack]=_tmpToken.VirtualSymbolName;}}}}// 5.15 Generate Virtual Symbol Clusters for Functions and Parenthesis
|
|
1485
1486
|
// ... this gets funny because of precedence of operations surrounding them, parenthesis and functions.
|
|
1486
|
-
var tmpFunctionCacheLIFOStack=[];for(var
|
|
1487
|
+
var tmpFunctionCacheLIFOStack=[];for(var _i11=0;_i11<tmpResults.PostfixTokenObjects.length;_i11++){var tmpPostfixTokenObject=tmpResults.PostfixTokenObjects[_i11];if(tmpPostfixTokenObject.Type==='Token.Parenthesis'){// This is just to track the parenthesis stack level for User feedback
|
|
1487
1488
|
tmpPostfixTokenObject.ParenthesisStack=tmpPostfixTokenObject.VirtualSymbolName;// At the beginning of the expression, this must be an open parenthesis to be legal.
|
|
1488
|
-
if(
|
|
1489
|
+
if(_i11==0){tmpPostfixTokenObject.IsFunction=false;var tmpVirtualSymbolName=tmpResults.PostfixLayerstackMap[tmpPostfixTokenObject.VirtualSymbolName];if(!tmpVirtualSymbolName){// ... this parenthesis group has no operators in it; make a virtual symbol name.
|
|
1489
1490
|
tmpVirtualSymbolName="VP_".concat(tmpVirtualSymbolIndex);tmpVirtualSymbolIndex++;}tmpPostfixTokenObject.VirtualSymbolName=tmpVirtualSymbolName;tmpFunctionCacheLIFOStack.push(tmpPostfixTokenObject);}// If it's an open parenthesis
|
|
1490
1491
|
else if(tmpPostfixTokenObject.Token==='('){// ... supporting a function
|
|
1491
|
-
if(tmpResults.PostfixTokenObjects[
|
|
1492
|
+
if(tmpResults.PostfixTokenObjects[_i11-1].Type==='Token.Function'){tmpPostfixTokenObject.IsFunction=true;tmpPostfixTokenObject.Function=tmpResults.PostfixTokenObjects[_i11-1];var _tmpVirtualSymbolName=tmpResults.PostfixLayerstackMap[tmpPostfixTokenObject.VirtualSymbolName];if(!_tmpVirtualSymbolName){// ... this parenthesis group has no operators in it; make a virtual symbol name.
|
|
1492
1493
|
_tmpVirtualSymbolName="VFP_".concat(tmpVirtualSymbolIndex);tmpVirtualSymbolIndex++;}tmpPostfixTokenObject.VirtualSymbolName=_tmpVirtualSymbolName;}else{tmpPostfixTokenObject.IsFunction=false;var _tmpVirtualSymbolName2=tmpResults.PostfixLayerstackMap[tmpPostfixTokenObject.VirtualSymbolName];if(!_tmpVirtualSymbolName2){// This is a parenthesis group with no operators in it; make a virtual symbol name.
|
|
1493
1494
|
_tmpVirtualSymbolName2="VP_".concat(tmpVirtualSymbolIndex);tmpVirtualSymbolIndex++;}tmpPostfixTokenObject.VirtualSymbolName=_tmpVirtualSymbolName2;}tmpFunctionCacheLIFOStack.push(tmpPostfixTokenObject);}else if(tmpPostfixTokenObject.Token===')'){var tmpOpenParenthesis=tmpFunctionCacheLIFOStack.pop();if(tmpOpenParenthesis.IsFunction){tmpPostfixTokenObject.IsFunction=true;tmpPostfixTokenObject.VirtualSymbolName=tmpOpenParenthesis.Function.VirtualSymbolName;}else{tmpPostfixTokenObject.IsFunction=false;tmpPostfixTokenObject.VirtualSymbolName=tmpOpenParenthesis.VirtualSymbolName;}}}}// X. Postprocess the parenthesis groups to ensure they respect the order of operations for their boundaries
|
|
1494
|
-
for(var _tmpSolveLayerIndex=0;_tmpSolveLayerIndex<tmpSolveLayerKeys.length;_tmpSolveLayerIndex++){var tmpParenthesisStack=[];var tmpLastOperator=false;var _tmpSolveLayerTokens=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex]];for(var
|
|
1495
|
+
for(var _tmpSolveLayerIndex=0;_tmpSolveLayerIndex<tmpSolveLayerKeys.length;_tmpSolveLayerIndex++){var tmpParenthesisStack=[];var tmpLastOperator=false;var _tmpSolveLayerTokens=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex]];for(var _i12=0;_i12<_tmpSolveLayerTokens.length;_i12++){var _tmpPostfixTokenObject=_tmpSolveLayerTokens[_i12];// Keep track of the last operator
|
|
1495
1496
|
if(_tmpPostfixTokenObject.Type==='Token.Operator'){tmpLastOperator=_tmpPostfixTokenObject;}// This is only important to do at the close parenthesis.
|
|
1496
1497
|
if(_tmpPostfixTokenObject.Type==='Token.Function'){_tmpPostfixTokenObject.PreviousOperator=tmpLastOperator;}else if(_tmpPostfixTokenObject.Type==='Token.Parenthesis'&&_tmpPostfixTokenObject.Token==='('&&_tmpPostfixTokenObject.IsFunction){tmpParenthesisStack.push(_tmpPostfixTokenObject);if(_tmpPostfixTokenObject.Function.PreviousOperator){_tmpPostfixTokenObject.PreviousOperator=_tmpPostfixTokenObject.Function.PreviousOperator;}}else if(_tmpPostfixTokenObject.Type==='Token.Parenthesis'&&_tmpPostfixTokenObject.Token==='('){_tmpPostfixTokenObject.PreviousOperator=tmpLastOperator;tmpParenthesisStack.push(_tmpPostfixTokenObject);}else if(_tmpPostfixTokenObject.Type==='Token.Parenthesis'&&_tmpPostfixTokenObject.Token===')'){// This is ultra complex, and binds the order of operations logic to the open parenthesis for the group
|
|
1497
|
-
var _tmpOpenParenthesis=tmpParenthesisStack.pop();if(
|
|
1498
|
+
var _tmpOpenParenthesis=tmpParenthesisStack.pop();if(_i12<_tmpSolveLayerTokens.length-1){for(var j=_i12+1;j<_tmpSolveLayerTokens.length;j++){if(_tmpSolveLayerTokens[j].Type==='Token.Operator'){_tmpOpenParenthesis.NextOperator=_tmpSolveLayerTokens[j];break;}}}if(_tmpOpenParenthesis.PreviousOperator&&_tmpOpenParenthesis.NextOperator){if(_tmpOpenParenthesis.PreviousOperator.Descriptor.Precedence<=_tmpOpenParenthesis.NextOperator.Descriptor.Precedence){_tmpOpenParenthesis.NextOperator.LeftVirtualSymbolName=_tmpOpenParenthesis.PreviousOperator.VirtualSymbolName;}else{_tmpOpenParenthesis.PreviousOperator.RightVirtualSymbolName=_tmpOpenParenthesis.NextOperator.VirtualSymbolName;}}}else{if(!('SolveLayerStack'in _tmpPostfixTokenObject)){// Decorate the solve layer stack for the token
|
|
1498
1499
|
if(tmpParenthesisStack.length>0){_tmpPostfixTokenObject.SolveLayerStack=tmpParenthesisStack[tmpParenthesisStack.length-1].SolveLayerStack;}else{_tmpPostfixTokenObject.SolveLayerStack='Expression_Root';}}}}}// 5.2.9: Make sure the affinity of operators is respecting order of operations.
|
|
1499
1500
|
// Walk backwards and forwards, hoisting same value precedence backwards/forwards
|
|
1500
1501
|
// across each layer... the precedence change needs to be decreasing to matter
|
|
1501
|
-
for(var _tmpSolveLayerIndex2=0;_tmpSolveLayerIndex2<tmpSolveLayerKeys.length;_tmpSolveLayerIndex2++){var tmpLastPrecedence=false;var tmpFinalChainToken=false;var _tmpSolveLayerTokens2=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex2]];for(var
|
|
1502
|
+
for(var _tmpSolveLayerIndex2=0;_tmpSolveLayerIndex2<tmpSolveLayerKeys.length;_tmpSolveLayerIndex2++){var tmpLastPrecedence=false;var tmpFinalChainToken=false;var _tmpSolveLayerTokens2=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex2]];for(var _i13=_tmpSolveLayerTokens2.length-1;_i13>=0;_i13--){var _tmpToken2=_tmpSolveLayerTokens2[_i13];if(_tmpToken2.Type==='Token.Operator'){if(!tmpFinalChainToken){tmpFinalChainToken=_tmpToken2;}else if(_tmpToken2.Descriptor.Precedence>tmpLastPrecedence){// This is less imporant than the last precedence, so hoist back the virtual value
|
|
1502
1503
|
_tmpToken2.RightVirtualSymbolName=tmpFinalChainToken.VirtualSymbolName;//console.log(`Hoisting ${tmpToken.Token} back to ${tmpFinalChainToken.Token}`);
|
|
1503
|
-
tmpFinalChainToken=_tmpToken2;}else if(_tmpToken2.Descriptor.Precedence<tmpLastPrecedence){tmpFinalChainToken=_tmpToken2;}tmpLastPrecedence=_tmpToken2.Descriptor.Precedence;}}var tmpDecreasingPrecedenceStack=[];var tmpLastToken=false;for(var
|
|
1504
|
+
tmpFinalChainToken=_tmpToken2;}else if(_tmpToken2.Descriptor.Precedence<tmpLastPrecedence){tmpFinalChainToken=_tmpToken2;}tmpLastPrecedence=_tmpToken2.Descriptor.Precedence;}}var tmpDecreasingPrecedenceStack=[];var tmpLastToken=false;for(var _i14=_tmpSolveLayerTokens2.length-1;_i14>=0;_i14--){var _tmpToken3=_tmpSolveLayerTokens2[_i14];if(_tmpToken3.Type==='Token.Operator'){if(!tmpLastToken){tmpLastToken=_tmpToken3;}else if(_tmpToken3.Descriptor.Precedence>tmpLastPrecedence){// Check and see if this needs to be resolved in the stack
|
|
1504
1505
|
if(tmpDecreasingPrecedenceStack.length>0){for(var _j=tmpDecreasingPrecedenceStack.length-1;_j>=0;_j--){if(tmpDecreasingPrecedenceStack[_j].Descriptor.Precedence>=_tmpToken3.Descriptor.Precedence){//console.log(`Hoisting ${tmpDecreasingPrecedenceStack[j].Token} up to ${tmpToken.Token}`);
|
|
1505
1506
|
tmpDecreasingPrecedenceStack[_j].LeftVirtualSymbolName=_tmpToken3.VirtualSymbolName;tmpDecreasingPrecedenceStack.slice(_j,1);break;}}}tmpLastToken=_tmpToken3;}else if(_tmpToken3.Descriptor.Precedence<tmpLastPrecedence){tmpDecreasingPrecedenceStack.push(tmpLastToken);tmpLastToken=_tmpToken3;}tmpLastPrecedence=_tmpToken3.Descriptor.Precedence;}}}// 5.3: Generate the Postfix Solve List
|
|
1506
1507
|
for(var _tmpSolveLayerIndex3=0;_tmpSolveLayerIndex3<tmpSolveLayerKeys.length;_tmpSolveLayerIndex3++){var _tmpSolveLayerTokens3=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex3]];// If this is a layer with one value, presume it's an assignment.
|
|
1507
1508
|
if(_tmpSolveLayerTokens3.length===1){// TODO: I think this is correct but with the addition of multiple assignment operators it's less clear.
|
|
1508
1509
|
var _tmpAbstractAssignToken=this.getTokenContainerObject('=');_tmpAbstractAssignToken.VirtualSymbolName=tmpResults.PostfixLayerstackMap[_tmpSolveLayerTokens3[0].SolveLayerStack];// If this doesn't have a matching solvelayerstack, get the virtual symbol name from the parenthesis group it's in
|
|
1509
|
-
if(!_tmpAbstractAssignToken.VirtualSymbolName){for(var
|
|
1510
|
+
if(!_tmpAbstractAssignToken.VirtualSymbolName){for(var _i15=0;_i15<tmpResults.PostfixTokenObjects.length;_i15++){if(tmpResults.PostfixTokenObjects[_i15].ParenthesisStack===_tmpSolveLayerTokens3[0].SolveLayerStack){_tmpAbstractAssignToken.VirtualSymbolName=tmpResults.PostfixTokenObjects[_i15].VirtualSymbolName;break;}}}tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractAssignToken,_tmpSolveLayerTokens3[0],this.getTokenContainerObject('0.0')));continue;}// For each precedence level in the layer
|
|
1510
1511
|
for(var _tmpPrecedence=0;_tmpPrecedence<=this.ExpressionParser.tokenMaxPrecedence;_tmpPrecedence++){// Enumerate all tokens in a layer's expression.
|
|
1511
1512
|
// There is a recursive way to do this, but given the short length of even the most complex equations we're favoring readability.
|
|
1512
|
-
for(var
|
|
1513
|
-
if(_tmpSolveLayerTokens3[
|
|
1514
|
-
if(
|
|
1513
|
+
for(var _i16=0;_i16<_tmpSolveLayerTokens3.length;_i16++){// If the token is an operator and at the current precedence, add it to the postfix solve list and mutate the array.
|
|
1514
|
+
if(_tmpSolveLayerTokens3[_i16].Type==='Token.Operator'&&_tmpSolveLayerTokens3[_i16].Descriptor.Precedence===_tmpPrecedence){var _tmpToken4=_tmpSolveLayerTokens3[_i16];// The - at the beginning of an expression is a number line orientation modifier
|
|
1515
|
+
if(_i16==0&&_tmpToken4.Token=='-'){// The number line negation operator is a special case that generates a virtual constant (-1.0) and multiplies it by the next token
|
|
1515
1516
|
// This is an abstract operation that isn't in the expression.
|
|
1516
|
-
var tmpAbstractMultiplyToken=this.getTokenContainerObject('*');tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[
|
|
1517
|
-
else if(
|
|
1518
|
-
var _tmpAbstractMultiplyToken=this.getTokenContainerObject('*');_tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[
|
|
1519
|
-
else if(
|
|
1520
|
-
else if(
|
|
1521
|
-
else{tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken4,_tmpSolveLayerTokens3[
|
|
1517
|
+
var tmpAbstractMultiplyToken=this.getTokenContainerObject('*');tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[_i16+1]));}// The - after an operator or an open parenthesis is also a number line orientation modifier
|
|
1518
|
+
else if(_i16>0&&_tmpToken4.Token=='-'&&(_tmpSolveLayerTokens3[_i16-1].Type==='Token.Operator'||_tmpSolveLayerTokens3[_i16-1].Token==='(')){// The number line negation operator is a special case that generates a virtual constant (-1.0) and multiplies it by the next token
|
|
1519
|
+
var _tmpAbstractMultiplyToken=this.getTokenContainerObject('*');_tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[_i16+1]));}// The + at the beginning is also a number line orientation modifier ... THAT WE IGNORE
|
|
1520
|
+
else if(_i16==0&&_tmpToken4.Token=='+'){continue;}// The + after an operator or a parenthesis is also a number line orientation modifier ... THAT WE IGNORE
|
|
1521
|
+
else if(_i16>0&&_tmpToken4.Token=='+'&&(_tmpSolveLayerTokens3[_i16-1].Type==='Token.Operator'||_tmpSolveLayerTokens3[_i16-1].Token==='(')){continue;}// Finally add the dang thing.
|
|
1522
|
+
else{tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken4,_tmpSolveLayerTokens3[_i16-1],_tmpSolveLayerTokens3[_i16+1],_tmpSolveLayerTokens3,_i16));}}else if(_tmpSolveLayerTokens3[_i16].Type==='Token.Function'&&_tmpPrecedence===0){var _tmpToken5=_tmpSolveLayerTokens3[_i16];tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken5,_tmpSolveLayerTokens3[_i16+1],this.getTokenContainerObject('0.0')));}}}}// 7. Lastly set the assignment address.
|
|
1522
1523
|
var tmpAbstractAssignToken='PostfixedAssignmentOperator'in tmpResults?this.getTokenContainerObject(tmpResults.PostfixedAssignmentOperator.Token):this.getTokenContainerObject('=');// The address we are assigning to
|
|
1523
1524
|
tmpAbstractAssignToken.VirtualSymbolName=tmpResults.PostfixedAssignmentAddress;// The address it's coming from
|
|
1524
|
-
var tmpSolveResultToken=this.getTokenContainerObject('Result','Token.LastResult');var tmpFinalAssignmentInstruction=this.getPosfixSolveListOperation(tmpAbstractAssignToken,tmpSolveResultToken,this.getTokenContainerObject('SolverMarshal','Token.SolverMarshal'));tmpResults.PostfixSolveList.push(tmpFinalAssignmentInstruction);return tmpResults.PostfixSolveList;}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserPostfix;},{"./Fable-Service-ExpressionParser-Base.js":77}],83:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var libSetConcatArray=require('../Fable-SetConcatArray.js');var ExpressionParserSolver=/*#__PURE__*/function(_libExpressionParserO5){function ExpressionParserSolver(pFable,pOptions,pServiceHash){var
|
|
1525
|
+
var tmpSolveResultToken=this.getTokenContainerObject('Result','Token.LastResult');var tmpFinalAssignmentInstruction=this.getPosfixSolveListOperation(tmpAbstractAssignToken,tmpSolveResultToken,this.getTokenContainerObject('SolverMarshal','Token.SolverMarshal'));tmpResults.PostfixSolveList.push(tmpFinalAssignmentInstruction);return tmpResults.PostfixSolveList;}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserPostfix;},{"./Fable-Service-ExpressionParser-Base.js":77}],83:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var libSetConcatArray=require('../Fable-SetConcatArray.js');var ExpressionParserSolver=/*#__PURE__*/function(_libExpressionParserO5){function ExpressionParserSolver(pFable,pOptions,pServiceHash){var _this26;_classCallCheck2(this,ExpressionParserSolver);_this26=_callSuper(this,ExpressionParserSolver,[pFable,pOptions,pServiceHash]);_this26.serviceType='ExpressionParser-Solver';return _this26;}_inherits(ExpressionParserSolver,_libExpressionParserO5);return _createClass2(ExpressionParserSolver,[{key:"solvePostfixedExpression",value:function solvePostfixedExpression(pPostfixedExpression,pDataDestinationObject,pResultObject,pManifest){var tmpResults=_typeof(pResultObject)==='object'?pResultObject:{ExpressionParserLog:[]};var tmpManifest=_typeof(pManifest)==='object'?pManifest:this.fable.newManyfest();var tmpDataDestinationObject=_typeof(pDataDestinationObject)==='object'?pDataDestinationObject:{};// If there was a fable passed in (e.g. the results object was a service or such), we won't decorate
|
|
1525
1526
|
var tmpPassedInFable='fable'in tmpResults;if(!tmpPassedInFable){tmpResults.fable=this.fable;}if(!Array.isArray(pPostfixedExpression)){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.solvePostfixedExpression was passed a non-array postfixed expression.");this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return false;}if(pPostfixedExpression.length<1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.solvePostfixedExpression was passed an empty postfixed expression.");this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return false;}// This is how the user communication magic happens.
|
|
1526
1527
|
tmpResults.VirtualSymbols={};for(var i=0;i<pPostfixedExpression.length;i++){// X = SUM(15, SUM(SIN(25), 10), (5 + 2), 3)
|
|
1527
1528
|
if(pPostfixedExpression[i].Operation.Type==='Token.SolverInstruction'){continue;}var tmpStepResultObject={ExpressionStep:pPostfixedExpression[i],ExpressionStepIndex:i,ResultsObject:tmpResults,Manifest:tmpManifest};if(tmpStepResultObject.ExpressionStep.LeftValue.Type==='Token.LastResult'){tmpStepResultObject.ExpressionStep.LeftValue.Value=tmpResults.LastResult;}if(tmpStepResultObject.ExpressionStep.RightValue.Type==='Token.LastResult'){tmpStepResultObject.ExpressionStep.RightValue.Value=tmpResults.LastResult;}if(tmpStepResultObject.ExpressionStep.LeftValue.Type==='Token.VirtualSymbol'){tmpStepResultObject.ExpressionStep.LeftValue.Value=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.LeftValue.Token);}if(tmpStepResultObject.ExpressionStep.RightValue.Type==='Token.VirtualSymbol'){tmpStepResultObject.ExpressionStep.RightValue.Value=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.RightValue.Token);}// Resolve the parenthesis to their actual values
|
|
@@ -1534,12 +1535,12 @@ var tmpIsFunction=false;if(tmpStepResultObject.ExpressionStep.Operation.Token in
|
|
|
1534
1535
|
tmpManifest.setValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.VirtualSymbolName,tmpManifest.getValueAtAddress(tmpStepResultObject,"".concat(tmpFunctionAddress,"(ExpressionStep.LeftValue.Value,ExpressionStep.RightValue.Value)")));tmpResults.LastResult=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.VirtualSymbolName);//this.log.trace(` ---> Step ${i}: ${tmpResults.VirtualSymbols[tmpStepResultObject.ExpressionStep.VirtualSymbolName]}`)
|
|
1535
1536
|
}catch(pError){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.solvePostfixedExpression failed to solve step ".concat(i," with function ").concat(tmpStepResultObject.ExpressionStep.Operation.Token,": ").concat(pError));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return false;}}// Equations don't always solve in virtual symbol order.
|
|
1536
1537
|
tmpResults.SolverFinalVirtualSymbol=tmpStepResultObject.ExpressionStep.VirtualSymbolName;}}var tmpSolverResultValue=tmpManifest.getValueAtAddress(tmpResults,"VirtualSymbols.".concat(tmpResults.SolverFinalVirtualSymbol));// Now deal with final assignment(s)
|
|
1537
|
-
for(var
|
|
1538
|
-
tmpManifest.setValueAtAddress(tmpResults.VirtualSymbols,pPostfixedExpression[
|
|
1539
|
-
if(pPostfixedExpression[
|
|
1540
|
-
if(this.fable.Utility.addressIsNullOrEmpty(tmpDataDestinationObject,pPostfixedExpression[
|
|
1541
|
-
tmpManifest.setValueByHash(tmpDataDestinationObject,pPostfixedExpression[
|
|
1542
|
-
if(!tmpPassedInFable){delete tmpResults.fable;}if(_typeof(tmpSolverResultValue)==='object'){return tmpSolverResultValue;}else if(typeof tmpSolverResultValue!=='undefined'){return tmpSolverResultValue.toString();}else{return tmpSolverResultValue;}}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserSolver;},{"../Fable-SetConcatArray.js":100,"./Fable-Service-ExpressionParser-Base.js":77}],84:[function(require,module,exports){module.exports={"=":{"Name":"Assign Value","Token":"=","Function":"fable.Math.assignValue","Precedence":0,"Type":"Assignment"},"?=":{"Name":"Null or Empty Coalescing Assign Value","Token":"?=","Function":"fable.Math.assignValue","OnlyEmpty":true,"Precedence":0,"Type":"Assignment"},"(":{"Name":"Left Parenthesis","Token":"(","Precedence":0,"Type":"Parenthesis"},")":{"Name":"Right Parenthesis","Token":")","Precedence":0,"Type":"Parenthesis"},",":{"Name":"Set Concatenate","Token":",","Function":"fable.Math.setConcatenate","Precedence":4,"Type":"Operator"},"*":{"Name":"Multiply","Token":"*","Function":"fable.Math.multiplyPrecise","Precedence":3,"Type":"Operator"},"/":{"Name":"Divide","Token":"/","Function":"fable.Math.dividePrecise","Precedence":3,"Type":"Operator"},"^":{"Name":"Exponent","Token":"^","Function":"fable.Math.powerPrecise","Precedence":2,"Type":"Operator"},"%":{"Name":"Modulus","Token":"%","Function":"fable.Math.modPrecise","Precedence":3,"Type":"Operator"},"+":{"Name":"Add","Token":"+","Function":"fable.Math.addPrecise","Precedence":4,"Type":"Operator"},"-":{"Name":"Subtract","Token":"-","Function":"fable.Math.subtractPrecise","Precedence":4,"Type":"Operator"}};},{}],85:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserValueMarshal=/*#__PURE__*/function(_libExpressionParserO6){function ExpressionParserValueMarshal(pFable,pOptions,pServiceHash){var
|
|
1538
|
+
for(var _i17=0;_i17<pPostfixedExpression.length;_i17++){if(pPostfixedExpression[_i17].RightValue.Type==='Token.SolverMarshal'){// Set the result in the virtual symbols
|
|
1539
|
+
tmpManifest.setValueAtAddress(tmpResults.VirtualSymbols,pPostfixedExpression[_i17].VirtualSymbolName,tmpSolverResultValue);// Set the value in the destination object
|
|
1540
|
+
if(pPostfixedExpression[_i17].Operation.Descriptor.OnlyEmpty){// If it is only on "empty" values, check if the value is empty before assigning
|
|
1541
|
+
if(this.fable.Utility.addressIsNullOrEmpty(tmpDataDestinationObject,pPostfixedExpression[_i17].VirtualSymbolName)){tmpManifest.setValueByHash(tmpDataDestinationObject,pPostfixedExpression[_i17].VirtualSymbolName,tmpSolverResultValue);}}else{// Otherwise, just assign it.
|
|
1542
|
+
tmpManifest.setValueByHash(tmpDataDestinationObject,pPostfixedExpression[_i17].VirtualSymbolName,tmpSolverResultValue);}}}tmpResults.RawResult=tmpSolverResultValue;// Clean up the fable reference if we added it to the object.
|
|
1543
|
+
if(!tmpPassedInFable){delete tmpResults.fable;}if(_typeof(tmpSolverResultValue)==='object'){return tmpSolverResultValue;}else if(typeof tmpSolverResultValue!=='undefined'){return tmpSolverResultValue.toString();}else{return tmpSolverResultValue;}}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserSolver;},{"../Fable-SetConcatArray.js":100,"./Fable-Service-ExpressionParser-Base.js":77}],84:[function(require,module,exports){module.exports={"=":{"Name":"Assign Value","Token":"=","Function":"fable.Math.assignValue","Precedence":0,"Type":"Assignment"},"?=":{"Name":"Null or Empty Coalescing Assign Value","Token":"?=","Function":"fable.Math.assignValue","OnlyEmpty":true,"Precedence":0,"Type":"Assignment"},"(":{"Name":"Left Parenthesis","Token":"(","Precedence":0,"Type":"Parenthesis"},")":{"Name":"Right Parenthesis","Token":")","Precedence":0,"Type":"Parenthesis"},",":{"Name":"Set Concatenate","Token":",","Function":"fable.Math.setConcatenate","Precedence":4,"Type":"Operator"},"*":{"Name":"Multiply","Token":"*","Function":"fable.Math.multiplyPrecise","Precedence":3,"Type":"Operator"},"/":{"Name":"Divide","Token":"/","Function":"fable.Math.dividePrecise","Precedence":3,"Type":"Operator"},"^":{"Name":"Exponent","Token":"^","Function":"fable.Math.powerPrecise","Precedence":2,"Type":"Operator"},"%":{"Name":"Modulus","Token":"%","Function":"fable.Math.modPrecise","Precedence":3,"Type":"Operator"},"+":{"Name":"Add","Token":"+","Function":"fable.Math.addPrecise","Precedence":4,"Type":"Operator"},"-":{"Name":"Subtract","Token":"-","Function":"fable.Math.subtractPrecise","Precedence":4,"Type":"Operator"}};},{}],85:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionParserValueMarshal=/*#__PURE__*/function(_libExpressionParserO6){function ExpressionParserValueMarshal(pFable,pOptions,pServiceHash){var _this27;_classCallCheck2(this,ExpressionParserValueMarshal);_this27=_callSuper(this,ExpressionParserValueMarshal,[pFable,pOptions,pServiceHash]);_this27.serviceType='ExpressionParser-ValueMarshal';return _this27;}/**
|
|
1543
1544
|
* Substitutes values in tokenized objects based on the provided data source and manifest.
|
|
1544
1545
|
*
|
|
1545
1546
|
* TODO: Move this to its own file in the "Fable-Service-ExpressionParser" directory.
|
|
@@ -1560,10 +1561,10 @@ if(Array.isArray(tmpValue)||_typeof(tmpValue)==='object'){tmpToken.Resolved=true
|
|
|
1560
1561
|
var _tmpValue=tmpManifest.getValueAtAddress(tmpDataSource,tmpToken.Token);if(!_tmpValue){tmpResults.ExpressionParserLog.push("WARNING: ExpressionParser.substituteValuesInTokenizedObjects found no value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);continue;}else{//tmpResults.ExpressionParserLog.push(`INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [${tmpValue}] for the state address ${tmpToken.Token} at index ${i}`);
|
|
1561
1562
|
this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);try{var _tmpValueParsed=new this.fable.Utility.bigNumber(_tmpValue);tmpToken.Resolved=true;tmpToken.Value=_tmpValueParsed.toString();}catch(pError){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}if(pTokenizedObjects[i].Type==='Token.String'&&!tmpToken.Resolved){tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [".concat(tmpToken.Token,"] for the string ").concat(tmpToken.Token," at index ").concat(i));if(this.LogNoisiness>1)this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=true;// Take the quotes off the string
|
|
1562
1563
|
tmpToken.Value=tmpToken.Token.substring(1,tmpToken.Token.length-1);}if(pTokenizedObjects[i].Type==='Token.Constant'&&!tmpToken.Resolved){tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a value [".concat(tmpToken.Token,"] for the constant ").concat(tmpToken.Token," at index ").concat(i));if(this.LogNoisiness>1)this.log.info(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);try{var _tmpValueParsed2=new this.fable.Utility.bigNumber(tmpToken.Token);tmpToken.Resolved=true;tmpToken.Value=_tmpValueParsed2.toString();}catch(pError){// This constant has the right symbols but apparently isn't a parsable number.
|
|
1563
|
-
tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}return pTokenizedObjects;}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserValueMarshal;},{"./Fable-Service-ExpressionParser-Base.js":77}],86:[function(require,module,exports){(function(process){(function(){var libFableServiceBase=require('fable-serviceproviderbase');var libFS=require('fs');var libPath=require('path');var libReadline=require('readline');var FableServiceFilePersistence=/*#__PURE__*/function(_libFableServiceBase5){function FableServiceFilePersistence(pFable,pOptions,pServiceHash){var
|
|
1564
|
+
tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);tmpToken.Resolved=false;}}}return pTokenizedObjects;}}]);}(libExpressionParserOperationBase);module.exports=ExpressionParserValueMarshal;},{"./Fable-Service-ExpressionParser-Base.js":77}],86:[function(require,module,exports){(function(process){(function(){var libFableServiceBase=require('fable-serviceproviderbase');var libFS=require('fs');var libPath=require('path');var libReadline=require('readline');var FableServiceFilePersistence=/*#__PURE__*/function(_libFableServiceBase5){function FableServiceFilePersistence(pFable,pOptions,pServiceHash){var _this28;_classCallCheck2(this,FableServiceFilePersistence);_this28=_callSuper(this,FableServiceFilePersistence,[pFable,pOptions,pServiceHash]);_this28.serviceType='FilePersistence';if(!('Mode'in _this28.options)){_this28.options.Mode=parseInt('0777',8)&~process.umask();}_this28.libFS=libFS;_this28.libPath=libPath;_this28.libReadline=libReadline;return _this28;}_inherits(FableServiceFilePersistence,_libFableServiceBase5);return _createClass2(FableServiceFilePersistence,[{key:"joinPath",value:function joinPath(){// TODO: Fix anything that's using this before changing this to the new true node join
|
|
1564
1565
|
// return libPath.join(...pPathArray);
|
|
1565
|
-
return libPath.resolve.apply(libPath,arguments);}},{key:"resolvePath",value:function resolvePath(){return libPath.resolve.apply(libPath,arguments);}},{key:"existsSync",value:function existsSync(pPath){return libFS.existsSync(pPath);}},{key:"exists",value:function exists(pPath,fCallback){var tmpFileExists=this.existsSync(pPath);return fCallback(null,tmpFileExists);}},{key:"deleteFileSync",value:function deleteFileSync(pFileName){return libFS.unlinkSync(pFileName);}},{key:"deleteFolderSync",value:function deleteFolderSync(pFileName){return libFS.rmdirSync(pFileName);}},{key:"readFileSync",value:function readFileSync(pFilePath,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.readFileSync(pFilePath,tmpOptions);}},{key:"readFile",value:function readFile(pFilePath,pOptions,fCallback){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.readFile(pFilePath,tmpOptions,fCallback);}},{key:"readFileCSV",value:function readFileCSV(pFilePath,pOptions,fRecordFunction,fCompleteFunction,fErrorFunction){var
|
|
1566
|
-
},{key:"makeFolderRecursive",value:function makeFolderRecursive(pParameters,fCallback){var
|
|
1566
|
+
return libPath.resolve.apply(libPath,arguments);}},{key:"resolvePath",value:function resolvePath(){return libPath.resolve.apply(libPath,arguments);}},{key:"existsSync",value:function existsSync(pPath){return libFS.existsSync(pPath);}},{key:"exists",value:function exists(pPath,fCallback){var tmpFileExists=this.existsSync(pPath);return fCallback(null,tmpFileExists);}},{key:"deleteFileSync",value:function deleteFileSync(pFileName){return libFS.unlinkSync(pFileName);}},{key:"deleteFolderSync",value:function deleteFolderSync(pFileName){return libFS.rmdirSync(pFileName);}},{key:"readFileSync",value:function readFileSync(pFilePath,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.readFileSync(pFilePath,tmpOptions);}},{key:"readFile",value:function readFile(pFilePath,pOptions,fCallback){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.readFile(pFilePath,tmpOptions,fCallback);}},{key:"readFileCSV",value:function readFileCSV(pFilePath,pOptions,fRecordFunction,fCompleteFunction,fErrorFunction){var _this29=this;var tmpCSVParser=this.fable.instantiateServiceProviderWithoutRegistration('CSVParser',pOptions);var tmpRecordFunction=typeof fRecordFunction==='function'?fRecordFunction:function(pRecord){_this29.fable.log.trace("CSV Reader received line ".concat(pRecord));};var tmpCompleteFunction=typeof fCompleteFunction==='function'?fCompleteFunction:function(){_this29.fable.log.info("CSV Read of ".concat(pFilePath," complete."));};var tmpErrorFunction=typeof fErrorFunction==='function'?fErrorFunction:function(pError){_this29.fable.log.error("CSV Read of ".concat(pFilePath," Error: ").concat(pError),pError);};return this.lineReaderFactory(pFilePath,function(pLine){var tmpRecord=tmpCSVParser.parseCSVLine(pLine);if(tmpRecord){tmpRecordFunction(tmpRecord,pLine);}},tmpCompleteFunction,tmpErrorFunction);}},{key:"appendFileSync",value:function appendFileSync(pFileName,pAppendContent,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.appendFileSync(pFileName,pAppendContent,tmpOptions);}},{key:"writeFileSync",value:function writeFileSync(pFileName,pFileContent,pOptions){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.writeFileSync(pFileName,pFileContent,tmpOptions);}},{key:"writeFileSyncFromObject",value:function writeFileSyncFromObject(pFileName,pObject){return this.writeFileSync(pFileName,JSON.stringify(pObject,null,4));}},{key:"writeFileSyncFromArray",value:function writeFileSyncFromArray(pFileName,pFileArray){if(!Array.isArray(pFileArray)){this.log.error("File Persistence Service attempted to write ".concat(pFileName," from array but the expected array was not an array (it was a ").concat(_typeof(pFileArray),")."));return Error('Attempted to write ${pFileName} from array but the expected array was not an array (it was a ${typeof(pFileArray)}).');}else{for(var i=0;i<pFileArray.length;i++){return this.appendFileSync(pFileName,"".concat(pFileArray[i],"\n"));}}}},{key:"writeFile",value:function writeFile(pFileName,pFileContent,pOptions,fCallback){var tmpOptions=typeof pOptions==='undefined'?'utf8':pOptions;return libFS.writeFile(pFileName,pFileContent,tmpOptions,fCallback);}},{key:"lineReaderFactory",value:function lineReaderFactory(pFilePath,fOnLine,fOnComplete,fOnError){var tmpLineReader={};if(typeof pFilePath!='string'){return false;}tmpLineReader.filePath=pFilePath;tmpLineReader.fileStream=libFS.createReadStream(tmpLineReader.filePath);tmpLineReader.reader=libReadline.createInterface({input:tmpLineReader.fileStream,crlfDelay:Infinity});if(typeof fOnError==='function'){tmpLineReader.reader.on('error',fOnError);}tmpLineReader.reader.on('line',typeof fOnLine==='function'?fOnLine:function(){});if(typeof fOnComplete==='function'){tmpLineReader.reader.on('close',fOnComplete);}return tmpLineReader;}// Folder management
|
|
1567
|
+
},{key:"makeFolderRecursive",value:function makeFolderRecursive(pParameters,fCallback){var _this30=this;var tmpParameters=pParameters;if(typeof pParameters=='string'){tmpParameters={Path:pParameters};}else if(_typeof(pParameters)!=='object'){fCallback(new Error('Parameters object or string not properly passed to recursive folder create.'));return false;}if(typeof tmpParameters.Path!=='string'){fCallback(new Error('Parameters object needs a path to run the folder create operation.'));return false;}if(!('Mode'in tmpParameters)){tmpParameters.Mode=this.options.Mode;}// Check if we are just starting .. if so, build the initial state for our recursive function
|
|
1567
1568
|
if(typeof tmpParameters.CurrentPathIndex==='undefined'){// Build the tools to start recursing
|
|
1568
1569
|
tmpParameters.ActualPath=libPath.normalize(tmpParameters.Path);tmpParameters.ActualPathParts=tmpParameters.ActualPath.split(libPath.sep);tmpParameters.CurrentPathIndex=0;tmpParameters.CurrentPath='';}else{// This is not our first run, so we will continue the recursion.
|
|
1569
1570
|
// Build the new base path
|
|
@@ -1571,8 +1572,8 @@ if(tmpParameters.CurrentPath==libPath.sep){tmpParameters.CurrentPath=tmpParamete
|
|
|
1571
1572
|
tmpParameters.CurrentPathIndex++;}// Check if the path is fully complete
|
|
1572
1573
|
if(tmpParameters.CurrentPathIndex>=tmpParameters.ActualPathParts.length){return fCallback(null);}// Check if the path exists (and is a folder)
|
|
1573
1574
|
libFS.open(tmpParameters.CurrentPath+libPath.sep+tmpParameters.ActualPathParts[tmpParameters.CurrentPathIndex],'r',function(pError,pFileDescriptor){if(pFileDescriptor){libFS.closeSync(pFileDescriptor);}if(pError&&pError.code=='ENOENT'){/* Path doesn't exist, create it */libFS.mkdir(tmpParameters.CurrentPath+libPath.sep+tmpParameters.ActualPathParts[tmpParameters.CurrentPathIndex],tmpParameters.Mode,function(pCreateError){if(!pCreateError){// We have now created our folder and there was no error -- continue.
|
|
1574
|
-
return
|
|
1575
|
-
return
|
|
1575
|
+
return _this30.makeFolderRecursive(tmpParameters,fCallback);}else if(pCreateError.code=='EEXIST'){// The folder exists -- our dev might be running this in parallel/async/whatnot.
|
|
1576
|
+
return _this30.makeFolderRecursive(tmpParameters,fCallback);}else{console.log(pCreateError.code);return fCallback(pCreateError);}});}else{return _this30.makeFolderRecursive(tmpParameters,fCallback);}});}}]);}(libFableServiceBase);module.exports=FableServiceFilePersistence;}).call(this);}).call(this,require('_process'));},{"_process":149,"fable-serviceproviderbase":59,"fs":19,"path":137,"readline":19}],87:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceLogic=/*#__PURE__*/function(_libFableServiceBase6){/**
|
|
1576
1577
|
* @param {import('../Fable.js')} pFable - The fable object
|
|
1577
1578
|
* @param {Record<string, any>} [pOptions] - The options object
|
|
1578
1579
|
* @param {string} [pServiceHash] - The hash of the service
|
|
@@ -1594,7 +1595,7 @@ var tmpMathLeft=this.fable.Math.parsePrecise(pLeft,null);var tmpMathRight=this.f
|
|
|
1594
1595
|
* @param {any} pOnTrue - The value to return if the object is truthy
|
|
1595
1596
|
* @param {any} [pOnFalse = ''] - The value to return if the object is falsy
|
|
1596
1597
|
* @return {any} - The value from the object
|
|
1597
|
-
*/},{key:"when",value:function when(pCheckForTruthy,pOnTrue){var pOnFalse=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';if(!pCheckForTruthy){return pOnFalse;}if(Array.isArray(pCheckForTruthy)&&pCheckForTruthy.length<1){return pOnFalse;}if(_typeof(pCheckForTruthy)==='object'&&Object.keys(pCheckForTruthy).length<1){return pOnFalse;}return pOnTrue;}}]);}(libFableServiceBase);module.exports=FableServiceLogic;},{"fable-serviceproviderbase":
|
|
1598
|
+
*/},{key:"when",value:function when(pCheckForTruthy,pOnTrue){var pOnFalse=arguments.length>2&&arguments[2]!==undefined?arguments[2]:'';if(!pCheckForTruthy){return pOnFalse;}if(Array.isArray(pCheckForTruthy)&&pCheckForTruthy.length<1){return pOnFalse;}if(_typeof(pCheckForTruthy)==='object'&&Object.keys(pCheckForTruthy).length<1){return pOnFalse;}return pOnTrue;}}]);}(libFableServiceBase);module.exports=FableServiceLogic;},{"fable-serviceproviderbase":59}],88:[function(require,module,exports){/**
|
|
1598
1599
|
* @file Fable-Service-Math.js
|
|
1599
1600
|
* @description This file contains the implementation of the FableServiceMath class, which provides simple functions for performing arbitrary precision math operations.
|
|
1600
1601
|
* @module FableServiceMath
|
|
@@ -1605,9 +1606,9 @@ var tmpMathLeft=this.fable.Math.parsePrecise(pLeft,null);var tmpMathRight=this.f
|
|
|
1605
1606
|
* @description Simple functions that perform arbitrary precision math operations and return string resultant values. Wraps big.js
|
|
1606
1607
|
* @class FableServiceMath
|
|
1607
1608
|
* @extends libFableServiceBase
|
|
1608
|
-
*/var FableServiceMath=/*#__PURE__*/function(_libFableServiceBase7){function FableServiceMath(pFable,pOptions,pServiceHash){var
|
|
1609
|
-
|
|
1610
|
-
return
|
|
1609
|
+
*/var FableServiceMath=/*#__PURE__*/function(_libFableServiceBase7){function FableServiceMath(pFable,pOptions,pServiceHash){var _this31;_classCallCheck2(this,FableServiceMath);_this31=_callSuper(this,FableServiceMath,[pFable,pOptions,pServiceHash]);_this31.serviceType='Math';_this31.pi='3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679';// From NASA: https://apod.nasa.gov/htmltest/gifcity/e.2mil
|
|
1610
|
+
_this31.euler='2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664';// this.manifest = this.fable.newManyfest();
|
|
1611
|
+
return _this31;}/*
|
|
1611
1612
|
Pass-through Rounding Method Constants
|
|
1612
1613
|
|
|
1613
1614
|
Property Value BigDecimal Equiv Description
|
|
@@ -1800,13 +1801,13 @@ return 1;}return 0;}/**
|
|
|
1800
1801
|
*
|
|
1801
1802
|
* @param {Array|Object} pValueSet - The value set to be sorted.
|
|
1802
1803
|
* @returns {Array} - The sorted value set.
|
|
1803
|
-
*/},{key:"sortSetPrecise",value:function sortSetPrecise(pValueSet){var
|
|
1804
|
+
*/},{key:"sortSetPrecise",value:function sortSetPrecise(pValueSet){var _this32=this;var tmpSortedSet=[];if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){tmpSortedSet.push(this.parsePrecise(pValueSet[i],NaN));}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i18=0;_i18<tmpKeys.length;_i18++){tmpSortedSet.push(this.parsePrecise(pValueSet[tmpKeys[_i18]],NaN));}}tmpSortedSet.sort(function(pLeft,pRight){return _this32.comparePrecise(pLeft,pRight);});return tmpSortedSet;}/**
|
|
1804
1805
|
* Bucketizes a set of values based on a specified bucket size.
|
|
1805
1806
|
*
|
|
1806
1807
|
* @param {Array|Object} pValueSet - The set of values to be bucketized.
|
|
1807
1808
|
* @param {number} pBucketSize - The size of each bucket. Optional - If NaN, the values will be bucketized by their value.
|
|
1808
1809
|
* @returns {Object} - The bucketized set of values.
|
|
1809
|
-
*/},{key:"bucketSetPrecise",value:function bucketSetPrecise(pValueSet,pBucketSize){var tmpBucketedSet={};var tmpBucketSize=this.parsePrecise(pBucketSize,NaN);if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){var tmpValue=this.parsePrecise(pValueSet[i],NaN);var tmpBucket=tmpValue.toString();if(!isNaN(tmpBucketSize)){tmpBucket=this.dividePrecise(pValueSet[i],tmpBucketSize);}if(!(tmpBucket in tmpBucketedSet)){tmpBucketedSet[tmpBucket]=0;}tmpBucketedSet[tmpBucket]=tmpBucketedSet[tmpBucket]+1;}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var
|
|
1810
|
+
*/},{key:"bucketSetPrecise",value:function bucketSetPrecise(pValueSet,pBucketSize){var tmpBucketedSet={};var tmpBucketSize=this.parsePrecise(pBucketSize,NaN);if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){var tmpValue=this.parsePrecise(pValueSet[i],NaN);var tmpBucket=tmpValue.toString();if(!isNaN(tmpBucketSize)){tmpBucket=this.dividePrecise(pValueSet[i],tmpBucketSize);}if(!(tmpBucket in tmpBucketedSet)){tmpBucketedSet[tmpBucket]=0;}tmpBucketedSet[tmpBucket]=tmpBucketedSet[tmpBucket]+1;}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i19=0;_i19<tmpKeys.length;_i19++){var _tmpValue2=this.parsePrecise(pValueSet[tmpKeys[_i19]],NaN);var _tmpBucket=_tmpValue2.toString();if(!isNaN(tmpBucketSize)){_tmpBucket=this.dividePrecise(pValueSet[_i19],tmpBucketSize);}if(!(_tmpBucket in tmpBucketedSet)){tmpBucketedSet[_tmpBucket]=0;}tmpBucketedSet[_tmpBucket]=tmpBucketedSet[_tmpBucket]+1;}}return tmpBucketedSet;}/**
|
|
1810
1811
|
* Calculates the histogram using precise bucket set for the given pValueSet.
|
|
1811
1812
|
*
|
|
1812
1813
|
* @param {Array<number>} pValueSet - The array of p-values.
|
|
@@ -1838,7 +1839,7 @@ var tmpCleanedObject={};var tmpKeys=Object.keys(pValueObject);for(var i=0;i<tmpK
|
|
|
1838
1839
|
* @param {Array} pValueObjectSet
|
|
1839
1840
|
* @param {string} pValueAddress
|
|
1840
1841
|
* @param {Object} pManifest
|
|
1841
|
-
*/},{key:"entryInSet",value:function entryInSet(pValueObjectSet,pValueAddress,pEntryIndex){var
|
|
1842
|
+
*/},{key:"entryInSet",value:function entryInSet(pValueObjectSet,pValueAddress,pEntryIndex){var _this33=this;var tmpEntryIndex=typeof pEntryIndex==='number'?pEntryIndex:parseInt(pEntryIndex);if(!Array.isArray(pValueObjectSet)){return pValueObjectSet;}if(!pValueAddress){return false;}if(isNaN(tmpEntryIndex)||tmpEntryIndex>=pValueObjectSet.length){return false;}var tmpValueArray=pValueObjectSet.toSorted(function(pLeft,pRight){return _this33.comparePrecise(pLeft[pValueAddress],pRight[pValueAddress]);});var tmpIndex=tmpEntryIndex<0?tmpValueArray.length+tmpEntryIndex:tmpEntryIndex;return tmpValueArray[tmpIndex];}/**
|
|
1842
1843
|
* Finds the smallest value in a set of objects based on a specified value address.
|
|
1843
1844
|
*
|
|
1844
1845
|
* @param {Object[]} pValueObjectSet - An array of objects to search through.
|
|
@@ -1859,17 +1860,17 @@ var tmpCleanedObject={};var tmpKeys=Object.keys(pValueObject);for(var i=0;i<tmpK
|
|
|
1859
1860
|
*
|
|
1860
1861
|
* @param {Array|Object} pValueSet - The set of values to find the maximum from.
|
|
1861
1862
|
* @returns {number} - The maximum value from the set.
|
|
1862
|
-
*/},{key:"maxPrecise",value:function maxPrecise(pValueSet){var tmpMaxValue=NaN;if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){if(!tmpMaxValue){tmpMaxValue=this.parsePrecise(pValueSet[i],NaN);}else{var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(this.gtPrecise(tmpComparisonValue,tmpMaxValue)){tmpMaxValue=tmpComparisonValue;}}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var
|
|
1863
|
+
*/},{key:"maxPrecise",value:function maxPrecise(pValueSet){var tmpMaxValue=NaN;if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){if(!tmpMaxValue){tmpMaxValue=this.parsePrecise(pValueSet[i],NaN);}else{var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(this.gtPrecise(tmpComparisonValue,tmpMaxValue)){tmpMaxValue=tmpComparisonValue;}}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i20=0;_i20<tmpKeys.length;_i20++){if(!tmpMaxValue){tmpMaxValue=this.parsePrecise(pValueSet[tmpKeys[_i20]],NaN);}else{var _tmpComparisonValue=this.parsePrecise(pValueSet[tmpKeys[_i20]],NaN);if(this.gtPrecise(_tmpComparisonValue,tmpMaxValue)){tmpMaxValue=_tmpComparisonValue;}}}}return tmpMaxValue;}/**
|
|
1863
1864
|
* Finds the minimum value from a set of values.
|
|
1864
1865
|
*
|
|
1865
1866
|
* @param {Array|Object} pValueSet - The set of values to find the minimum from.
|
|
1866
1867
|
* @returns {number} The minimum value from the set.
|
|
1867
|
-
*/},{key:"minPrecise",value:function minPrecise(pValueSet){var tmpMinValue=NaN;if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){if(!tmpMinValue){tmpMinValue=this.parsePrecise(pValueSet[i],NaN);}else{var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(!isNaN(tmpComparisonValue)&&this.ltPrecise(tmpComparisonValue,tmpMinValue)){tmpMinValue=tmpComparisonValue;}}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var
|
|
1868
|
+
*/},{key:"minPrecise",value:function minPrecise(pValueSet){var tmpMinValue=NaN;if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){if(!tmpMinValue){tmpMinValue=this.parsePrecise(pValueSet[i],NaN);}else{var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(!isNaN(tmpComparisonValue)&&this.ltPrecise(tmpComparisonValue,tmpMinValue)){tmpMinValue=tmpComparisonValue;}}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i21=0;_i21<tmpKeys.length;_i21++){if(!tmpMinValue){tmpMinValue=this.parsePrecise(pValueSet[tmpKeys[_i21]],NaN);}else{var _tmpComparisonValue2=this.parsePrecise(pValueSet[tmpKeys[_i21]],NaN);if(!isNaN(_tmpComparisonValue2)&&this.ltPrecise(_tmpComparisonValue2,tmpMinValue)){tmpMinValue=_tmpComparisonValue2;}}}}return tmpMinValue;}/**
|
|
1868
1869
|
* Calculates the precise sum of values in the given value set.
|
|
1869
1870
|
*
|
|
1870
1871
|
* @param {Array|Object} pValueSet - The value set to calculate the sum from.
|
|
1871
1872
|
* @returns {string} The precise sum value as a string.
|
|
1872
|
-
*/},{key:"sumPrecise",value:function sumPrecise(pValueSet){var tmpSumValue="0.0";if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(!isNaN(tmpComparisonValue)){tmpSumValue=this.addPrecise(tmpSumValue,tmpComparisonValue);}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var
|
|
1873
|
+
*/},{key:"sumPrecise",value:function sumPrecise(pValueSet){var tmpSumValue="0.0";if(Array.isArray(pValueSet)){for(var i=0;i<pValueSet.length;i++){var tmpComparisonValue=this.parsePrecise(pValueSet[i],NaN);if(!isNaN(tmpComparisonValue)){tmpSumValue=this.addPrecise(tmpSumValue,tmpComparisonValue);}}}else if(_typeof(pValueSet)==='object'){var tmpKeys=Object.keys(pValueSet);for(var _i22=0;_i22<tmpKeys.length;_i22++){var _tmpComparisonValue3=this.parsePrecise(pValueSet[tmpKeys[_i22]],NaN);if(!isNaN(_tmpComparisonValue3)){tmpSumValue=this.addPrecise(tmpSumValue,_tmpComparisonValue3);}}}return tmpSumValue;}/**
|
|
1873
1874
|
* Calculates the precise mean of a given value set.
|
|
1874
1875
|
*
|
|
1875
1876
|
* @param {Array<number>} pValueSet - The array of values to calculate the mean.
|
|
@@ -1893,11 +1894,11 @@ else{var tmpLeftMiddleValue=tmpSortedValueSet[tmpMiddleElement-1];var tmpRightMi
|
|
|
1893
1894
|
* @param {Array} pValueSet - The array of values to calculate the mode from.
|
|
1894
1895
|
* @returns {Array} - An array containing the mode value(s) from the given value set.
|
|
1895
1896
|
*/},{key:"modePrecise",value:function modePrecise(pValueSet){var tmpHistogram=this.bucketSetPrecise(pValueSet);var tmpMaxCount=0;// Philosophical question about whether the values should be returned sorted.
|
|
1896
|
-
var tmpHistogramValueSet=Object.keys(tmpHistogram);var tmpModeValueSet=[];for(var i=0;i<tmpHistogramValueSet.length;i++){if(tmpHistogram[tmpHistogramValueSet[i]]>tmpMaxCount){tmpMaxCount=tmpHistogram[tmpHistogramValueSet[i]];tmpModeValueSet=[tmpHistogramValueSet[i]];}else if(tmpHistogram[tmpHistogramValueSet[i]]==tmpMaxCount){tmpModeValueSet.push(tmpHistogramValueSet[i]);}}return tmpModeValueSet;}}]);}(libFableServiceBase);module.exports=FableServiceMath;},{"./Fable-SetConcatArray.js":100,"fable-serviceproviderbase":
|
|
1897
|
+
var tmpHistogramValueSet=Object.keys(tmpHistogram);var tmpModeValueSet=[];for(var i=0;i<tmpHistogramValueSet.length;i++){if(tmpHistogram[tmpHistogramValueSet[i]]>tmpMaxCount){tmpMaxCount=tmpHistogram[tmpHistogramValueSet[i]];tmpModeValueSet=[tmpHistogramValueSet[i]];}else if(tmpHistogram[tmpHistogramValueSet[i]]==tmpMaxCount){tmpModeValueSet.push(tmpHistogramValueSet[i]);}}return tmpModeValueSet;}}]);}(libFableServiceBase);module.exports=FableServiceMath;},{"./Fable-SetConcatArray.js":100,"fable-serviceproviderbase":59}],89:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
|
|
1897
1898
|
* Precedent Meta-Templating
|
|
1898
1899
|
* @author Steven Velozo <steven@velozo.com>
|
|
1899
1900
|
* @description Process text stream trie and postfix tree, parsing out meta-template expression functions.
|
|
1900
|
-
*/var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase8){function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var
|
|
1901
|
+
*/var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase8){function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this34;_classCallCheck2(this,FableServiceMetaTemplate);_this34=_callSuper(this,FableServiceMetaTemplate,[pFable,pOptions,pServiceHash]);_this34.serviceType='MetaTemplate';_this34.WordTree=new libWordTree();_this34.StringParser=new libStringParser(_this34.fable);_this34.ParseTree=_this34.WordTree.ParseTree;return _this34;}_inherits(FableServiceMetaTemplate,_libFableServiceBase8);return _createClass2(FableServiceMetaTemplate,[{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,pParser,pParserContext){return this.WordTree.addPattern(pPatternStart,pPatternEnd,pParser,pParserContext);}},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext){return this.WordTree.addPatternBoth(pPatternStart,pPatternEnd,pParser,pParserPromise,pParserContext);}/**
|
|
1901
1902
|
* Parse a string with the existing parse tree
|
|
1902
1903
|
* @method parseString
|
|
1903
1904
|
* @param {string} pString - The string to parse
|
|
@@ -1905,7 +1906,7 @@ var tmpHistogramValueSet=Object.keys(tmpHistogram);var tmpModeValueSet=[];for(va
|
|
|
1905
1906
|
* @param {function} fCallback - The callback function to call when a pattern is matched
|
|
1906
1907
|
* @param {array} pDataContext - The history of data objects already passed in
|
|
1907
1908
|
* @return {string} The result from the parser
|
|
1908
|
-
*/},{key:"parseString",value:function parseString(pString,pData,fCallback,pDataContext){if(this.LogNoisiness>4){this.fable.log.trace("Metatemplate parsing template string [".concat(pString,"] where the callback is a ").concat(_typeof(fCallback)),{TemplateData:pData});}return this.StringParser.parseString(pString,this.ParseTree,pData,fCallback,pDataContext);}}]);}(libFableServiceBase);module.exports=FableServiceMetaTemplate;},{"./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js":90,"./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js":91,"fable-serviceproviderbase":
|
|
1909
|
+
*/},{key:"parseString",value:function parseString(pString,pData,fCallback,pDataContext){if(this.LogNoisiness>4){this.fable.log.trace("Metatemplate parsing template string [".concat(pString,"] where the callback is a ").concat(_typeof(fCallback)),{TemplateData:pData});}return this.StringParser.parseString(pString,this.ParseTree,pData,fCallback,pDataContext);}}]);}(libFableServiceBase);module.exports=FableServiceMetaTemplate;},{"./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js":90,"./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js":91,"fable-serviceproviderbase":59}],90:[function(require,module,exports){/**
|
|
1909
1910
|
* String Parser
|
|
1910
1911
|
* @author Steven Velozo <steven@velozo.com>
|
|
1911
1912
|
* @description Parse a string, properly processing each matched token in the word tree.
|
|
@@ -1952,10 +1953,10 @@ var _tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Patt
|
|
|
1952
1953
|
this.resetOutputBuffer(pParserState);}}// If we aren't in a pattern match or pattern, and this isn't the start of a new pattern (RAW mode)....
|
|
1953
1954
|
if(!pParserState.PatternMatch){// This may be the start of a new pattern....
|
|
1954
1955
|
if(pCharacter in pParserState.ParseTree){// ... assign the root node as the matched node.
|
|
1955
|
-
this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserState);pParserState.Pattern=pParserState.ParseTree[pCharacter];pParserState.PatternMatch=true;return true;}else{this.appendOutputBuffer(pCharacter,pParserState);}}return false;}},{key:"executePatternAsync",value:function executePatternAsync(pParserState,pData,fCallback,pDataContext){var
|
|
1956
|
+
this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserState);pParserState.Pattern=pParserState.ParseTree[pCharacter];pParserState.PatternMatch=true;return true;}else{this.appendOutputBuffer(pCharacter,pParserState);}}return false;}},{key:"executePatternAsync",value:function executePatternAsync(pParserState,pData,fCallback,pDataContext){var _this35=this;// ... this is the end of a pattern, cut off the end tag and parse it.
|
|
1956
1957
|
// Trim the start and end tags off the output buffer now
|
|
1957
1958
|
if(pParserState.Pattern.isAsync){// Run the function
|
|
1958
|
-
var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){return pParserState.Pattern.ParseAsync.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){
|
|
1959
|
+
var tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){return pParserState.Pattern.ParseAsync.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this35.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this35.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}else{return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){_this35.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this35.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else{// Run the t*mplate function
|
|
1959
1960
|
var _tmpFunctionContext2='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(_tmpFunctionContext2){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(_tmpFunctionContext2,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}else{pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext);}this.resetOutputBuffer(pParserState);return fCallback();}}/**
|
|
1960
1961
|
* Parse a character in the buffer.
|
|
1961
1962
|
* @method parseCharacterAsync
|
|
@@ -1988,11 +1989,11 @@ return fCallback();}/**
|
|
|
1988
1989
|
* @param {Object} pData - The data to pass to the function as a second parameter
|
|
1989
1990
|
* @param {function} fCallback - The callback function to call when the parse is complete
|
|
1990
1991
|
* @param {array} pDataContext - The history of data objects/context already passed in
|
|
1991
|
-
*/},{key:"parseString",value:function parseString(pString,pParseTree,pData,fCallback,pDataContext){var
|
|
1992
|
+
*/},{key:"parseString",value:function parseString(pString,pParseTree,pData,fCallback,pDataContext){var _this36=this;// TODO: There is danger here if a template function attempts to functionally recurse and doesn't pass this in.
|
|
1992
1993
|
var tmpPreviousDataContext=Array.isArray(pDataContext)?pDataContext:[];var tmpDataContext=Array.from(tmpPreviousDataContext);tmpDataContext.push(pData);if(typeof fCallback!=='function'){var tmpParserState=this.newParserState(pParseTree);for(var i=0;i<pString.length;i++){// TODO: This is not fast.
|
|
1993
1994
|
this.parseCharacter(pString[i],tmpParserState,pData,tmpDataContext);}this.flushOutputBuffer(tmpParserState);return tmpParserState.Output;}else{// This is the async mode
|
|
1994
|
-
var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(
|
|
1995
|
-
|
|
1995
|
+
var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(_i23){tmpAnticipate.anticipate(function(fCallback){_this36.parseCharacterAsync(pString[_i23],_tmpParserState,pData,fCallback,tmpDataContext);});};for(var _i23=0;_i23<pString.length;_i23++){_loop(_i23);}tmpAnticipate.wait(function(pError){// Flush the remaining data
|
|
1996
|
+
_this36.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserState.Output);});}}}]);}();module.exports=StringParser;},{}],91:[function(require,module,exports){/**
|
|
1996
1997
|
* Word Tree
|
|
1997
1998
|
* @author Steven Velozo <steven@velozo.com>
|
|
1998
1999
|
* @description Create a tree (directed graph) of Javascript objects, one character per object.
|
|
@@ -2021,20 +2022,20 @@ _this34.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserSta
|
|
|
2021
2022
|
* @param {Object} pParserContext - The context to pass to the parser function
|
|
2022
2023
|
* @return {Object} The leaf parser from the tree
|
|
2023
2024
|
*/},{key:"addPatternBoth",value:function addPatternBoth(pPatternStart,pPatternEnd,fParser,fParserAsync,pParserContext){if(pPatternStart.length<1){return false;}if(typeof pPatternEnd==='string'&&pPatternEnd.length<1){return false;}var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
|
|
2024
|
-
for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!('PatternEnd'in tmpLeaf)){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var
|
|
2025
|
+
for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!('PatternEnd'in tmpLeaf)){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i24=0;_i24<tmpPatternEnd.length;_i24++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i24],_i24);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(pHash,pData){return fParser;}:function(pHash,pData){return pHash;};tmpLeaf.ParseAsync=typeof fParserAsync==='function'?fParserAsync:typeof fParserAsync==='string'?function(pHash,pData,fCallback){return fCallback(null,fParserAsync);}:function(pHash,pData,fCallback){return fCallback(null,tmpLeaf.Parse(pHash,pData));};// A "this" for every object
|
|
2025
2026
|
if(pParserContext){tmpLeaf.ParserContext=pParserContext;}tmpLeaf.isAsync=true;return tmpLeaf;}/** Add a Pattern to the Parse Tree with both function parameter types
|
|
2026
2027
|
* @method addPatternAll
|
|
2027
2028
|
* @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
|
|
2028
2029
|
* @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
|
|
2029
2030
|
* @param {function} fParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
|
|
2030
2031
|
* @param {Object} pParserContext - The context to pass to the parser function
|
|
2031
|
-
*/},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}]);}();module.exports=WordTree;},{}],92:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":1},"Steps":[],"Errors":[],"Log":[]};},{}],93:[function(require,module,exports){var _require5=require('big.js'),PE=_require5.PE;var libFableServiceBase=require('fable-serviceproviderbase');var _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));var FableOperation=/*#__PURE__*/function(_libFableServiceBase9){function FableOperation(pFable,pOptions,pServiceHash){var
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
if(this.state.OverallProgressTracker.StartTimeStamp>0){return fExecutionCompleteCallback(new Error("Operation [".concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," has already been executed!")));}var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');this.progressTrackerSet.setProgressTrackerTotalOperations(this.state.OverallProgressTracker.Hash,this.state.Status.StepCount);this.progressTrackerSet.startProgressTracker(this.state.OverallProgressTracker.Hash);this.info("Operation [".concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," starting..."));var _loop2=function _loop2(i){tmpAnticipate.anticipate(function(fNext){this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," starting..."));this.progressTrackerSet.startProgressTracker(this.state.Steps[i].ProgressTracker.Hash);return fNext();}.bind(
|
|
2036
|
-
tmpAnticipate.anticipate(
|
|
2037
|
-
tmpAnticipate.wait(function(pError){if(pError){
|
|
2032
|
+
*/},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}]);}();module.exports=WordTree;},{}],92:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":1},"Steps":[],"Errors":[],"Log":[]};},{}],93:[function(require,module,exports){var _require5=require('big.js'),PE=_require5.PE;var libFableServiceBase=require('fable-serviceproviderbase');var _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));var FableOperation=/*#__PURE__*/function(_libFableServiceBase9){function FableOperation(pFable,pOptions,pServiceHash){var _this37;_classCallCheck2(this,FableOperation);_this37=_callSuper(this,FableOperation,[pFable,pOptions,pServiceHash]);// Timestamps will just be the long ints
|
|
2033
|
+
_this37.timeStamps={};_this37.serviceType='PhasedOperation';_this37.state=JSON.parse(_OperationStatePrototypeString);_this37.stepMap={};_this37.stepFunctions={};// Match the service instantiation to the operation.
|
|
2034
|
+
_this37.state.Metadata.Hash=_this37.Hash;_this37.state.Metadata.UUID=_this37.UUID;_this37.state.Metadata.Name=typeof _this37.options.Name=='string'?_this37.options.Name:"Unnamed Operation ".concat(_this37.state.Metadata.UUID);_this37.name=_this37.state.Metadata.Name;_this37.progressTrackerSet=_this37.fable.instantiateServiceProviderWithoutRegistration('ProgressTrackerSet');_this37.state.OverallProgressTracker=_this37.progressTrackerSet.createProgressTracker("Overall-".concat(_this37.state.Metadata.UUID));// This is here to use the pass-through logging functions in the operation itself.
|
|
2035
|
+
_this37.log=_this37;return _this37;}_inherits(FableOperation,_libFableServiceBase9);return _createClass2(FableOperation,[{key:"execute",value:function execute(fExecutionCompleteCallback){var _this38=this;// TODO: Should the same operation be allowed to execute more than one time?
|
|
2036
|
+
if(this.state.OverallProgressTracker.StartTimeStamp>0){return fExecutionCompleteCallback(new Error("Operation [".concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," has already been executed!")));}var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');this.progressTrackerSet.setProgressTrackerTotalOperations(this.state.OverallProgressTracker.Hash,this.state.Status.StepCount);this.progressTrackerSet.startProgressTracker(this.state.OverallProgressTracker.Hash);this.info("Operation [".concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," starting..."));var _loop2=function _loop2(i){tmpAnticipate.anticipate(function(fNext){this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," starting..."));this.progressTrackerSet.startProgressTracker(this.state.Steps[i].ProgressTracker.Hash);return fNext();}.bind(_this38));// Steps are executed in a custom context with
|
|
2037
|
+
tmpAnticipate.anticipate(_this38.stepFunctions[_this38.state.Steps[i].GUIDStep].bind({log:_this38,fable:_this38.fable,options:_this38.state.Steps[i].Metadata,metadata:_this38.state.Steps[i].Metadata,ProgressTracker:_this38.progressTrackerSet.getProgressTracker(_this38.state.Steps[i].ProgressTracker.Hash),logProgressTrackerStatus:function(){return this.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"]: ").concat(this.progressTrackerSet.getProgressTrackerStatusString(this.state.Steps[i].ProgressTracker.Hash)));}.bind(_this38),OperationState:_this38.state,StepState:_this38.state.Steps[i]}));tmpAnticipate.anticipate(function(fNext){this.progressTrackerSet.endProgressTracker(this.state.Steps[i].ProgressTracker.Hash);var tmpStepTimingMessage=this.progressTrackerSet.getProgressTrackerStatusString(this.state.Steps[i].ProgressTracker.Hash);this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," complete."));this.fable.log.info("Step #".concat(i," [").concat(this.state.Steps[i].GUIDStep,"] ").concat(this.state.Steps[i].Name," ").concat(tmpStepTimingMessage,"."));this.progressTrackerSet.incrementProgressTracker(this.state.OverallProgressTracker.Hash,1);var tmpOperationTimingMessage=this.progressTrackerSet.getProgressTrackerStatusString(this.state.OverallProgressTracker.Hash);this.fable.log.info("Operation [".concat(this.state.Metadata.UUID,"] ").concat(tmpOperationTimingMessage,"."));return fNext();}.bind(_this38));};for(var i=0;i<this.state.Steps.length;i++){_loop2(i);}// Wait for the anticipation to complete
|
|
2038
|
+
tmpAnticipate.wait(function(pError){if(pError){_this38.fable.log.error("Operation [".concat(_this38.state.Metadata.UUID,"] ").concat(_this38.state.Metadata.Name," had an error: ").concat(pError),pError);return fExecutionCompleteCallback(pError);}_this38.info("Operation [".concat(_this38.state.Metadata.UUID,"] ").concat(_this38.state.Metadata.Name," complete."));var tmpOperationTimingMessage=_this38.progressTrackerSet.getProgressTrackerStatusString(_this38.state.OverallProgressTracker.Hash);_this38.progressTrackerSet.endProgressTracker(_this38.state.OverallProgressTracker.Hash);_this38.fable.log.info("Operation [".concat(_this38.state.Metadata.UUID,"] ").concat(tmpOperationTimingMessage,"."));return fExecutionCompleteCallback();});}// There are three ways to add steps:
|
|
2038
2039
|
// 1. As a basic javascript function
|
|
2039
2040
|
// --
|
|
2040
2041
|
// This is the most basic, java"script" way to add a step. It will
|
|
@@ -2043,11 +2044,11 @@ tmpAnticipate.wait(function(pError){if(pError){_this36.fable.log.error("Operatio
|
|
|
2043
2044
|
},{key:"addStep",value:function addStep(fStepFunction,pStepMetadata,pStepName,pStepDescription,pGUIDStep){var tmpStep={};// GUID is optional
|
|
2044
2045
|
tmpStep.GUIDStep=typeof pGUIDStep!=='undefined'?pGUIDStep:"STEP-".concat(this.state.Steps.length,"-").concat(this.fable.DataGeneration.randomNumericString());// Name is optional
|
|
2045
2046
|
tmpStep.Name=typeof pStepName!=='undefined'?pStepName:"Step [".concat(tmpStep.GUIDStep,"]");tmpStep.Description=typeof pStepDescription!=='undefined'?pStepDescription:"Step execution of ".concat(tmpStep.Name,".");tmpStep.ProgressTracker=this.progressTrackerSet.createProgressTracker(tmpStep.GUIDStep);tmpStep.Metadata=_typeof(pStepMetadata)==='object'?pStepMetadata:{};// There is an array of steps, in the Operation State itself ... push a step there
|
|
2046
|
-
this.state.Steps.push(tmpStep);this.stepMap[tmpStep.GUIDStep]=tmpStep;this.stepFunctions[tmpStep.GUIDStep]=typeof fStepFunction=='function'?fStepFunction:function(fDone){return fDone();};this.state.Status.StepCount++;return tmpStep;}},{key:"setStepTotalOperations",value:function setStepTotalOperations(pGUIDStep,pTotalOperationCount){if(!(pGUIDStep in this.stepMap)){return new Error("Step [".concat(pGUIDStep,"] does not exist in operation [").concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," when attempting to set total operations to ").concat(pTotalOperationCount,"."));}this.progressTrackerSet.setProgressTrackerTotalOperations(this.stepMap[pGUIDStep].ProgressTracker.Hash,pTotalOperationCount);}},{key:"writeOperationLog",value:function writeOperationLog(pLogLevel,pLogText,pLogObject){this.state.Log.push("[".concat(new Date().toUTCString(),"]-[").concat(pLogLevel,"]: ").concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Log.push(JSON.stringify(pLogObject));}}},{key:"writeOperationErrors",value:function writeOperationErrors(pLogText,pLogObject){this.state.Errors.push("".concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Errors.push(JSON.stringify(pLogObject));}}},{key:"trace",value:function trace(pLogText,pLogObject){this.writeOperationLog('TRACE',pLogText,pLogObject);this.fable.log.trace(pLogText,pLogObject);}},{key:"debug",value:function debug(pLogText,pLogObject){this.writeOperationLog('DEBUG',pLogText,pLogObject);this.fable.log.debug(pLogText,pLogObject);}},{key:"info",value:function info(pLogText,pLogObject){this.writeOperationLog('INFO',pLogText,pLogObject);this.fable.log.info(pLogText,pLogObject);}},{key:"warn",value:function warn(pLogText,pLogObject){this.writeOperationLog('WARN',pLogText,pLogObject);this.fable.log.warn(pLogText,pLogObject);}},{key:"error",value:function error(pLogText,pLogObject){this.writeOperationLog('ERROR',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.error(pLogText,pLogObject);}},{key:"fatal",value:function fatal(pLogText,pLogObject){this.writeOperationLog('FATAL',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.fatal(pLogText,pLogObject);}}]);}(libFableServiceBase);module.exports=FableOperation;},{"./Fable-Service-Operation-DefaultSettings.js":92,"big.js":17,"fable-serviceproviderbase":
|
|
2047
|
+
this.state.Steps.push(tmpStep);this.stepMap[tmpStep.GUIDStep]=tmpStep;this.stepFunctions[tmpStep.GUIDStep]=typeof fStepFunction=='function'?fStepFunction:function(fDone){return fDone();};this.state.Status.StepCount++;return tmpStep;}},{key:"setStepTotalOperations",value:function setStepTotalOperations(pGUIDStep,pTotalOperationCount){if(!(pGUIDStep in this.stepMap)){return new Error("Step [".concat(pGUIDStep,"] does not exist in operation [").concat(this.state.Metadata.UUID,"] ").concat(this.state.Metadata.Name," when attempting to set total operations to ").concat(pTotalOperationCount,"."));}this.progressTrackerSet.setProgressTrackerTotalOperations(this.stepMap[pGUIDStep].ProgressTracker.Hash,pTotalOperationCount);}},{key:"writeOperationLog",value:function writeOperationLog(pLogLevel,pLogText,pLogObject){this.state.Log.push("[".concat(new Date().toUTCString(),"]-[").concat(pLogLevel,"]: ").concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Log.push(JSON.stringify(pLogObject));}}},{key:"writeOperationErrors",value:function writeOperationErrors(pLogText,pLogObject){this.state.Errors.push("".concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Errors.push(JSON.stringify(pLogObject));}}},{key:"trace",value:function trace(pLogText,pLogObject){this.writeOperationLog('TRACE',pLogText,pLogObject);this.fable.log.trace(pLogText,pLogObject);}},{key:"debug",value:function debug(pLogText,pLogObject){this.writeOperationLog('DEBUG',pLogText,pLogObject);this.fable.log.debug(pLogText,pLogObject);}},{key:"info",value:function info(pLogText,pLogObject){this.writeOperationLog('INFO',pLogText,pLogObject);this.fable.log.info(pLogText,pLogObject);}},{key:"warn",value:function warn(pLogText,pLogObject){this.writeOperationLog('WARN',pLogText,pLogObject);this.fable.log.warn(pLogText,pLogObject);}},{key:"error",value:function error(pLogText,pLogObject){this.writeOperationLog('ERROR',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.error(pLogText,pLogObject);}},{key:"fatal",value:function fatal(pLogText,pLogObject){this.writeOperationLog('FATAL',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.fatal(pLogText,pLogObject);}}]);}(libFableServiceBase);module.exports=FableOperation;},{"./Fable-Service-Operation-DefaultSettings.js":92,"big.js":17,"fable-serviceproviderbase":59}],94:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceProgressTime=/*#__PURE__*/function(_libFableServiceBase10){function FableServiceProgressTime(pFable,pOptions,pServiceHash){var _this39;_classCallCheck2(this,FableServiceProgressTime);_this39=_callSuper(this,FableServiceProgressTime,[pFable,pOptions,pServiceHash]);_this39.serviceType='ProgressTime';_this39.timeStamps={};return _this39;}_inherits(FableServiceProgressTime,_libFableServiceBase10);return _createClass2(FableServiceProgressTime,[{key:"formatTimeDuration",value:function formatTimeDuration(pTimeDurationInMilliseconds){var tmpTimeDuration=typeof pTimeDurationInMilliseconds=='number'?pTimeDurationInMilliseconds:0;if(pTimeDurationInMilliseconds<0){return'unknown';}var tmpTimeDurationString='';if(tmpTimeDuration>3600000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/3600000)+'h ';tmpTimeDuration=tmpTimeDuration%3600000;}if(tmpTimeDuration>60000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/60000)+'m ';tmpTimeDuration=tmpTimeDuration%60000;}if(tmpTimeDuration>1000){tmpTimeDurationString+=Math.floor(tmpTimeDuration/1000)+'s ';tmpTimeDuration=tmpTimeDuration%1000;}tmpTimeDurationString+=Math.round(tmpTimeDuration)+'ms';return tmpTimeDurationString;}},{key:"createTimeStamp",value:function createTimeStamp(pTimeStampHash){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';this.timeStamps[tmpTimeStampHash]=+new Date();return this.timeStamps[tmpTimeStampHash];}},{key:"getTimeStampValue",value:function getTimeStampValue(pTimeStampHash){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';return tmpTimeStampHash in this.timeStamps?this.timeStamps[tmpTimeStampHash]:-1;}},{key:"updateTimeStampValue",value:function updateTimeStampValue(pTimeStampHash,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpReferenceTime=false;// This function allows the user to pass in either a reference time in ms, or, a hash of a timestamp.
|
|
2047
2048
|
if(typeof pReferenceTime=='string'){tmpReferenceTime=tmpReference in this.timeStamps?this.timeStamps[tmpReference]:false;}else if(typeof pReferenceTime=='number'){tmpReferenceTime=pReferenceTime;}else{tmpReferenceTime=+new Date();}if(tmpTimeStampHash in this.timeStamps&&tmpReferenceTime){this.timeStamps[tmpTimeStampHash]=tmpReferenceTime;return this.timeStamps[tmpTimeStampHash];}else{return-1;}}},{key:"removeTimeStamp",value:function removeTimeStamp(pTimeStampHash){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';if(tmpTimeStampHash in this.timeStamps){delete this.timeStamps[tmpTimeStampHash];return true;}else{return false;}}},{key:"getTimeStampDelta",value:function getTimeStampDelta(pTimeStampHash,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpReferenceTime=false;// This function allows the user to pass in either a reference time in ms, or, a hash of a timestamp.
|
|
2048
|
-
if(typeof pReferenceTime=='string'){tmpReferenceTime=tmpReference in this.timeStamps?this.timeStamps[tmpReference]:false;}else if(typeof pReferenceTime=='number'){tmpReferenceTime=pReferenceTime;}else{tmpReferenceTime=+new Date();}if(tmpTimeStampHash in this.timeStamps&&tmpReferenceTime){return tmpReferenceTime-this.timeStamps[tmpTimeStampHash];}else{return-1;}}},{key:"getDurationBetweenTimestamps",value:function getDurationBetweenTimestamps(pTimeStampHashStart,pTimeStampHashEnd){var tmpTimeStampHashStart=typeof pTimeStampHashStart=='string'?pTimeStampHashStart:'Default';var tmpTimeStampHashEnd=typeof pTimeStampHashEnd=='string'?pTimeStampHashEnd:'Default';if(tmpTimeStampHashStart in this.timeStamps&&tmpTimeStampHashEnd in this.timeStamps){return this.timeStamps[tmpTimeStampHashEnd]-this.timeStamps[tmpTimeStampHashStart];}else{return-1;}}},{key:"getTimeStampDeltaMessage",value:function getTimeStampDeltaMessage(pTimeStampHash,pMessage,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpMessage=typeof pMessage!=='undefined'?pMessage:"Elapsed for ".concat(tmpTimeStampHash,": ");var tmpOperationTime=this.getTimeStampDelta(tmpTimeStampHash,pReferenceTime);return"".concat(tmpMessage," ").concat(this.formatTimeDuration(tmpOperationTime));}},{key:"logTimeStampDelta",value:function logTimeStampDelta(pTimeStampHash,pMessage,pReferenceTime){this.fable.log.info(this.getTimeStampDeltaMessage(pTimeStampHash,pMessage,pReferenceTime));}}]);}(libFableServiceBase);module.exports=FableServiceProgressTime;},{"fable-serviceproviderbase":
|
|
2049
|
-
|
|
2050
|
-
|
|
2049
|
+
if(typeof pReferenceTime=='string'){tmpReferenceTime=tmpReference in this.timeStamps?this.timeStamps[tmpReference]:false;}else if(typeof pReferenceTime=='number'){tmpReferenceTime=pReferenceTime;}else{tmpReferenceTime=+new Date();}if(tmpTimeStampHash in this.timeStamps&&tmpReferenceTime){return tmpReferenceTime-this.timeStamps[tmpTimeStampHash];}else{return-1;}}},{key:"getDurationBetweenTimestamps",value:function getDurationBetweenTimestamps(pTimeStampHashStart,pTimeStampHashEnd){var tmpTimeStampHashStart=typeof pTimeStampHashStart=='string'?pTimeStampHashStart:'Default';var tmpTimeStampHashEnd=typeof pTimeStampHashEnd=='string'?pTimeStampHashEnd:'Default';if(tmpTimeStampHashStart in this.timeStamps&&tmpTimeStampHashEnd in this.timeStamps){return this.timeStamps[tmpTimeStampHashEnd]-this.timeStamps[tmpTimeStampHashStart];}else{return-1;}}},{key:"getTimeStampDeltaMessage",value:function getTimeStampDeltaMessage(pTimeStampHash,pMessage,pReferenceTime){var tmpTimeStampHash=typeof pTimeStampHash=='string'?pTimeStampHash:'Default';var tmpMessage=typeof pMessage!=='undefined'?pMessage:"Elapsed for ".concat(tmpTimeStampHash,": ");var tmpOperationTime=this.getTimeStampDelta(tmpTimeStampHash,pReferenceTime);return"".concat(tmpMessage," ").concat(this.formatTimeDuration(tmpOperationTime));}},{key:"logTimeStampDelta",value:function logTimeStampDelta(pTimeStampHash,pMessage,pReferenceTime){this.fable.log.info(this.getTimeStampDeltaMessage(pTimeStampHash,pMessage,pReferenceTime));}}]);}(libFableServiceBase);module.exports=FableServiceProgressTime;},{"fable-serviceproviderbase":59}],95:[function(require,module,exports){var ProgressTracker=/*#__PURE__*/function(){function ProgressTracker(pProgressTrackerSet,pProgressTrackerHash){_classCallCheck2(this,ProgressTracker);this.progressTrackerSet=pProgressTrackerSet;this.progressTrackerHash=pProgressTrackerHash;this.data=this.progressTrackerSet.getProgressTrackerData(this.progressTrackerHash);}return _createClass2(ProgressTracker,[{key:"updateProgressTracker",value:function updateProgressTracker(pProgressAmount){return this.progressTrackerSet.updateProgressTracker(this.progressTrackerHash,pProgressAmount);}},{key:"incrementProgressTracker",value:function incrementProgressTracker(pProgressIncrementAmount){return this.progressTrackerSet.incrementProgressTracker(this.progressTrackerHash,pProgressIncrementAmount);}},{key:"setProgressTrackerTotalOperations",value:function setProgressTrackerTotalOperations(pTotalOperationCount){return this.progressTrackerSet.setProgressTrackerTotalOperations(this.progressTrackerHash,pTotalOperationCount);}},{key:"getProgressTrackerStatusString",value:function getProgressTrackerStatusString(){return this.progressTrackerSet.getProgressTrackerStatusString(this.progressTrackerHash);}}]);}();module.exports=ProgressTracker;},{}],96:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var libProgressTrackerClass=require('./Fable-Service-ProgressTracker/ProgressTracker.js');var FableServiceProgressTrackerSet=/*#__PURE__*/function(_libFableServiceBase11){function FableServiceProgressTrackerSet(pFable,pOptions,pServiceHash){var _this40;_classCallCheck2(this,FableServiceProgressTrackerSet);_this40=_callSuper(this,FableServiceProgressTrackerSet,[pFable,pOptions,pServiceHash]);_this40.serviceType='ProgressTrackerSet';_this40.progressTrackers={};// Create an internal PorgressTime service to track timestamps
|
|
2050
|
+
_this40.progressTimes=_this40.fable.instantiateServiceProviderWithoutRegistration('ProgressTime');// This timestamp is used and updated by *all* progress trackers.
|
|
2051
|
+
_this40.progressTimes.createTimeStamp('CurrentTime');return _this40;}_inherits(FableServiceProgressTrackerSet,_libFableServiceBase11);return _createClass2(FableServiceProgressTrackerSet,[{key:"getProgressTracker",value:function getProgressTracker(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.warn("ProgressTracker ".concat(tmpProgressTrackerHash," does not exist! Creating a new tracker..."));this.createProgressTracker(tmpProgressTrackerHash,100);}return new libProgressTrackerClass(this,pProgressTrackerHash);}},{key:"getProgressTrackerData",value:function getProgressTrackerData(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.warn("ProgressTracker ".concat(tmpProgressTrackerHash," does not exist! Creating a new tracker..."));this.createProgressTracker(tmpProgressTrackerHash,100);}return this.progressTrackers[tmpProgressTrackerHash];}},{key:"createProgressTracker",value:function createProgressTracker(pProgressTrackerHash,pTotalOperations){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';var tmpTotalOperations=typeof pTotalOperations=='number'?pTotalOperations:100;var tmpProgressTracker={Hash:tmpProgressTrackerHash,StartTimeHash:"".concat(tmpProgressTrackerHash,"-Start"),StartTimeStamp:-1,CurrentTimeStamp:-1,EndTimeHash:"".concat(tmpProgressTrackerHash,"-End"),EndTimeStamp:-1,PercentComplete:-1,// If this is set to true, PercentComplete will be calculated as CurrentCount / TotalCount even if it goes over 100%
|
|
2051
2052
|
AllowTruePercentComplete:false,ElapsedTime:-1,AverageOperationTime:-1,EstimatedCompletionTime:-1,TotalCount:tmpTotalOperations,CurrentCount:-1};if(tmpProgressTrackerHash in this.progressTrackers){this.fable.log.warn("ProgressTracker ".concat(tmpProgressTrackerHash," already exists! Overwriting with a new tracker..."));this.progressTimes.removeTimeStamp(tmpProgressTracker.StartTimeHash);this.progressTimes.removeTimeStamp(tmpProgressTracker.EndTimeHash);}this.progressTrackers[tmpProgressTrackerHash]=tmpProgressTracker;return tmpProgressTracker;}},{key:"setProgressTrackerTotalOperations",value:function setProgressTrackerTotalOperations(pProgressTrackerHash,pTotalOperations){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';var tmpTotalOperations=typeof pTotalOperations=='number'?pTotalOperations:100;if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.warn("Attempted to set the total operations of ProgressTracker ".concat(tmpProgressTrackerHash," but it does not exist! Creating a new tracker..."));this.createProgressTracker(tmpProgressTrackerHash,tmpTotalOperations);}this.progressTrackers[tmpProgressTrackerHash].TotalCount=tmpTotalOperations;return this.progressTrackers[tmpProgressTrackerHash];}},{key:"startProgressTracker",value:function startProgressTracker(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';// This is the only method to lazily create ProgressTrackers now
|
|
2052
2053
|
if(!(tmpProgressTrackerHash in this.progressTrackers)){this.createProgressTracker(tmpProgressTrackerHash,100);}var tmpProgressTracker=this.progressTrackers[tmpProgressTrackerHash];this.progressTimes.createTimeStamp(this.progressTrackers[tmpProgressTrackerHash].StartTimeHash);tmpProgressTracker.StartTimeStamp=this.progressTimes.getTimeStampValue(this.progressTrackers[tmpProgressTrackerHash].StartTimeHash);if(tmpProgressTracker.CurrentCount<0){tmpProgressTracker.CurrentCount=0;}return this.solveProgressTrackerStatus(tmpProgressTrackerHash);}},{key:"endProgressTracker",value:function endProgressTracker(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.error("Attempted to end ProgressTracker ".concat(tmpProgressTrackerHash," that does not exist!"));return false;}var tmpProgressTracker=this.progressTrackers[tmpProgressTrackerHash];this.progressTimes.createTimeStamp(this.progressTrackers[tmpProgressTrackerHash].EndTimeHash);tmpProgressTracker.EndTimeStamp=this.progressTimes.getTimeStampValue(this.progressTrackers[tmpProgressTrackerHash].EndTimeHash);return this.solveProgressTrackerStatus(tmpProgressTrackerHash);}},{key:"solveProgressTrackerStatus",value:function solveProgressTrackerStatus(pProgressTrackerHash){var tmpProgressTrackerHash=typeof pProgressTrackerHash=='string'?pProgressTrackerHash:'Default';if(!(tmpProgressTrackerHash in this.progressTrackers)){this.fable.log.error("Attempted to solve ProgressTracker ".concat(tmpProgressTrackerHash," that does not exist!"));return false;}var tmpProgressTracker=this.progressTrackers[tmpProgressTrackerHash];if(tmpProgressTracker.TotalCount<1||isNaN(tmpProgressTracker.TotalCount)){this.fable.log.error("ProgressTracker ".concat(tmpProgressTracker.Hash," has an invalid total count of operations (").concat(tmpProgressTracker.TotalCount,"! Setting it to the default of 100..."));tmpProgressTracker.TotalCount=100;}// Compute the percentage of progress that is complete.
|
|
2053
2054
|
if(tmpProgressTracker.CurrentCount<1){tmpProgressTracker.PercentComplete=0;}else{tmpProgressTracker.PercentComplete=tmpProgressTracker.CurrentCount/tmpProgressTracker.TotalCount*100.0;}if(!tmpProgressTracker.AllowTruePercentComplete&&tmpProgressTracker.PercentComplete>100){tmpProgressTracker.PercentComplete=100;}// Compute the average time per operation
|
|
@@ -2068,20 +2069,20 @@ this.solveProgressTrackerStatus(tmpProgressTrackerHash);if(!(tmpProgressTrackerH
|
|
|
2068
2069
|
if(tmpProgressTracker.StartTimeStamp<1){return"ProgressTracker ".concat(tmpProgressTracker.Hash," has not been started yet.");}// 2. Started, but no operations completed
|
|
2069
2070
|
if(tmpProgressTracker.CurrentCount<1&&tmpProgressTracker.EndTimeStamp<1){return"ProgressTracker ".concat(tmpProgressTracker.Hash," has no completed operations. ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.ElapsedTime)," have elapsed since it was started.");}// 3. Started, some operations completed
|
|
2070
2071
|
else if(tmpProgressTracker.EndTimeStamp<1){return"ProgressTracker ".concat(tmpProgressTracker.Hash," is ").concat(tmpProgressTracker.PercentComplete.toFixed(3),"% completed - ").concat(tmpProgressTracker.CurrentCount," / ").concat(tmpProgressTracker.TotalCount," operations over ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.ElapsedTime)," (median ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.AverageOperationTime)," per). Estimated completion: ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.EstimatedCompletionTime));}// 4. Done
|
|
2071
|
-
else{return"ProgressTracker ".concat(tmpProgressTracker.Hash," is done. ").concat(tmpProgressTracker.CurrentCount," / ").concat(tmpProgressTracker.TotalCount," operations were completed in ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.ElapsedTime)," (median ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.AverageOperationTime)," per).");}}}},{key:"logProgressTrackerStatus",value:function logProgressTrackerStatus(pProgressTrackerHash){this.fable.log.info(this.getProgressTrackerStatusString(pProgressTrackerHash));}}]);}(libFableServiceBase);module.exports=FableServiceProgressTrackerSet;},{"./Fable-Service-ProgressTracker/ProgressTracker.js":95,"fable-serviceproviderbase":
|
|
2072
|
+
else{return"ProgressTracker ".concat(tmpProgressTracker.Hash," is done. ").concat(tmpProgressTracker.CurrentCount," / ").concat(tmpProgressTracker.TotalCount," operations were completed in ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.ElapsedTime)," (median ").concat(this.progressTimes.formatTimeDuration(tmpProgressTracker.AverageOperationTime)," per).");}}}},{key:"logProgressTrackerStatus",value:function logProgressTrackerStatus(pProgressTrackerHash){this.fable.log.info(this.getProgressTrackerStatusString(pProgressTrackerHash));}}]);}(libFableServiceBase);module.exports=FableServiceProgressTrackerSet;},{"./Fable-Service-ProgressTracker/ProgressTracker.js":95,"fable-serviceproviderbase":59}],97:[function(require,module,exports){(function(Buffer){(function(){var libFableServiceBase=require('fable-serviceproviderbase');var libSimpleGet=require('simple-get');var libCookie=require('cookie');var FableServiceRestClient=/*#__PURE__*/function(_libFableServiceBase12){function FableServiceRestClient(pFable,pOptions,pServiceHash){var _this41;_classCallCheck2(this,FableServiceRestClient);_this41=_callSuper(this,FableServiceRestClient,[pFable,pOptions,pServiceHash]);_this41.TraceLog=false;if(_this41.options.TraceLog||_this41.fable.TraceLog){_this41.TraceLog=true;}_this41.dataFormat=_this41.fable.services.DataFormat;_this41.serviceType='RestClient';_this41.cookie=false;// This is a function that can be overridden, to allow the management
|
|
2072
2073
|
// of the request options before they are passed to the request library.
|
|
2073
|
-
|
|
2074
|
+
_this41.prepareRequestOptions=function(pOptions){return pOptions;};return _this41;}_inherits(FableServiceRestClient,_libFableServiceBase12);return _createClass2(FableServiceRestClient,[{key:"simpleGet",get:function get(){return libSimpleGet;}},{key:"prepareCookies",value:function prepareCookies(pRequestOptions){if(this.cookie){var tmpCookieObject=this.cookie;if(!('headers'in pRequestOptions)){pRequestOptions.headers={};}var tmpCookieKeys=Object.keys(tmpCookieObject);if(tmpCookieKeys.length>0){// Only grab the first for now.
|
|
2074
2075
|
pRequestOptions.headers.cookie=libCookie.serialize(tmpCookieKeys[0],tmpCookieObject[tmpCookieKeys[0]]);}}return pRequestOptions;}},{key:"preRequest",value:function preRequest(pOptions){// Validate the options object
|
|
2075
2076
|
var tmpOptions=this.prepareCookies(pOptions);// Prepend a string to the URL if it exists in the Fable Config
|
|
2076
|
-
if('RestClientURLPrefix'in this.fable.settings){tmpOptions.url=this.fable.settings.RestClientURLPrefix+tmpOptions.url;}return this.prepareRequestOptions(tmpOptions);}},{key:"executeChunkedRequest",value:function executeChunkedRequest(pOptions,fCallback){var
|
|
2077
|
-
if(
|
|
2078
|
-
if(
|
|
2079
|
-
if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.concat([tmpDataBuffer,pChunk]);}});pResponse.on('end',function(){if(
|
|
2077
|
+
if('RestClientURLPrefix'in this.fable.settings){tmpOptions.url=this.fable.settings.RestClientURLPrefix+tmpOptions.url;}return this.prepareRequestOptions(tmpOptions);}},{key:"executeChunkedRequest",value:function executeChunkedRequest(pOptions,fCallback){var _this42=this;var tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this42.TraceLog){var tmpConnectTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpData='';pResponse.on('data',function(pChunk){// For JSON, the chunk is the serialized object.
|
|
2078
|
+
if(_this42.TraceLog){var tmpChunkTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpData+=pChunk;});pResponse.on('end',function(){if(_this42.TraceLog){var tmpCompletionTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpData.length,"b received in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpData);});});}},{key:"executeChunkedRequestBinary",value:function executeChunkedRequestBinary(pOptions,fCallback){var _this43=this;var tmpOptions=this.preRequest(pOptions);tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}tmpOptions.json=false;tmpOptions.encoding=null;return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this43.TraceLog){var tmpConnectTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpDataBuffer=false;pResponse.on('data',function(pChunk){// For JSON, the chunk is the serialized object.
|
|
2079
|
+
if(_this43.TraceLog){var tmpChunkTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}// TODO: Potentially create a third option that streams this to a file? So it doesn't have to hold it all in memory.
|
|
2080
|
+
if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.concat([tmpDataBuffer,pChunk]);}});pResponse.on('end',function(){if(_this43.TraceLog){var tmpCompletionTime=_this43.fable.log.getTimeStamp();_this43.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpDataBuffer.length,"b received in ").concat(_this43.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpDataBuffer);});});}},{key:"executeJSONRequest",value:function executeJSONRequest(pOptions,fCallback){var _this44=this;pOptions.json=true;var tmpOptions=this.preRequest(pOptions);if(!('headers'in tmpOptions)){tmpOptions.headers={};}/* Automated headers break some APIs
|
|
2080
2081
|
if (!('Content-Type' in tmpOptions.headers))
|
|
2081
2082
|
{
|
|
2082
2083
|
tmpOptions.headers['Content-Type'] = 'application/json';
|
|
2083
2084
|
}
|
|
2084
|
-
*/tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," JSON request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(
|
|
2085
|
+
*/tmpOptions.RequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){this.fable.log.debug("Beginning ".concat(tmpOptions.method," JSON request to ").concat(tmpOptions.url," at ").concat(tmpOptions.RequestStartTime));}return libSimpleGet(tmpOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse);}if(_this44.TraceLog){var tmpConnectTime=_this44.fable.log.getTimeStamp();_this44.fable.log.debug("--> JSON ".concat(tmpOptions.method," connected in ").concat(_this44.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpJSONData='';pResponse.on('data',function(pChunk){if(_this44.TraceLog){var tmpChunkTime=_this44.fable.log.getTimeStamp();_this44.fable.log.debug("--> JSON ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this44.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpJSONData+=pChunk;});pResponse.on('end',function(){if(_this44.TraceLog){var tmpCompletionTime=_this44.fable.log.getTimeStamp();_this44.fable.log.debug("==> JSON ".concat(tmpOptions.method," completed - received in ").concat(_this44.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,JSON.parse(tmpJSONData));});});}},{key:"getJSON",value:function getJSON(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeJSONRequest(tmpRequestOptions,fCallback);}},{key:"putJSON",value:function putJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PUT JSON Error Invalid options object"));}pOptions.method='PUT';return this.executeJSONRequest(pOptions,fCallback);}},{key:"postJSON",value:function postJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("POST JSON Error Invalid options object"));}pOptions.method='POST';return this.executeJSONRequest(pOptions,fCallback);}},{key:"patchJSON",value:function patchJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("PATCH JSON Error Invalid options object"));}pOptions.method='PATCH';return this.executeJSONRequest(pOptions,fCallback);}},{key:"headJSON",value:function headJSON(pOptions,fCallback){if(_typeof(pOptions.body)!='object'){return fCallback(new Error("HEAD JSON Error Invalid options object"));}pOptions.method='HEAD';return this.executeJSONRequest(pOptions,fCallback);}},{key:"delJSON",value:function delJSON(pOptions,fCallback){pOptions.method='DELETE';return this.executeJSONRequest(pOptions,fCallback);}},{key:"getRawText",value:function getRawText(pOptionsOrURL,fCallback){var tmpRequestOptions=_typeof(pOptionsOrURL)=='object'?pOptionsOrURL:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}tmpRequestOptions.method='GET';return this.executeChunkedRequest(tmpRequestOptions,fCallback);}}]);}(libFableServiceBase);module.exports=FableServiceRestClient;}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20,"cookie":31,"fable-serviceproviderbase":59,"simple-get":165}],98:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceTemplate=/*#__PURE__*/function(_libFableServiceBase13){// Underscore and lodash have a behavior, _.template, which compiles a
|
|
2085
2086
|
// string-based template with code snippets into simple executable pieces,
|
|
2086
2087
|
// with the added twist of returning a precompiled function ready to go.
|
|
2087
2088
|
//
|
|
@@ -2090,19 +2091,19 @@ if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.
|
|
|
2090
2091
|
//
|
|
2091
2092
|
// This is an implementation of that.
|
|
2092
2093
|
// TODO: Make this use precedent, add configuration, add debugging.
|
|
2093
|
-
function FableServiceTemplate(pFable,pOptions,pServiceHash){var
|
|
2094
|
+
function FableServiceTemplate(pFable,pOptions,pServiceHash){var _this45;_classCallCheck2(this,FableServiceTemplate);_this45=_callSuper(this,FableServiceTemplate,[pFable,pOptions,pServiceHash]);_this45.serviceType='Template';// These are the exact regex's used in lodash/underscore
|
|
2094
2095
|
// TODO: Switch this to precedent
|
|
2095
|
-
|
|
2096
|
+
_this45.Matchers={Evaluate:/<%([\s\S]+?)%>/g,Interpolate:/<%=([\s\S]+?)%>/g,Escaper:/\\|'|\r|\n|\t|\u2028|\u2029/g,Unescaper:/\\(\\|'|r|n|t|u2028|u2029)/g,// This is how underscore does it, so we are keeping it for now.
|
|
2096
2097
|
GuaranteedNonMatch:/.^/};// This is a helper for the escaper and unescaper functions.
|
|
2097
2098
|
// Right now we are going to keep what underscore is doing, but, not forever.
|
|
2098
|
-
|
|
2099
|
+
_this45.templateEscapes={'\\':'\\',"'":"'",'r':'\r','\r':'r','n':'\n','\n':'n','t':'\t','\t':'t','u2028':"\u2028","\u2028":'u2028','u2029':"\u2029","\u2029":'u2029'};// This is defined as such to underscore that it is a dynamic programming
|
|
2099
2100
|
// function on this class.
|
|
2100
|
-
|
|
2101
|
+
_this45.renderFunction=false;_this45.templateString=false;return _this45;}_inherits(FableServiceTemplate,_libFableServiceBase13);return _createClass2(FableServiceTemplate,[{key:"renderTemplate",value:function renderTemplate(pData){return this.renderFunction(pData);}},{key:"templateFunction",value:function templateFunction(){var fRenderTemplateBound=this.renderTemplate.bind(this);return fRenderTemplateBound;}},{key:"buildTemplateFunction",value:function buildTemplateFunction(pTemplateText,pData){var _this46=this;// For now this is being kept in a weird form ... this is to mimic the old
|
|
2101
2102
|
// underscore code until this is rewritten using precedent.
|
|
2102
|
-
this.TemplateSource="__p+='"+pTemplateText.replace(this.Matchers.Escaper,function(pMatch){return"\\".concat(
|
|
2103
|
+
this.TemplateSource="__p+='"+pTemplateText.replace(this.Matchers.Escaper,function(pMatch){return"\\".concat(_this46.templateEscapes[pMatch]);}).replace(this.Matchers.Interpolate||this.Matchers.GuaranteedNonMatch,function(pMatch,pCode){return"'+\n(".concat(decodeURIComponent(pCode),")+\n'");}).replace(this.Matchers.Evaluate||this.Matchers.GuaranteedNonMatch,function(pMatch,pCode){return"';\n".concat(decodeURIComponent(pCode),"\n;__p+='");})+"';\n";this.TemplateSource="with(pTemplateDataObject||{}){\n".concat(this.TemplateSource,"}\n");this.TemplateSource="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n".concat(this.TemplateSource,"return __p;\n");this.renderFunction=new Function('pTemplateDataObject',this.TemplateSource);if(typeof pData!='undefined'){return this.renderFunction(pData);}// Provide the compiled function source as a convenience for build time
|
|
2103
2104
|
// precompilation.
|
|
2104
|
-
this.TemplateSourceCompiled='function(obj){\n'+this.TemplateSource+'}';return this.templateFunction();}}]);}(libFableServiceBase);module.exports=FableServiceTemplate;},{"fable-serviceproviderbase":
|
|
2105
|
-
var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('async.eachlimit');var libBigNumber=require('big.js');var FableServiceUtility=/*#__PURE__*/function(
|
|
2105
|
+
this.TemplateSourceCompiled='function(obj){\n'+this.TemplateSource+'}';return this.templateFunction();}}]);}(libFableServiceBase);module.exports=FableServiceTemplate;},{"fable-serviceproviderbase":59}],99:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');// TODO: These are still pretty big -- consider the smaller polyfills
|
|
2106
|
+
var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('async.eachlimit');var libBigNumber=require('big.js');var FableServiceUtility=/*#__PURE__*/function(_libFableServiceBase14){// Underscore and lodash have a behavior, _.template, which compiles a
|
|
2106
2107
|
// string-based template with code snippets into simple executable pieces,
|
|
2107
2108
|
// with the added twist of returning a precompiled function ready to go.
|
|
2108
2109
|
//
|
|
@@ -2111,12 +2112,12 @@ var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('
|
|
|
2111
2112
|
//
|
|
2112
2113
|
// This is an implementation of that.
|
|
2113
2114
|
// TODO: Make this use precedent, add configuration, add debugging.
|
|
2114
|
-
function FableServiceUtility(pFable,pOptions,pServiceHash){var
|
|
2115
|
-
|
|
2115
|
+
function FableServiceUtility(pFable,pOptions,pServiceHash){var _this47;_classCallCheck2(this,FableServiceUtility);_this47=_callSuper(this,FableServiceUtility,[pFable,pOptions,pServiceHash]);_this47.templates={};// These two functions are used extensively throughout
|
|
2116
|
+
_this47.waterfall=libAsyncWaterfall;_this47.eachLimit=libAsyncEachLimit;_this47.bigNumber=libBigNumber;return _this47;}// Underscore and lodash have a behavior, _.extend, which merges objects.
|
|
2116
2117
|
// Now that es6 gives us this, use the native thingy.
|
|
2117
2118
|
// Nevermind, the native thing is not stable enough across environments
|
|
2118
2119
|
// Basic shallow copy
|
|
2119
|
-
_inherits(FableServiceUtility,
|
|
2120
|
+
_inherits(FableServiceUtility,_libFableServiceBase14);return _createClass2(FableServiceUtility,[{key:"extend",value:function extend(pDestinationObject){for(var i=0;i<(arguments.length<=1?0:arguments.length-1);i++){var tmpSourceObject=i+1<1||arguments.length<=i+1?undefined:arguments[i+1];if(_typeof(tmpSourceObject)==='object'){var tmpObjectProperties=Object.keys(tmpSourceObject);for(var k=0;k<tmpObjectProperties.length;k++){pDestinationObject[tmpObjectProperties[k]]=tmpSourceObject[tmpObjectProperties[k]];}}}return pDestinationObject;}// Underscore and lodash have a behavior, _.template, which compiles a
|
|
2120
2121
|
// string-based template with code snippets into simple executable pieces,
|
|
2121
2122
|
// with the added twist of returning a precompiled function ready to go.
|
|
2122
2123
|
},{key:"template",value:function template(pTemplateText,pData){var tmpTemplate=this.fable.instantiateServiceProviderWithoutRegistration('Template');return tmpTemplate.buildTemplateFunction(pTemplateText,pData);}// Build a template function from a template hash, and, register it with the service provider
|
|
@@ -2232,7 +2233,7 @@ if(!this.manifest){this.manifest=this.fable.newManyfest();}if(typeof pFableAddre
|
|
|
2232
2233
|
* @param {Array<any>} pInputArray - The array of inputs to flatten
|
|
2233
2234
|
* @return {Array<any>} - The flattened array
|
|
2234
2235
|
*/},{key:"flattenArrayOfSolverInputs",value:function flattenArrayOfSolverInputs(pInputArray){if(!Array.isArray(pInputArray)){if(_typeof(pInputArray)==='object'){pInputArray=Object.values(pInputArray);}if(!pInputArray){return[];}}var tmpArrayFlattener=function tmpArrayFlattener(p){if(Array.isArray(p)){return p;// .flatMap(tmpArrayFlattener);
|
|
2235
|
-
}if(_typeof(p)==='object'){return Object.values(p);}return[p];};return pInputArray.flatMap(tmpArrayFlattener);}}]);}(libFableServiceBase);module.exports=FableServiceUtility;},{"async.eachlimit":1,"async.waterfall":15,"big.js":17,"fable-serviceproviderbase":
|
|
2236
|
+
}if(_typeof(p)==='object'){return Object.values(p);}return[p];};return pInputArray.flatMap(tmpArrayFlattener);}}]);}(libFableServiceBase);module.exports=FableServiceUtility;},{"async.eachlimit":1,"async.waterfall":15,"big.js":17,"fable-serviceproviderbase":59}],100:[function(require,module,exports){var SetConcatArray=/*#__PURE__*/_createClass2(/**
|
|
2236
2237
|
* @param {Array<any>|SetConcatArray} pLeftValue - The left value to concatenate.
|
|
2237
2238
|
* @param {Array<any>|SetConcatArray} pRightValue - The right value to concatenate.
|
|
2238
2239
|
*/function SetConcatArray(pLeftValue,pRightValue){_classCallCheck2(this,SetConcatArray);if(pLeftValue instanceof SetConcatArray){this.values=pLeftValue.values.concat([pRightValue]);}else if(pRightValue instanceof SetConcatArray){this.values=[pLeftValue].concat(pRightValue.values);}else{this.values=[pLeftValue,pRightValue];}});module.exports=SetConcatArray;},{}],101:[function(require,module,exports){'use strict';/* eslint no-invalid-this: 1 */var ERROR_MESSAGE='Function.prototype.bind called on incompatible ';var toStr=Object.prototype.toString;var max=Math.max;var funcType='[object Function]';var concatty=function concatty(a,b){var arr=[];for(var i=0;i<a.length;i+=1){arr[i]=a[i];}for(var j=0;j<b.length;j+=1){arr[j+a.length]=b[j];}return arr;};var slicy=function slicy(arrLike,offset){var arr=[];for(var i=offset||0,j=0;i<arrLike.length;i+=1,j+=1){arr[j]=arrLike[i];}return arr;};var joiny=function joiny(arr,joiner){var str='';for(var i=0;i<arr.length;i+=1){str+=arr[i];if(i+1<arr.length){str+=joiner;}}return str;};module.exports=function bind(that){var target=this;if(typeof target!=='function'||toStr.apply(target)!==funcType){throw new TypeError(ERROR_MESSAGE+target);}var args=slicy(arguments,1);var bound;var binder=function binder(){if(this instanceof bound){var result=target.apply(this,concatty(args,arguments));if(Object(result)===result){return result;}return this;}return target.apply(that,concatty(args,arguments));};var boundLength=max(0,target.length-args.length);var boundArgs=[];for(var i=0;i<boundLength;i++){boundArgs[i]='$'+i;}bound=Function('binder','return function ('+joiny(boundArgs,',')+'){ return binder.apply(this,arguments); }')(binder);if(target.prototype){var Empty=function Empty(){};Empty.prototype=target.prototype;bound.prototype=new Empty();Empty.prototype=null;}return bound;};},{}],102:[function(require,module,exports){'use strict';var implementation=require('./implementation');module.exports=Function.prototype.bind||implementation;},{"./implementation":101}],103:[function(require,module,exports){'use strict';var undefined;var $Object=require('es-object-atoms');var $Error=require('es-errors');var $EvalError=require('es-errors/eval');var $RangeError=require('es-errors/range');var $ReferenceError=require('es-errors/ref');var $SyntaxError=require('es-errors/syntax');var $TypeError=require('es-errors/type');var $URIError=require('es-errors/uri');var abs=require('math-intrinsics/abs');var floor=require('math-intrinsics/floor');var max=require('math-intrinsics/max');var min=require('math-intrinsics/min');var pow=require('math-intrinsics/pow');var round=require('math-intrinsics/round');var sign=require('math-intrinsics/sign');var $Function=Function;// eslint-disable-next-line consistent-return
|
|
@@ -2240,7 +2241,7 @@ var getEvalledConstructor=function getEvalledConstructor(expressionSyntax){try{r
|
|
|
2240
2241
|
arguments.callee;// IE 8 does not throw here
|
|
2241
2242
|
return throwTypeError;}catch(calleeThrows){try{// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
2242
2243
|
return $gOPD(arguments,'callee').get;}catch(gOPDthrows){return throwTypeError;}}}():throwTypeError;var hasSymbols=require('has-symbols')();var getProto=require('get-proto');var $ObjectGPO=require('get-proto/Object.getPrototypeOf');var $ReflectGPO=require('get-proto/Reflect.getPrototypeOf');var $apply=require('call-bind-apply-helpers/functionApply');var $call=require('call-bind-apply-helpers/functionCall');var needsEval={};var TypedArray=typeof Uint8Array==='undefined'||!getProto?undefined:getProto(Uint8Array);var INTRINSICS={__proto__:null,'%AggregateError%':typeof AggregateError==='undefined'?undefined:AggregateError,'%Array%':Array,'%ArrayBuffer%':typeof ArrayBuffer==='undefined'?undefined:ArrayBuffer,'%ArrayIteratorPrototype%':hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined,'%AsyncFromSyncIteratorPrototype%':undefined,'%AsyncFunction%':needsEval,'%AsyncGenerator%':needsEval,'%AsyncGeneratorFunction%':needsEval,'%AsyncIteratorPrototype%':needsEval,'%Atomics%':typeof Atomics==='undefined'?undefined:Atomics,'%BigInt%':typeof BigInt==='undefined'?undefined:BigInt,'%BigInt64Array%':typeof BigInt64Array==='undefined'?undefined:BigInt64Array,'%BigUint64Array%':typeof BigUint64Array==='undefined'?undefined:BigUint64Array,'%Boolean%':Boolean,'%DataView%':typeof DataView==='undefined'?undefined:DataView,'%Date%':Date,'%decodeURI%':decodeURI,'%decodeURIComponent%':decodeURIComponent,'%encodeURI%':encodeURI,'%encodeURIComponent%':encodeURIComponent,'%Error%':$Error,'%eval%':eval,// eslint-disable-line no-eval
|
|
2243
|
-
'%EvalError%':$EvalError,'%
|
|
2244
|
+
'%EvalError%':$EvalError,'%Float32Array%':typeof Float32Array==='undefined'?undefined:Float32Array,'%Float64Array%':typeof Float64Array==='undefined'?undefined:Float64Array,'%FinalizationRegistry%':typeof FinalizationRegistry==='undefined'?undefined:FinalizationRegistry,'%Function%':$Function,'%GeneratorFunction%':needsEval,'%Int8Array%':typeof Int8Array==='undefined'?undefined:Int8Array,'%Int16Array%':typeof Int16Array==='undefined'?undefined:Int16Array,'%Int32Array%':typeof Int32Array==='undefined'?undefined:Int32Array,'%isFinite%':isFinite,'%isNaN%':isNaN,'%IteratorPrototype%':hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined,'%JSON%':(typeof JSON==="undefined"?"undefined":_typeof(JSON))==='object'?JSON:undefined,'%Map%':typeof Map==='undefined'?undefined:Map,'%MapIteratorPrototype%':typeof Map==='undefined'||!hasSymbols||!getProto?undefined:getProto(new Map()[Symbol.iterator]()),'%Math%':Math,'%Number%':Number,'%Object%':$Object,'%Object.getOwnPropertyDescriptor%':$gOPD,'%parseFloat%':parseFloat,'%parseInt%':parseInt,'%Promise%':typeof Promise==='undefined'?undefined:Promise,'%Proxy%':typeof Proxy==='undefined'?undefined:Proxy,'%RangeError%':$RangeError,'%ReferenceError%':$ReferenceError,'%Reflect%':typeof Reflect==='undefined'?undefined:Reflect,'%RegExp%':RegExp,'%Set%':typeof Set==='undefined'?undefined:Set,'%SetIteratorPrototype%':typeof Set==='undefined'||!hasSymbols||!getProto?undefined:getProto(new Set()[Symbol.iterator]()),'%SharedArrayBuffer%':typeof SharedArrayBuffer==='undefined'?undefined:SharedArrayBuffer,'%String%':String,'%StringIteratorPrototype%':hasSymbols&&getProto?getProto(''[Symbol.iterator]()):undefined,'%Symbol%':hasSymbols?Symbol:undefined,'%SyntaxError%':$SyntaxError,'%ThrowTypeError%':ThrowTypeError,'%TypedArray%':TypedArray,'%TypeError%':$TypeError,'%Uint8Array%':typeof Uint8Array==='undefined'?undefined:Uint8Array,'%Uint8ClampedArray%':typeof Uint8ClampedArray==='undefined'?undefined:Uint8ClampedArray,'%Uint16Array%':typeof Uint16Array==='undefined'?undefined:Uint16Array,'%Uint32Array%':typeof Uint32Array==='undefined'?undefined:Uint32Array,'%URIError%':$URIError,'%WeakMap%':typeof WeakMap==='undefined'?undefined:WeakMap,'%WeakRef%':typeof WeakRef==='undefined'?undefined:WeakRef,'%WeakSet%':typeof WeakSet==='undefined'?undefined:WeakSet,'%Function.prototype.call%':$call,'%Function.prototype.apply%':$apply,'%Object.defineProperty%':$defineProperty,'%Object.getPrototypeOf%':$ObjectGPO,'%Math.abs%':abs,'%Math.floor%':floor,'%Math.max%':max,'%Math.min%':min,'%Math.pow%':pow,'%Math.round%':round,'%Math.sign%':sign,'%Reflect.getPrototypeOf%':$ReflectGPO};if(getProto){try{null.error;// eslint-disable-line no-unused-expressions
|
|
2244
2245
|
}catch(e){// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
2245
2246
|
var errorProto=getProto(getProto(e));INTRINSICS['%Error.prototype%']=errorProto;}}var doEval=function doEval(name){var value;if(name==='%AsyncFunction%'){value=getEvalledConstructor('async function () {}');}else if(name==='%GeneratorFunction%'){value=getEvalledConstructor('function* () {}');}else if(name==='%AsyncGeneratorFunction%'){value=getEvalledConstructor('async function* () {}');}else if(name==='%AsyncGenerator%'){var fn=doEval('%AsyncGeneratorFunction%');if(fn){value=fn.prototype;}}else if(name==='%AsyncIteratorPrototype%'){var gen=doEval('%AsyncGenerator%');if(gen&&getProto){value=getProto(gen.prototype);}}INTRINSICS[name]=value;return value;};var LEGACY_ALIASES={__proto__:null,'%ArrayBufferPrototype%':['ArrayBuffer','prototype'],'%ArrayPrototype%':['Array','prototype'],'%ArrayProto_entries%':['Array','prototype','entries'],'%ArrayProto_forEach%':['Array','prototype','forEach'],'%ArrayProto_keys%':['Array','prototype','keys'],'%ArrayProto_values%':['Array','prototype','values'],'%AsyncFunctionPrototype%':['AsyncFunction','prototype'],'%AsyncGenerator%':['AsyncGeneratorFunction','prototype'],'%AsyncGeneratorPrototype%':['AsyncGeneratorFunction','prototype','prototype'],'%BooleanPrototype%':['Boolean','prototype'],'%DataViewPrototype%':['DataView','prototype'],'%DatePrototype%':['Date','prototype'],'%ErrorPrototype%':['Error','prototype'],'%EvalErrorPrototype%':['EvalError','prototype'],'%Float32ArrayPrototype%':['Float32Array','prototype'],'%Float64ArrayPrototype%':['Float64Array','prototype'],'%FunctionPrototype%':['Function','prototype'],'%Generator%':['GeneratorFunction','prototype'],'%GeneratorPrototype%':['GeneratorFunction','prototype','prototype'],'%Int8ArrayPrototype%':['Int8Array','prototype'],'%Int16ArrayPrototype%':['Int16Array','prototype'],'%Int32ArrayPrototype%':['Int32Array','prototype'],'%JSONParse%':['JSON','parse'],'%JSONStringify%':['JSON','stringify'],'%MapPrototype%':['Map','prototype'],'%NumberPrototype%':['Number','prototype'],'%ObjectPrototype%':['Object','prototype'],'%ObjProto_toString%':['Object','prototype','toString'],'%ObjProto_valueOf%':['Object','prototype','valueOf'],'%PromisePrototype%':['Promise','prototype'],'%PromiseProto_then%':['Promise','prototype','then'],'%Promise_all%':['Promise','all'],'%Promise_reject%':['Promise','reject'],'%Promise_resolve%':['Promise','resolve'],'%RangeErrorPrototype%':['RangeError','prototype'],'%ReferenceErrorPrototype%':['ReferenceError','prototype'],'%RegExpPrototype%':['RegExp','prototype'],'%SetPrototype%':['Set','prototype'],'%SharedArrayBufferPrototype%':['SharedArrayBuffer','prototype'],'%StringPrototype%':['String','prototype'],'%SymbolPrototype%':['Symbol','prototype'],'%SyntaxErrorPrototype%':['SyntaxError','prototype'],'%TypedArrayPrototype%':['TypedArray','prototype'],'%TypeErrorPrototype%':['TypeError','prototype'],'%Uint8ArrayPrototype%':['Uint8Array','prototype'],'%Uint8ClampedArrayPrototype%':['Uint8ClampedArray','prototype'],'%Uint16ArrayPrototype%':['Uint16Array','prototype'],'%Uint32ArrayPrototype%':['Uint32Array','prototype'],'%URIErrorPrototype%':['URIError','prototype'],'%WeakMapPrototype%':['WeakMap','prototype'],'%WeakSetPrototype%':['WeakSet','prototype']};var bind=require('function-bind');var hasOwn=require('hasown');var $concat=bind.call($call,Array.prototype.concat);var $spliceApply=bind.call($apply,Array.prototype.splice);var $replace=bind.call($call,String.prototype.replace);var $strSlice=bind.call($call,String.prototype.slice);var $exec=bind.call($call,RegExp.prototype.exec);/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */var rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;var reEscapeChar=/\\(\\)?/g;/** Used to match backslashes in property paths. */var stringToPath=function stringToPath(string){var first=$strSlice(string,0,1);var last=$strSlice(string,-1);if(first==='%'&&last!=='%'){throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');}else if(last==='%'&&first!=='%'){throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');}var result=[];$replace(string,rePropName,function(match,number,quote,subString){result[result.length]=quote?$replace(subString,reEscapeChar,'$1'):number||match;});return result;};/* end adaptation */var getBaseIntrinsic=function getBaseIntrinsic(name,allowMissing){var intrinsicName=name;var alias;if(hasOwn(LEGACY_ALIASES,intrinsicName)){alias=LEGACY_ALIASES[intrinsicName];intrinsicName='%'+alias[0]+'%';}if(hasOwn(INTRINSICS,intrinsicName)){var value=INTRINSICS[intrinsicName];if(value===needsEval){value=doEval(intrinsicName);}if(typeof value==='undefined'&&!allowMissing){throw new $TypeError('intrinsic '+name+' exists, but is not available. Please file an issue!');}return{alias:alias,name:intrinsicName,value:value};}throw new $SyntaxError('intrinsic '+name+' does not exist!');};module.exports=function GetIntrinsic(name,allowMissing){if(typeof name!=='string'||name.length===0){throw new $TypeError('intrinsic name must be a non-empty string');}if(arguments.length>1&&typeof allowMissing!=='boolean'){throw new $TypeError('"allowMissing" argument must be a boolean');}if($exec(/^%?[^%]*%?$/,name)===null){throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');}var parts=stringToPath(name);var intrinsicBaseName=parts.length>0?parts[0]:'';var intrinsic=getBaseIntrinsic('%'+intrinsicBaseName+'%',allowMissing);var intrinsicRealName=intrinsic.name;var value=intrinsic.value;var skipFurtherCaching=false;var alias=intrinsic.alias;if(alias){intrinsicBaseName=alias[0];$spliceApply(parts,$concat([0,1],alias));}for(var i=1,isOwn=true;i<parts.length;i+=1){var part=parts[i];var first=$strSlice(part,0,1);var last=$strSlice(part,-1);if((first==='"'||first==="'"||first==='`'||last==='"'||last==="'"||last==='`')&&first!==last){throw new $SyntaxError('property names with quotes must have matching quotes');}if(part==='constructor'||!isOwn){skipFurtherCaching=true;}intrinsicBaseName+='.'+part;intrinsicRealName='%'+intrinsicBaseName+'%';if(hasOwn(INTRINSICS,intrinsicRealName)){value=INTRINSICS[intrinsicRealName];}else if(value!=null){if(!(part in value)){if(!allowMissing){throw new $TypeError('base intrinsic for '+name+' exists, but the property is not available.');}return void undefined;}if($gOPD&&i+1>=parts.length){var desc=$gOPD(value,part);isOwn=!!desc;// By convention, when a data property is converted to an accessor
|
|
2246
2247
|
// property to emulate a data property that does not suffer from
|
|
@@ -2249,10 +2250,10 @@ var errorProto=getProto(getProto(e));INTRINSICS['%Error.prototype%']=errorProto;
|
|
|
2249
2250
|
// uphold the illusion by pretending to see that original data
|
|
2250
2251
|
// property, i.e., returning the value rather than the getter
|
|
2251
2252
|
// itself.
|
|
2252
|
-
if(isOwn&&'get'in desc&&!('originalValue'in desc.get)){value=desc.get;}else{value=value[part];}}else{isOwn=hasOwn(value,part);value=value[part];}if(isOwn&&!skipFurtherCaching){INTRINSICS[intrinsicRealName]=value;}}}return value;};},{"call-bind-apply-helpers/functionApply":26,"call-bind-apply-helpers/functionCall":27,"es-define-property":
|
|
2253
|
+
if(isOwn&&'get'in desc&&!('originalValue'in desc.get)){value=desc.get;}else{value=value[part];}}else{isOwn=hasOwn(value,part);value=value[part];}if(isOwn&&!skipFurtherCaching){INTRINSICS[intrinsicRealName]=value;}}}return value;};},{"call-bind-apply-helpers/functionApply":26,"call-bind-apply-helpers/functionCall":27,"es-define-property":41,"es-errors":43,"es-errors/eval":42,"es-errors/range":44,"es-errors/ref":45,"es-errors/syntax":46,"es-errors/type":47,"es-errors/uri":48,"es-object-atoms":49,"function-bind":102,"get-proto":106,"get-proto/Object.getPrototypeOf":104,"get-proto/Reflect.getPrototypeOf":105,"gopd":108,"has-symbols":109,"hasown":111,"math-intrinsics/abs":127,"math-intrinsics/floor":128,"math-intrinsics/max":130,"math-intrinsics/min":131,"math-intrinsics/pow":132,"math-intrinsics/round":133,"math-intrinsics/sign":134}],104:[function(require,module,exports){'use strict';var $Object=require('es-object-atoms');/** @type {import('./Object.getPrototypeOf')} */module.exports=$Object.getPrototypeOf||null;},{"es-object-atoms":49}],105:[function(require,module,exports){'use strict';/** @type {import('./Reflect.getPrototypeOf')} */module.exports=typeof Reflect!=='undefined'&&Reflect.getPrototypeOf||null;},{}],106:[function(require,module,exports){'use strict';var reflectGetProto=require('./Reflect.getPrototypeOf');var originalGetProto=require('./Object.getPrototypeOf');var getDunderProto=require('dunder-proto/get');/** @type {import('.')} */module.exports=reflectGetProto?function getProto(O){// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
2253
2254
|
return reflectGetProto(O);}:originalGetProto?function getProto(O){if(!O||_typeof(O)!=='object'&&typeof O!=='function'){throw new TypeError('getProto: not an object');}// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
2254
2255
|
return originalGetProto(O);}:getDunderProto?function getProto(O){// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
2255
|
-
return getDunderProto(O);}:null;},{"./Object.getPrototypeOf":104,"./Reflect.getPrototypeOf":105,"dunder-proto/get":
|
|
2256
|
+
return getDunderProto(O);}:null;},{"./Object.getPrototypeOf":104,"./Reflect.getPrototypeOf":105,"dunder-proto/get":40}],107:[function(require,module,exports){'use strict';/** @type {import('./gOPD')} */module.exports=Object.getOwnPropertyDescriptor;},{}],108:[function(require,module,exports){'use strict';/** @type {import('.')} */var $gOPD=require('./gOPD');if($gOPD){try{$gOPD([],'length');}catch(e){// IE 8 has a broken gOPD
|
|
2256
2257
|
$gOPD=null;}}module.exports=$gOPD;},{"./gOPD":107}],109:[function(require,module,exports){'use strict';var origSymbol=typeof Symbol!=='undefined'&&Symbol;var hasSymbolSham=require('./shams');/** @type {import('.')} */module.exports=function hasNativeSymbols(){if(typeof origSymbol!=='function'){return false;}if(typeof Symbol!=='function'){return false;}if(_typeof(origSymbol('foo'))!=='symbol'){return false;}if(_typeof(Symbol('bar'))!=='symbol'){return false;}return hasSymbolSham();};},{"./shams":110}],110:[function(require,module,exports){'use strict';/** @type {import('./shams')} *//* eslint complexity: [2, 18], max-statements: [2, 33] */module.exports=function hasSymbols(){if(typeof Symbol!=='function'||typeof Object.getOwnPropertySymbols!=='function'){return false;}if(_typeof(Symbol.iterator)==='symbol'){return true;}/** @type {{ [k in symbol]?: unknown }} */var obj={};var sym=Symbol('test');var symObj=Object(sym);if(typeof sym==='string'){return false;}if(Object.prototype.toString.call(sym)!=='[object Symbol]'){return false;}if(Object.prototype.toString.call(symObj)!=='[object Symbol]'){return false;}// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
|
2257
2258
|
// if (sym instanceof Symbol) { return false; }
|
|
2258
2259
|
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
|
@@ -2295,12 +2296,12 @@ var cleanWrapCharacters=function cleanWrapCharacters(pCharacter,pString){if(pStr
|
|
|
2295
2296
|
*
|
|
2296
2297
|
* @class ManyfestHashTranslation
|
|
2297
2298
|
*/var ManyfestHashTranslation=/*#__PURE__*/function(){function ManyfestHashTranslation(pInfoLog,pErrorLog){_classCallCheck2(this,ManyfestHashTranslation);// Wire in logging
|
|
2298
|
-
this.logInfo=typeof pInfoLog==='function'?pInfoLog:libSimpleLog;this.logError=typeof pErrorLog==='function'?pErrorLog:libSimpleLog;this.translationTable={};}return _createClass2(ManyfestHashTranslation,[{key:"translationCount",value:function translationCount(){return Object.keys(this.translationTable).length;}},{key:"addTranslation",value:function addTranslation(pTranslation){var
|
|
2299
|
+
this.logInfo=typeof pInfoLog==='function'?pInfoLog:libSimpleLog;this.logError=typeof pErrorLog==='function'?pErrorLog:libSimpleLog;this.translationTable={};}return _createClass2(ManyfestHashTranslation,[{key:"translationCount",value:function translationCount(){return Object.keys(this.translationTable).length;}},{key:"addTranslation",value:function addTranslation(pTranslation){var _this48=this;// This adds a translation in the form of:
|
|
2299
2300
|
// { "SourceHash": "DestinationHash", "SecondSourceHash":"SecondDestinationHash" }
|
|
2300
|
-
if(_typeof(pTranslation)!='object'){this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(_typeof(pTranslation)));return false;}var tmpTranslationSources=Object.keys(pTranslation);tmpTranslationSources.forEach(function(pTranslationSource){if(typeof pTranslation[pTranslationSource]!='string'){
|
|
2301
|
+
if(_typeof(pTranslation)!='object'){this.logError("Hash translation addTranslation expected a translation be type object but was passed in ".concat(_typeof(pTranslation)));return false;}var tmpTranslationSources=Object.keys(pTranslation);tmpTranslationSources.forEach(function(pTranslationSource){if(typeof pTranslation[pTranslationSource]!='string'){_this48.logError("Hash translation addTranslation expected a translation destination hash for [".concat(pTranslationSource,"] to be a string but the referrant was a ").concat(_typeof(pTranslation[pTranslationSource])));}else{_this48.translationTable[pTranslationSource]=pTranslation[pTranslationSource];}});}},{key:"removeTranslationHash",value:function removeTranslationHash(pTranslationHash){if(pTranslationHash in this.translationTable){delete this.translationTable[pTranslationHash];}}// This removes translations.
|
|
2301
2302
|
// If passed a string, just removes the single one.
|
|
2302
2303
|
// If passed an object, it does all the source keys.
|
|
2303
|
-
},{key:"removeTranslation",value:function removeTranslation(pTranslation){var
|
|
2304
|
+
},{key:"removeTranslation",value:function removeTranslation(pTranslation){var _this49=this;if(typeof pTranslation=='string'){this.removeTranslationHash(pTranslation);return true;}else if(_typeof(pTranslation)=='object'){var tmpTranslationSources=Object.keys(pTranslation);tmpTranslationSources.forEach(function(pTranslationSource){_this49.removeTranslation(pTranslationSource);});return true;}else{this.logError("Hash translation removeTranslation expected either a string or an object but the passed-in translation was type ".concat(_typeof(pTranslation)));return false;}}},{key:"clearTranslations",value:function clearTranslations(){this.translationTable={};}},{key:"translate",value:function translate(pTranslation){if(pTranslation in this.translationTable){return this.translationTable[pTranslation];}else{return pTranslation;}}}]);}();module.exports=ManyfestHashTranslation;},{"./Manyfest-LogToConsole.js":117}],117:[function(require,module,exports){/**
|
|
2304
2305
|
* @author <steven@velozo.com>
|
|
2305
2306
|
*//**
|
|
2306
2307
|
* Manyfest simple logging shim (for browser and dependency-free running)
|
|
@@ -2562,13 +2563,13 @@ else if(_tmpBracketStartIndex2>0// 2) The end bracket is after the start brac
|
|
|
2562
2563
|
return false;}// We need to enumerate the array and grab the addresses from there.
|
|
2563
2564
|
var tmpArrayProperty=pObject[_tmpBoxedPropertyName4];// Managing the parent address is a bit more complex here -- the box will be added for each element.
|
|
2564
2565
|
tmpParentAddress="".concat(tmpParentAddress).concat(tmpParentAddress.length>0?'.':'').concat(_tmpBoxedPropertyName4);// The container object is where we have the "Address":SOMEVALUE pairs
|
|
2565
|
-
var tmpContainerObject={};for(var
|
|
2566
|
+
var tmpContainerObject={};for(var _i25=0;_i25<tmpArrayProperty.length;_i25++){var tmpPropertyParentAddress="".concat(tmpParentAddress,"[").concat(_i25,"]");var tmpValue=this.deleteValueAtAddress(pObject[_tmpBoxedPropertyName4][_i25],tmpNewAddress,tmpPropertyParentAddress);tmpContainerObject["".concat(tmpPropertyParentAddress,".").concat(tmpNewAddress)]=tmpValue;}return tmpContainerObject;}// OBJECT SET
|
|
2566
2567
|
// Note this will not work with a bracket in the same address box set
|
|
2567
2568
|
var _tmpObjectTypeMarkerIndex=pAddress.indexOf('{}');if(_tmpObjectTypeMarkerIndex>0){var _tmpObjectPropertyName=pAddress.substring(0,_tmpObjectTypeMarkerIndex).trim();if(_typeof(pObject[_tmpObjectPropertyName])!='object'){// We asked for a set from an array but it isnt' an array.
|
|
2568
2569
|
return false;}// We need to enumerate the Object and grab the addresses from there.
|
|
2569
2570
|
var tmpObjectProperty=pObject[_tmpObjectPropertyName];var tmpObjectPropertyKeys=Object.keys(tmpObjectProperty);// Managing the parent address is a bit more complex here -- the box will be added for each element.
|
|
2570
2571
|
tmpParentAddress="".concat(tmpParentAddress).concat(tmpParentAddress.length>0?'.':'').concat(_tmpObjectPropertyName);// The container object is where we have the "Address":SOMEVALUE pairs
|
|
2571
|
-
var _tmpContainerObject={};for(var
|
|
2572
|
+
var _tmpContainerObject={};for(var _i26=0;_i26<tmpObjectPropertyKeys.length;_i26++){var _tmpPropertyParentAddress="".concat(tmpParentAddress,".").concat(tmpObjectPropertyKeys[_i26]);var _tmpValue3=this.deleteValueAtAddress(pObject[_tmpObjectPropertyName][tmpObjectPropertyKeys[_i26]],tmpNewAddress,_tmpPropertyParentAddress);// The filtering is complex but allows config-based metaprogramming directly from schema
|
|
2572
2573
|
var _tmpKeepRecord=this.checkRecordFilters(pAddress,_tmpValue3);if(_tmpKeepRecord){_tmpContainerObject["".concat(_tmpPropertyParentAddress,".").concat(tmpNewAddress)]=_tmpValue3;}}return _tmpContainerObject;}// If there is an object property already named for the sub object, but it isn't an object
|
|
2573
2574
|
// then the system can't set the value in there. Error and abort!
|
|
2574
2575
|
if(tmpSubObjectName in pObject&&_typeof(pObject[tmpSubObjectName])!=='object'){return undefined;}else if(tmpSubObjectName in pObject){// If there is already a subobject pass that to the recursive thingy
|
|
@@ -2639,11 +2640,11 @@ var tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.Data
|
|
|
2639
2640
|
if(tmpFunctionAddress in pObject){try{return pObject[tmpFunctionAddress].apply(pObject);}catch(pError){// The function call failed, so the address doesn't exist
|
|
2640
2641
|
console.log("Error in getValueAtAddress calling function ".concat(tmpFunctionAddress," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
2641
2642
|
console.log("Function ".concat(tmpFunctionAddress," does not exist (address [").concat(pAddress,"])"));return false;}}else{var tmpArgumentValues=[];var _tmpRootObject2=typeof pRootObject=='undefined'?pObject:pRootObject;// Now get the value for each argument
|
|
2642
|
-
for(var
|
|
2643
|
+
for(var _i27=0;_i27<tmpFunctionArguments.length;_i27++){// Resolve the values for each subsequent entry
|
|
2643
2644
|
// Check if the argument value is a string literal or a reference to an address
|
|
2644
|
-
if(tmpFunctionArguments[
|
|
2645
|
-
tmpArgumentValues.push(tmpFunctionArguments[
|
|
2646
|
-
tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject2,tmpFunctionArguments[
|
|
2645
|
+
if(tmpFunctionArguments[_i27].length>=2&&(tmpFunctionArguments[_i27].charAt(0)=='"'||tmpFunctionArguments[_i27].charAt(0)=="'"||tmpFunctionArguments[_i27].charAt(0)=="`")&&(tmpFunctionArguments[_i27].charAt(tmpFunctionArguments[_i27].length-1)=='"'||tmpFunctionArguments[_i27].charAt(tmpFunctionArguments[_i27].length-1)=="'"||tmpFunctionArguments[_i27].charAt(tmpFunctionArguments[_i27].length-1)=="`")){// This is a string literal
|
|
2646
|
+
tmpArgumentValues.push(tmpFunctionArguments[_i27].substring(1,tmpFunctionArguments[_i27].length-1));}else{// This is a hash address
|
|
2647
|
+
tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject2,tmpFunctionArguments[_i27]));}}if(tmpFunctionAddress in pObject){try{return pObject[tmpFunctionAddress].apply(pObject,tmpArgumentValues);}catch(pError){// The function call failed, so the address doesn't exist
|
|
2647
2648
|
console.log("Error in getValueAtAddress calling function ".concat(tmpFunctionAddress," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
2648
2649
|
console.log("Function ".concat(tmpFunctionAddress," does not exist (address [").concat(pAddress,"])"));return false;}}}// Boxed elements look like this:
|
|
2649
2650
|
// MyValues[10]
|
|
@@ -2676,8 +2677,8 @@ return pObject[tmpBoxedPropertyName][tmpBoxedPropertyReference];}else{return pOb
|
|
|
2676
2677
|
else if(tmpBracketStartIndex>0// 2) The end bracket is after the start bracket
|
|
2677
2678
|
&&tmpBracketStopIndex>tmpBracketStartIndex// 3) There is nothing in the brackets
|
|
2678
2679
|
&&tmpBracketStopIndex-tmpBracketStartIndex==1){var _tmpBoxedPropertyName5=pAddress.substring(0,tmpBracketStartIndex).trim();if(!Array.isArray(pObject[_tmpBoxedPropertyName5])){// We asked for a set from an array but it isnt' an array.
|
|
2679
|
-
return false;}var tmpInputArray=pObject[_tmpBoxedPropertyName5];var tmpOutputArray=[];for(var
|
|
2680
|
-
var tmpKeepRecord=this.checkRecordFilters(pAddress,tmpInputArray[
|
|
2680
|
+
return false;}var tmpInputArray=pObject[_tmpBoxedPropertyName5];var tmpOutputArray=[];for(var _i28=0;_i28<tmpInputArray.length;_i28++){// The filtering is complex but allows config-based metaprogramming directly from schema
|
|
2681
|
+
var tmpKeepRecord=this.checkRecordFilters(pAddress,tmpInputArray[_i28]);if(tmpKeepRecord){tmpOutputArray.push(tmpInputArray[_i28]);}}return tmpOutputArray;}// The object has been flagged as an object set, so treat it as such
|
|
2681
2682
|
else if(tmpObjectTypeMarkerIndex>0){var tmpObjectPropertyName=pAddress.substring(0,tmpObjectTypeMarkerIndex).trim();if(_typeof(pObject[tmpObjectPropertyName])!='object'){// We asked for a set from an array but it isnt' an array.
|
|
2682
2683
|
return false;}return pObject[tmpObjectPropertyName];}else{// Now is the point in recursion to return the value in the address
|
|
2683
2684
|
if(_typeof(pObject[pAddress])!=null){return pObject[pAddress];}else{return null;}}}else{//let tmpSubObjectName = pAddress.substring(0, tmpSeparatorIndex);
|
|
@@ -2706,11 +2707,11 @@ var _tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.Dat
|
|
|
2706
2707
|
if(_tmpFunctionAddress2 in pObject){try{return this.getValueAtAddress(pObject[_tmpFunctionAddress2].apply(pObject),tmpNewAddress,tmpParentAddress,tmpRootObject);}catch(pError){// The function call failed, so the address doesn't exist
|
|
2707
2708
|
console.log("Error in getValueAtAddress calling function ".concat(_tmpFunctionAddress2," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
2708
2709
|
console.log("Function ".concat(_tmpFunctionAddress2," does not exist (address [").concat(pAddress,"])"));return false;}}else{var _tmpArgumentValues=[];var _tmpRootObject3=typeof pRootObject=='undefined'?pObject:pRootObject;// Now get the value for each argument
|
|
2709
|
-
for(var
|
|
2710
|
+
for(var _i29=0;_i29<_tmpFunctionArguments.length;_i29++){// Resolve the values for each subsequent entry
|
|
2710
2711
|
// Check if the argument value is a string literal or a reference to an address
|
|
2711
|
-
if(_tmpFunctionArguments[
|
|
2712
|
-
_tmpArgumentValues.push(_tmpFunctionArguments[
|
|
2713
|
-
_tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject3,_tmpFunctionArguments[
|
|
2712
|
+
if(_tmpFunctionArguments[_i29].length>=2&&(_tmpFunctionArguments[_i29].charAt(0)=='"'||_tmpFunctionArguments[_i29].charAt(0)=="'"||_tmpFunctionArguments[_i29].charAt(0)=="`")&&(_tmpFunctionArguments[_i29].charAt(_tmpFunctionArguments[_i29].length-1)=='"'||_tmpFunctionArguments[_i29].charAt(_tmpFunctionArguments[_i29].length-1)=="'"||_tmpFunctionArguments[_i29].charAt(_tmpFunctionArguments[_i29].length-1)=="`")){// This is a string literal
|
|
2713
|
+
_tmpArgumentValues.push(_tmpFunctionArguments[_i29].substring(1,_tmpFunctionArguments[_i29].length-1));}else{// This is a hash address
|
|
2714
|
+
_tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject3,_tmpFunctionArguments[_i29]));}}if(_tmpFunctionAddress2 in pObject){try{return this.getValueAtAddress(pObject[_tmpFunctionAddress2].apply(pObject,_tmpArgumentValues),tmpNewAddress,tmpParentAddress,_tmpRootObject3);}catch(pError){// The function call failed, so the address doesn't exist
|
|
2714
2715
|
console.log("Error in getValueAtAddress calling function ".concat(_tmpFunctionAddress2," (address [").concat(pAddress,"]): ").concat(pError.message));return false;}}else{// The function doesn't exist, so the address doesn't exist
|
|
2715
2716
|
console.log("Function ".concat(_tmpFunctionAddress2," does not exist (address [").concat(pAddress,"])"));return false;}}}// Boxed elements look like this:
|
|
2716
2717
|
// MyValues[42]
|
|
@@ -2754,13 +2755,13 @@ else if(_tmpBracketStartIndex3>0// 2) The end bracket is after the start brac
|
|
|
2754
2755
|
return false;}// We need to enumerate the array and grab the addresses from there.
|
|
2755
2756
|
var tmpArrayProperty=pObject[_tmpBoxedPropertyName7];// Managing the parent address is a bit more complex here -- the box will be added for each element.
|
|
2756
2757
|
tmpParentAddress="".concat(tmpParentAddress).concat(tmpParentAddress.length>0?'.':'').concat(_tmpBoxedPropertyName7);// The container object is where we have the "Address":SOMEVALUE pairs
|
|
2757
|
-
var tmpContainerObject={};for(var
|
|
2758
|
+
var tmpContainerObject={};for(var _i30=0;_i30<tmpArrayProperty.length;_i30++){var tmpPropertyParentAddress="".concat(tmpParentAddress,"[").concat(_i30,"]");var tmpValue=this.getValueAtAddress(pObject[_tmpBoxedPropertyName7][_i30],tmpNewAddress,tmpPropertyParentAddress,tmpRootObject);tmpContainerObject["".concat(tmpPropertyParentAddress,".").concat(tmpNewAddress)]=tmpValue;}return tmpContainerObject;}// OBJECT SET
|
|
2758
2759
|
// Note this will not work with a bracket in the same address box set
|
|
2759
2760
|
var _tmpObjectTypeMarkerIndex2=pAddress.indexOf('{}');if(_tmpObjectTypeMarkerIndex2>0){var _tmpObjectPropertyName2=pAddress.substring(0,_tmpObjectTypeMarkerIndex2).trim();if(_typeof(pObject[_tmpObjectPropertyName2])!='object'){// We asked for a set from an array but it isnt' an array.
|
|
2760
2761
|
return false;}// We need to enumerate the Object and grab the addresses from there.
|
|
2761
2762
|
var tmpObjectProperty=pObject[_tmpObjectPropertyName2];var tmpObjectPropertyKeys=Object.keys(tmpObjectProperty);// Managing the parent address is a bit more complex here -- the box will be added for each element.
|
|
2762
2763
|
tmpParentAddress="".concat(tmpParentAddress).concat(tmpParentAddress.length>0?'.':'').concat(_tmpObjectPropertyName2);// The container object is where we have the "Address":SOMEVALUE pairs
|
|
2763
|
-
var _tmpContainerObject2={};for(var
|
|
2764
|
+
var _tmpContainerObject2={};for(var _i31=0;_i31<tmpObjectPropertyKeys.length;_i31++){var _tmpPropertyParentAddress2="".concat(tmpParentAddress,".").concat(tmpObjectPropertyKeys[_i31]);var _tmpValue4=this.getValueAtAddress(pObject[_tmpObjectPropertyName2][tmpObjectPropertyKeys[_i31]],tmpNewAddress,_tmpPropertyParentAddress2,tmpRootObject);// The filtering is complex but allows config-based metaprogramming directly from schema
|
|
2764
2765
|
var _tmpKeepRecord2=this.checkRecordFilters(pAddress,_tmpValue4);if(_tmpKeepRecord2){_tmpContainerObject2["".concat(_tmpPropertyParentAddress2,".").concat(tmpNewAddress)]=_tmpValue4;}}return _tmpContainerObject2;}// If there is an object property already named for the sub object, but it isn't an object
|
|
2765
2766
|
// then the system can't set the value in there. Error and abort!
|
|
2766
2767
|
if(tmpSubObjectName in pObject&&_typeof(pObject[tmpSubObjectName])!=='object'){return undefined;}else if(tmpSubObjectName in pObject){// If there is already a subobject pass that to the recursive thingy
|
|
@@ -2970,7 +2971,7 @@ this.logInfo=typeof pInfoLog=='function'?pInfoLog:libSimpleLog;this.logError=typ
|
|
|
2970
2971
|
// This will return a mega set of key:value pairs with all possible schema
|
|
2971
2972
|
// permutations and default values (when not an object) and everything else.
|
|
2972
2973
|
return _createClass2(ManyfestObjectAddressGeneration,[{key:"generateAddressses",value:function generateAddressses(pObject,pBaseAddress,pSchema){var tmpBaseAddress=typeof pBaseAddress=='string'?pBaseAddress:'';var tmpSchema=_typeof(pSchema)=='object'?pSchema:{};var tmpObjectType=_typeof(pObject);var tmpSchemaObjectEntry={Address:tmpBaseAddress,Hash:tmpBaseAddress,Name:tmpBaseAddress,// This is so scripts and UI controls can force a developer to opt-in.
|
|
2973
|
-
InSchema:false};if(tmpObjectType=='object'&&pObject==null){tmpObjectType='null';}switch(tmpObjectType){case'string':tmpSchemaObjectEntry.DataType='String';tmpSchemaObjectEntry.Default=pObject;tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;break;case'number':case'bigint':tmpSchemaObjectEntry.DataType='Number';tmpSchemaObjectEntry.Default=pObject;tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;break;case'undefined':case'null':tmpSchemaObjectEntry.DataType='Any';tmpSchemaObjectEntry.Default=pObject;tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;break;case'object':if(Array.isArray(pObject)){tmpSchemaObjectEntry.DataType='Array';if(tmpBaseAddress!=''){tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;}for(var i=0;i<pObject.length;i++){this.generateAddressses(pObject[i],"".concat(tmpBaseAddress,"[").concat(i,"]"),tmpSchema);}}else{tmpSchemaObjectEntry.DataType='Object';if(tmpBaseAddress!=''){tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;tmpBaseAddress+='.';}var tmpObjectProperties=Object.keys(pObject);for(var
|
|
2974
|
+
InSchema:false};if(tmpObjectType=='object'&&pObject==null){tmpObjectType='null';}switch(tmpObjectType){case'string':tmpSchemaObjectEntry.DataType='String';tmpSchemaObjectEntry.Default=pObject;tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;break;case'number':case'bigint':tmpSchemaObjectEntry.DataType='Number';tmpSchemaObjectEntry.Default=pObject;tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;break;case'undefined':case'null':tmpSchemaObjectEntry.DataType='Any';tmpSchemaObjectEntry.Default=pObject;tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;break;case'object':if(Array.isArray(pObject)){tmpSchemaObjectEntry.DataType='Array';if(tmpBaseAddress!=''){tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;}for(var i=0;i<pObject.length;i++){this.generateAddressses(pObject[i],"".concat(tmpBaseAddress,"[").concat(i,"]"),tmpSchema);}}else{tmpSchemaObjectEntry.DataType='Object';if(tmpBaseAddress!=''){tmpSchema[tmpBaseAddress]=tmpSchemaObjectEntry;tmpBaseAddress+='.';}var tmpObjectProperties=Object.keys(pObject);for(var _i32=0;_i32<tmpObjectProperties.length;_i32++){this.generateAddressses(pObject[tmpObjectProperties[_i32]],"".concat(tmpBaseAddress).concat(tmpObjectProperties[_i32]),tmpSchema);}}break;case'symbol':case'function':// Symbols and functions neither recurse nor get added to the schema
|
|
2974
2975
|
break;}return tmpSchema;}}]);}();;module.exports=ManyfestObjectAddressGeneration;},{"./Manyfest-LogToConsole.js":117}],124:[function(require,module,exports){// Given a string, parse out any conditional expressions and set whether or not to keep the record.
|
|
2975
2976
|
//
|
|
2976
2977
|
// For instance:
|
|
@@ -3044,17 +3045,17 @@ var tmpDescriptorAddresses=Object.keys(tmpSource);tmpDescriptorAddresses.forEach
|
|
|
3044
3045
|
* Manyfest object address-based descriptions and manipulations.
|
|
3045
3046
|
*
|
|
3046
3047
|
* @class Manyfest
|
|
3047
|
-
*/var Manyfest=/*#__PURE__*/function(
|
|
3048
|
-
|
|
3049
|
-
|
|
3048
|
+
*/var Manyfest=/*#__PURE__*/function(_libFableServiceProvi10){function Manyfest(pFable,pManifest,pServiceHash){var _this50;_classCallCheck2(this,Manyfest);if(pFable===undefined){_this50=_callSuper(this,Manyfest,[{}]);}else{_this50=_callSuper(this,Manyfest,[pFable,pManifest,pServiceHash]);}_this50.serviceType='Manifest';// Wire in logging
|
|
3049
|
+
_this50.logInfo=libSimpleLog;_this50.logError=libSimpleLog;// Create an object address resolver and map in the functions
|
|
3050
|
+
_this50.objectAddressCheckAddressExists=new libObjectAddressCheckAddressExists(_this50.logInfo,_this50.logError);_this50.objectAddressGetValue=new libObjectAddressGetValue(_this50.logInfo,_this50.logError);_this50.objectAddressSetValue=new libObjectAddressSetValue(_this50.logInfo,_this50.logError);_this50.objectAddressDeleteValue=new libObjectAddressDeleteValue(_this50.logInfo,_this50.logError);if(!('defaultValues'in _this50.options)){_this50.options.defaultValues={"String":"","Number":0,"Float":0.0,"Integer":0,"PreciseNumber":"0.0","Boolean":false,"Binary":0,"DateTime":0,"Array":[],"Object":{},"Null":null};}if(!('strict'in _this50.options)){_this50.options.strict=false;}_this50.scope=undefined;_this50.elementAddresses=undefined;_this50.elementHashes=undefined;_this50.elementDescriptors=undefined;_this50.reset();if(_typeof(_this50.options)==='object'){_this50.loadManifest(_this50.options);}_this50.schemaManipulations=new libSchemaManipulation(_this50.logInfo,_this50.logError);_this50.objectAddressGeneration=new libObjectAddressGeneration(_this50.logInfo,_this50.logError);_this50.hashTranslations=new libHashTranslation(_this50.logInfo,_this50.logError);_this50.numberRegex=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;return _assertThisInitialized(_this50);}/*************************************************************************
|
|
3050
3051
|
* Schema Manifest Loading, Reading, Manipulation and Serialization Functions
|
|
3051
3052
|
*/// Reset critical manifest properties
|
|
3052
|
-
_inherits(Manyfest,
|
|
3053
|
+
_inherits(Manyfest,_libFableServiceProvi10);return _createClass2(Manyfest,[{key:"reset",value:function reset(){this.scope='DEFAULT';this.elementAddresses=[];this.elementHashes={};this.elementDescriptors={};}},{key:"clone",value:function clone(){// Make a copy of the options in-place
|
|
3053
3054
|
var tmpNewOptions=JSON.parse(JSON.stringify(this.options));var tmpNewManyfest=new Manyfest(this.getManifest(),this.logInfo,this.logError,tmpNewOptions);// Import the hash translations
|
|
3054
3055
|
tmpNewManyfest.hashTranslations.addTranslation(this.hashTranslations.translationTable);return tmpNewManyfest;}// Deserialize a Manifest from a string
|
|
3055
3056
|
},{key:"deserialize",value:function deserialize(pManifestString){// TODO: Add guards for bad manifest string
|
|
3056
3057
|
return this.loadManifest(JSON.parse(pManifestString));}// Load a manifest from an object
|
|
3057
|
-
},{key:"loadManifest",value:function loadManifest(pManifest){if(_typeof(pManifest)!=='object'){this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(_typeof(pManifest),"."));}var tmpManifest=_typeof(pManifest)=='object'?pManifest:{};var tmpDescriptorKeys=Object.keys(_DefaultConfiguration);for(var i=0;i<tmpDescriptorKeys.length;i++){if(!(tmpDescriptorKeys[i]in tmpManifest)){tmpManifest[tmpDescriptorKeys[i]]=JSON.parse(JSON.stringify(_DefaultConfiguration[tmpDescriptorKeys[i]]));}}if('Scope'in tmpManifest){if(typeof tmpManifest.Scope==='string'){this.scope=tmpManifest.Scope;}else{this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(_typeof(tmpManifest.Scope),"."),tmpManifest);}}else{this.logError("(".concat(this.scope,") Error loading scope from manifest object. Property \"Scope\" does not exist in the root of the object."),tmpManifest);}if('Descriptors'in tmpManifest){if(_typeof(tmpManifest.Descriptors)==='object'){var tmpDescriptionAddresses=Object.keys(tmpManifest.Descriptors);for(var
|
|
3058
|
+
},{key:"loadManifest",value:function loadManifest(pManifest){if(_typeof(pManifest)!=='object'){this.logError("(".concat(this.scope,") Error loading manifest; expecting an object but parameter was type ").concat(_typeof(pManifest),"."));}var tmpManifest=_typeof(pManifest)=='object'?pManifest:{};var tmpDescriptorKeys=Object.keys(_DefaultConfiguration);for(var i=0;i<tmpDescriptorKeys.length;i++){if(!(tmpDescriptorKeys[i]in tmpManifest)){tmpManifest[tmpDescriptorKeys[i]]=JSON.parse(JSON.stringify(_DefaultConfiguration[tmpDescriptorKeys[i]]));}}if('Scope'in tmpManifest){if(typeof tmpManifest.Scope==='string'){this.scope=tmpManifest.Scope;}else{this.logError("(".concat(this.scope,") Error loading scope from manifest; expecting a string but property was type ").concat(_typeof(tmpManifest.Scope),"."),tmpManifest);}}else{this.logError("(".concat(this.scope,") Error loading scope from manifest object. Property \"Scope\" does not exist in the root of the object."),tmpManifest);}if('Descriptors'in tmpManifest){if(_typeof(tmpManifest.Descriptors)==='object'){var tmpDescriptionAddresses=Object.keys(tmpManifest.Descriptors);for(var _i33=0;_i33<tmpDescriptionAddresses.length;_i33++){this.addDescriptor(tmpDescriptionAddresses[_i33],tmpManifest.Descriptors[tmpDescriptionAddresses[_i33]]);}}else{this.logError("(".concat(this.scope,") Error loading description object from manifest object. Expecting an object in 'Manifest.Descriptors' but the property was type ").concat(_typeof(tmpManifest.Descriptors),"."),tmpManifest);}}else{this.logError("(".concat(this.scope,") Error loading object description from manifest object. Property \"Descriptors\" does not exist in the root of the Manifest object."),tmpManifest);}if('HashTranslations'in tmpManifest){if(_typeof(tmpManifest.HashTranslations)==='object'){for(var _i34=0;_i34<tmpManifest.HashTranslations.length;_i34++){// Each translation is
|
|
3058
3059
|
}}}}// Serialize the Manifest to a string
|
|
3059
3060
|
},{key:"serialize",value:function serialize(){return JSON.stringify(this.getManifest());}},{key:"getManifest",value:function getManifest(){return{Scope:this.scope,Descriptors:JSON.parse(JSON.stringify(this.elementDescriptors)),HashTranslations:JSON.parse(JSON.stringify(this.hashTranslations.translationTable))};}// Add a descriptor to the manifest
|
|
3060
3061
|
},{key:"addDescriptor",value:function addDescriptor(pAddress,pDescriptor){if(_typeof(pDescriptor)==='object'){// Add the Address into the Descriptor if it doesn't exist:
|
|
@@ -3097,19 +3098,19 @@ return null;}}}// Enumerate through the schema and populate default values if th
|
|
|
3097
3098
|
},{key:"populateDefaults",value:function populateDefaults(pObject,pOverwriteProperties){return this.populateObject(pObject,pOverwriteProperties,// This just sets up a simple filter to see if there is a default set.
|
|
3098
3099
|
function(pDescriptor){return'Default'in pDescriptor;});}// Forcefully populate all values even if they don't have defaults.
|
|
3099
3100
|
// Based on type, this can do unexpected things.
|
|
3100
|
-
},{key:"populateObject",value:function populateObject(pObject,pOverwriteProperties,fFilter){var
|
|
3101
|
+
},{key:"populateObject",value:function populateObject(pObject,pOverwriteProperties,fFilter){var _this51=this;// Automatically create an object if one isn't passed in.
|
|
3101
3102
|
var tmpObject=_typeof(pObject)==='object'?pObject:{};// Default to *NOT OVERWRITING* properties
|
|
3102
3103
|
var tmpOverwriteProperties=typeof pOverwriteProperties=='undefined'?false:pOverwriteProperties;// This is a filter function, which is passed the schema and allows complex filtering of population
|
|
3103
3104
|
// The default filter function just returns true, populating everything.
|
|
3104
|
-
var tmpFilterFunction=typeof fFilter=='function'?fFilter:function(pDescriptor){return true;};this.elementAddresses.forEach(function(pAddress){var tmpDescriptor=
|
|
3105
|
+
var tmpFilterFunction=typeof fFilter=='function'?fFilter:function(pDescriptor){return true;};this.elementAddresses.forEach(function(pAddress){var tmpDescriptor=_this51.getDescriptor(pAddress);// Check the filter function to see if this is an address we want to set the value for.
|
|
3105
3106
|
if(tmpFilterFunction(tmpDescriptor)){// If we are overwriting properties OR the property does not exist
|
|
3106
|
-
if(tmpOverwriteProperties||!
|
|
3107
|
+
if(tmpOverwriteProperties||!_this51.checkAddressExists(tmpObject,pAddress)){_this51.setValueAtAddress(tmpObject,pAddress,_this51.getDefaultValue(tmpDescriptor));}}});return tmpObject;}}]);}(libFableServiceProviderBase);;module.exports=Manyfest;},{"./Manyfest-HashTranslation.js":116,"./Manyfest-LogToConsole.js":117,"./Manyfest-ObjectAddress-CheckAddressExists.js":118,"./Manyfest-ObjectAddress-DeleteValue.js":119,"./Manyfest-ObjectAddress-GetValue.js":120,"./Manyfest-ObjectAddress-SetValue.js":122,"./Manyfest-ObjectAddressGeneration.js":123,"./Manyfest-SchemaManipulation.js":125,"fable-serviceproviderbase":59}],127:[function(require,module,exports){'use strict';/** @type {import('./abs')} */module.exports=Math.abs;},{}],128:[function(require,module,exports){'use strict';/** @type {import('./floor')} */module.exports=Math.floor;},{}],129:[function(require,module,exports){'use strict';/** @type {import('./isNaN')} */module.exports=Number.isNaN||function isNaN(a){return a!==a;};},{}],130:[function(require,module,exports){'use strict';/** @type {import('./max')} */module.exports=Math.max;},{}],131:[function(require,module,exports){'use strict';/** @type {import('./min')} */module.exports=Math.min;},{}],132:[function(require,module,exports){'use strict';/** @type {import('./pow')} */module.exports=Math.pow;},{}],133:[function(require,module,exports){'use strict';/** @type {import('./round')} */module.exports=Math.round;},{}],134:[function(require,module,exports){'use strict';var $isNaN=require('./isNaN');/** @type {import('./sign')} */module.exports=function sign(number){if($isNaN(number)||number===0){return number;}return number<0?-1:+1;};},{"./isNaN":129}],135:[function(require,module,exports){(function(global){(function(){var hasMap=typeof Map==='function'&&Map.prototype;var mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,'size'):null;var mapSize=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get==='function'?mapSizeDescriptor.get:null;var mapForEach=hasMap&&Map.prototype.forEach;var hasSet=typeof Set==='function'&&Set.prototype;var setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,'size'):null;var setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get==='function'?setSizeDescriptor.get:null;var setForEach=hasSet&&Set.prototype.forEach;var hasWeakMap=typeof WeakMap==='function'&&WeakMap.prototype;var weakMapHas=hasWeakMap?WeakMap.prototype.has:null;var hasWeakSet=typeof WeakSet==='function'&&WeakSet.prototype;var weakSetHas=hasWeakSet?WeakSet.prototype.has:null;var hasWeakRef=typeof WeakRef==='function'&&WeakRef.prototype;var weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null;var booleanValueOf=Boolean.prototype.valueOf;var objectToString=Object.prototype.toString;var functionToString=Function.prototype.toString;var $match=String.prototype.match;var $slice=String.prototype.slice;var $replace=String.prototype.replace;var $toUpperCase=String.prototype.toUpperCase;var $toLowerCase=String.prototype.toLowerCase;var $test=RegExp.prototype.test;var $concat=Array.prototype.concat;var $join=Array.prototype.join;var $arrSlice=Array.prototype.slice;var $floor=Math.floor;var bigIntValueOf=typeof BigInt==='function'?BigInt.prototype.valueOf:null;var gOPS=Object.getOwnPropertySymbols;var symToString=typeof Symbol==='function'&&_typeof(Symbol.iterator)==='symbol'?Symbol.prototype.toString:null;var hasShammedSymbols=typeof Symbol==='function'&&_typeof(Symbol.iterator)==='object';// ie, `has-tostringtag/shams
|
|
3107
3108
|
var toStringTag=typeof Symbol==='function'&&Symbol.toStringTag&&(_typeof(Symbol.toStringTag)===hasShammedSymbols?'object':'symbol')?Symbol.toStringTag:null;var isEnumerable=Object.prototype.propertyIsEnumerable;var gPO=(typeof Reflect==='function'?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype// eslint-disable-line no-proto
|
|
3108
3109
|
?function(O){return O.__proto__;// eslint-disable-line no-proto
|
|
3109
3110
|
}:null);function addNumericSeparator(num,str){if(num===Infinity||num===-Infinity||num!==num||num&&num>-1000&&num<1000||$test.call(/e/,str)){return str;}var sepRegex=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof num==='number'){var _int=num<0?-$floor(-num):$floor(num);// trunc(num)
|
|
3110
3111
|
if(_int!==num){var intStr=String(_int);var dec=$slice.call(str,intStr.length+1);return $replace.call(intStr,sepRegex,'$&_')+'.'+$replace.call($replace.call(dec,/([0-9]{3})/g,'$&_'),/_$/,'');}}return $replace.call(str,sepRegex,'$&_');}var utilInspect=require('./util.inspect');var inspectCustom=utilInspect.custom;var inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null;var quotes={__proto__:null,'double':'"',single:"'"};var quoteREs={__proto__:null,'double':/(["\\])/g,single:/(['\\])/g};module.exports=function inspect_(obj,options,depth,seen){var opts=options||{};if(has(opts,'quoteStyle')&&!has(quotes,opts.quoteStyle)){throw new TypeError('option "quoteStyle" must be "single" or "double"');}if(has(opts,'maxStringLength')&&(typeof opts.maxStringLength==='number'?opts.maxStringLength<0&&opts.maxStringLength!==Infinity:opts.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');}var customInspect=has(opts,'customInspect')?opts.customInspect:true;if(typeof customInspect!=='boolean'&&customInspect!=='symbol'){throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');}if(has(opts,'indent')&&opts.indent!==null&&opts.indent!=='\t'&&!(parseInt(opts.indent,10)===opts.indent&&opts.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');}if(has(opts,'numericSeparator')&&typeof opts.numericSeparator!=='boolean'){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');}var numericSeparator=opts.numericSeparator;if(typeof obj==='undefined'){return'undefined';}if(obj===null){return'null';}if(typeof obj==='boolean'){return obj?'true':'false';}if(typeof obj==='string'){return inspectString(obj,opts);}if(typeof obj==='number'){if(obj===0){return Infinity/obj>0?'0':'-0';}var str=String(obj);return numericSeparator?addNumericSeparator(obj,str):str;}if(typeof obj==='bigint'){var bigIntStr=String(obj)+'n';return numericSeparator?addNumericSeparator(obj,bigIntStr):bigIntStr;}var maxDepth=typeof opts.depth==='undefined'?5:opts.depth;if(typeof depth==='undefined'){depth=0;}if(depth>=maxDepth&&maxDepth>0&&_typeof(obj)==='object'){return isArray(obj)?'[Array]':'[Object]';}var indent=getIndent(opts,depth);if(typeof seen==='undefined'){seen=[];}else if(indexOf(seen,obj)>=0){return'[Circular]';}function inspect(value,from,noIndent){if(from){seen=$arrSlice.call(seen);seen.push(from);}if(noIndent){var newOpts={depth:opts.depth};if(has(opts,'quoteStyle')){newOpts.quoteStyle=opts.quoteStyle;}return inspect_(value,newOpts,depth+1,seen);}return inspect_(value,opts,depth+1,seen);}if(typeof obj==='function'&&!isRegExp(obj)){// in older engines, regexes are callable
|
|
3111
3112
|
var name=nameOf(obj);var keys=arrObjKeys(obj,inspect);return'[Function'+(name?': '+name:' (anonymous)')+']'+(keys.length>0?' { '+$join.call(keys,', ')+' }':'');}if(isSymbol(obj)){var symString=hasShammedSymbols?$replace.call(String(obj),/^(Symbol\(.*\))_[^)]*$/,'$1'):symToString.call(obj);return _typeof(obj)==='object'&&!hasShammedSymbols?markBoxed(symString):symString;}if(isElement(obj)){var s='<'+$toLowerCase.call(String(obj.nodeName));var attrs=obj.attributes||[];for(var i=0;i<attrs.length;i++){s+=' '+attrs[i].name+'='+wrapQuotes(quote(attrs[i].value),'double',opts);}s+='>';if(obj.childNodes&&obj.childNodes.length){s+='...';}s+='</'+$toLowerCase.call(String(obj.nodeName))+'>';return s;}if(isArray(obj)){if(obj.length===0){return'[]';}var xs=arrObjKeys(obj,inspect);if(indent&&!singleLineValues(xs)){return'['+indentedJoin(xs,indent)+']';}return'[ '+$join.call(xs,', ')+' ]';}if(isError(obj)){var parts=arrObjKeys(obj,inspect);if(!('cause'in Error.prototype)&&'cause'in obj&&!isEnumerable.call(obj,'cause')){return'{ ['+String(obj)+'] '+$join.call($concat.call('[cause]: '+inspect(obj.cause),parts),', ')+' }';}if(parts.length===0){return'['+String(obj)+']';}return'{ ['+String(obj)+'] '+$join.call(parts,', ')+' }';}if(_typeof(obj)==='object'&&customInspect){if(inspectSymbol&&typeof obj[inspectSymbol]==='function'&&utilInspect){return utilInspect(obj,{depth:maxDepth-depth});}else if(customInspect!=='symbol'&&typeof obj.inspect==='function'){return obj.inspect();}}if(isMap(obj)){var mapParts=[];if(mapForEach){mapForEach.call(obj,function(value,key){mapParts.push(inspect(key,obj,true)+' => '+inspect(value,obj));});}return collectionOf('Map',mapSize.call(obj),mapParts,indent);}if(isSet(obj)){var setParts=[];if(setForEach){setForEach.call(obj,function(value){setParts.push(inspect(value,obj));});}return collectionOf('Set',setSize.call(obj),setParts,indent);}if(isWeakMap(obj)){return weakCollectionOf('WeakMap');}if(isWeakSet(obj)){return weakCollectionOf('WeakSet');}if(isWeakRef(obj)){return weakCollectionOf('WeakRef');}if(isNumber(obj)){return markBoxed(inspect(Number(obj)));}if(isBigInt(obj)){return markBoxed(inspect(bigIntValueOf.call(obj)));}if(isBoolean(obj)){return markBoxed(booleanValueOf.call(obj));}if(isString(obj)){return markBoxed(inspect(String(obj)));}// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
3112
|
-
/* eslint-env browser */if(typeof window!=='undefined'&&obj===window){return'{ [object Window] }';}if(typeof globalThis!=='undefined'&&obj===globalThis||typeof global!=='undefined'&&obj===global){return'{ [object globalThis] }';}if(!isDate(obj)&&!isRegExp(obj)){var ys=arrObjKeys(obj,inspect);var isPlainObject=gPO?gPO(obj)===Object.prototype:obj instanceof Object||obj.constructor===Object;var protoTag=obj instanceof Object?'':'null prototype';var stringTag=!isPlainObject&&toStringTag&&Object(obj)===obj&&toStringTag in obj?$slice.call(toStr(obj),8,-1):protoTag?'Object':'';var constructorTag=isPlainObject||typeof obj.constructor!=='function'?'':obj.constructor.name?obj.constructor.name+' ':'';var tag=constructorTag+(stringTag||protoTag?'['+$join.call($concat.call([],stringTag||[],protoTag||[]),': ')+'] ':'');if(ys.length===0){return tag+'{}';}if(indent){return tag+'{'+indentedJoin(ys,indent)+'}';}return tag+'{ '+$join.call(ys,', ')+' }';}return String(obj);};function wrapQuotes(s,defaultStyle,opts){var style=opts.quoteStyle||defaultStyle;var quoteChar=quotes[style];return quoteChar+s+quoteChar;}function quote(s){return $replace.call(String(s),/"/g,'"');}function
|
|
3113
|
+
/* eslint-env browser */if(typeof window!=='undefined'&&obj===window){return'{ [object Window] }';}if(typeof globalThis!=='undefined'&&obj===globalThis||typeof global!=='undefined'&&obj===global){return'{ [object globalThis] }';}if(!isDate(obj)&&!isRegExp(obj)){var ys=arrObjKeys(obj,inspect);var isPlainObject=gPO?gPO(obj)===Object.prototype:obj instanceof Object||obj.constructor===Object;var protoTag=obj instanceof Object?'':'null prototype';var stringTag=!isPlainObject&&toStringTag&&Object(obj)===obj&&toStringTag in obj?$slice.call(toStr(obj),8,-1):protoTag?'Object':'';var constructorTag=isPlainObject||typeof obj.constructor!=='function'?'':obj.constructor.name?obj.constructor.name+' ':'';var tag=constructorTag+(stringTag||protoTag?'['+$join.call($concat.call([],stringTag||[],protoTag||[]),': ')+'] ':'');if(ys.length===0){return tag+'{}';}if(indent){return tag+'{'+indentedJoin(ys,indent)+'}';}return tag+'{ '+$join.call(ys,', ')+' }';}return String(obj);};function wrapQuotes(s,defaultStyle,opts){var style=opts.quoteStyle||defaultStyle;var quoteChar=quotes[style];return quoteChar+s+quoteChar;}function quote(s){return $replace.call(String(s),/"/g,'"');}function isArray(obj){return toStr(obj)==='[object Array]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isDate(obj){return toStr(obj)==='[object Date]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isRegExp(obj){return toStr(obj)==='[object RegExp]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isError(obj){return toStr(obj)==='[object Error]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isString(obj){return toStr(obj)==='[object String]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isNumber(obj){return toStr(obj)==='[object Number]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}function isBoolean(obj){return toStr(obj)==='[object Boolean]'&&(!toStringTag||!(_typeof(obj)==='object'&&toStringTag in obj));}// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
3113
3114
|
function isSymbol(obj){if(hasShammedSymbols){return obj&&_typeof(obj)==='object'&&obj instanceof Symbol;}if(_typeof(obj)==='symbol'){return true;}if(!obj||_typeof(obj)!=='object'||!symToString){return false;}try{symToString.call(obj);return true;}catch(e){}return false;}function isBigInt(obj){if(!obj||_typeof(obj)!=='object'||!bigIntValueOf){return false;}try{bigIntValueOf.call(obj);return true;}catch(e){}return false;}var hasOwn=Object.prototype.hasOwnProperty||function(key){return key in this;};function has(obj,key){return hasOwn.call(obj,key);}function toStr(obj){return objectToString.call(obj);}function nameOf(f){if(f.name){return f.name;}var m=$match.call(functionToString.call(f),/^function\s*([\w$]+)/);if(m){return m[1];}return null;}function indexOf(xs,x){if(xs.indexOf){return xs.indexOf(x);}for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x){return i;}}return-1;}function isMap(x){if(!mapSize||!x||_typeof(x)!=='object'){return false;}try{mapSize.call(x);try{setSize.call(x);}catch(s){return true;}return x instanceof Map;// core-js workaround, pre-v2.5.0
|
|
3114
3115
|
}catch(e){}return false;}function isWeakMap(x){if(!weakMapHas||!x||_typeof(x)!=='object'){return false;}try{weakMapHas.call(x,weakMapHas);try{weakSetHas.call(x,weakSetHas);}catch(s){return true;}return x instanceof WeakMap;// core-js workaround, pre-v2.5.0
|
|
3115
3116
|
}catch(e){}return false;}function isWeakRef(x){if(!weakRefDeref||!x||_typeof(x)!=='object'){return false;}try{weakRefDeref.call(x);return true;}catch(e){}return false;}function isSet(x){if(!setSize||!x||_typeof(x)!=='object'){return false;}try{setSize.call(x);try{mapSize.call(x);}catch(m){return true;}return x instanceof Set;// core-js workaround, pre-v2.5.0
|
|
@@ -3207,19 +3208,19 @@ MainViewportViewIdentifier:'Default-View',MainViewportRenderableHash:false,MainV
|
|
|
3207
3208
|
AutoSolveAfterInitialize:true,AutoRenderMainViewportViewAfterInitialize:true,AutoRenderViewsAfterInitialize:false,ConfigurationOnlyViews:[],Manifests:{},// The prefix to prepend on all template destination hashes
|
|
3208
3209
|
IdentifierAddressPrefix:'PICT-'};/**
|
|
3209
3210
|
* Base class for pict applications.
|
|
3210
|
-
*/var PictApplication=/*#__PURE__*/function(
|
|
3211
|
+
*/var PictApplication=/*#__PURE__*/function(_libFableServiceBase15){/**
|
|
3211
3212
|
* @param {import('fable')} pFable
|
|
3212
3213
|
* @param {any} [pOptions]
|
|
3213
3214
|
* @param {string} [pServiceHash]
|
|
3214
|
-
*/function PictApplication(pFable,pOptions,pServiceHash){var
|
|
3215
|
+
*/function PictApplication(pFable,pOptions,pServiceHash){var _this52;_classCallCheck2(this,PictApplication);var tmpCarryOverConfiguration=_typeof(pFable.settings.PictApplicationConfiguration)==='object'?pFable.settings.PictApplicationConfiguration:{};var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictSettings)),tmpCarryOverConfiguration,pOptions);_this52=_callSuper(this,PictApplication,[pFable,tmpOptions,pServiceHash]);/** @type {any} */_this52.options;/** @type {any} */_this52.log;/** @type {import('pict') & import('fable')} */_this52.fable;/** @type {string} */_this52.UUID;/** @type {string} */_this52.Hash;/**
|
|
3215
3216
|
* @type {{ [key: string]: any }}
|
|
3216
|
-
*/
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
var tmpManifestKeys=Object.keys(
|
|
3220
|
-
var tmpManifestKey=tmpManifestKeys[i];
|
|
3217
|
+
*/_this52.servicesMap;_this52.serviceType='PictApplication';/** @type {Object} */_this52._Package=libPackage;// Convenience and consistency naming
|
|
3218
|
+
_this52.pict=_this52.fable;// Wire in the essential Pict state
|
|
3219
|
+
_this52.AppData=_this52.fable.AppData;/** @type {number} */_this52.initializeTimestamp;/** @type {number} */_this52.lastSolvedTimestamp;/** @type {number} */_this52.lastMarshalFromViewsTimestamp;/** @type {number} */_this52.lastMarshalToViewsTimestamp;/** @type {number} */_this52.lastAutoRenderTimestamp;// Load all the manifests for the application
|
|
3220
|
+
var tmpManifestKeys=Object.keys(_this52.options.Manifests);if(tmpManifestKeys.length>0){for(var i=0;i<tmpManifestKeys.length;i++){// Load each manifest
|
|
3221
|
+
var tmpManifestKey=tmpManifestKeys[i];_this52.fable.instantiateServiceProvider('Manifest',_this52.options.Manifests[tmpManifestKey],tmpManifestKey);}}return _this52;}/* -------------------------------------------------------------------------- *//* Code Section: Solve All Views *//* -------------------------------------------------------------------------- *//**
|
|
3221
3222
|
* @return {boolean}
|
|
3222
|
-
*/_inherits(PictApplication,
|
|
3223
|
+
*/_inherits(PictApplication,_libFableServiceBase15);return _createClass2(PictApplication,[{key:"onPreSolve",value:function onPreSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onPreSolve:"));}return true;}/**
|
|
3223
3224
|
* @param {(error?: Error) => void} fCallback
|
|
3224
3225
|
*/},{key:"onPreSolveAsync",value:function onPreSolveAsync(fCallback){this.onPreSolve();return fCallback();}/**
|
|
3225
3226
|
* @return {boolean}
|
|
@@ -3233,16 +3234,16 @@ var tmpManifestKey=tmpManifestKeys[i];_this50.fable.instantiateServiceProvider('
|
|
|
3233
3234
|
* @return {boolean}
|
|
3234
3235
|
*/},{key:"solve",value:function solve(){if(this.pict.LogNoisiness>2){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," executing solve() function..."));}// Walk through any loaded providers and solve them as well.
|
|
3235
3236
|
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToSolve=[];for(var i=0;i<tmpLoadedProviders.length;i++){var tmpProvider=this.pict.providers[tmpLoadedProviders[i]];if(tmpProvider.options.AutoSolveWithApp){tmpProvidersToSolve.push(tmpProvider);}}// Sort the views by their priority (if they are all priority 0, it will end up being add order due to JSON Object Property Key order stuff)
|
|
3236
|
-
tmpProvidersToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var
|
|
3237
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToSolve=[];for(var
|
|
3238
|
-
tmpViewsToSolve.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3237
|
+
tmpProvidersToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var _i35=0;_i35<tmpProvidersToSolve.length;_i35++){tmpProvidersToSolve[_i35].solve(tmpProvidersToSolve[_i35]);}this.onBeforeSolve();// Now walk through any loaded views and initialize them as well.
|
|
3238
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToSolve=[];for(var _i36=0;_i36<tmpLoadedViews.length;_i36++){var tmpView=this.pict.views[tmpLoadedViews[_i36]];if(tmpView.options.AutoInitialize){tmpViewsToSolve.push(tmpView);}}// Sort the views by their priority (if they are all priority 0, it will end up being add order due to JSON Object Property Key order stuff)
|
|
3239
|
+
tmpViewsToSolve.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i37=0;_i37<tmpViewsToSolve.length;_i37++){tmpViewsToSolve[_i37].solve();}this.onSolve();this.onAfterSolve();this.lastSolvedTimestamp=this.fable.log.getTimeStamp();return true;}/**
|
|
3239
3240
|
* @param {(error?: Error) => void} fCallback
|
|
3240
|
-
*/},{key:"solveAsync",value:function solveAsync(fCallback){var
|
|
3241
|
-
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){
|
|
3241
|
+
*/},{key:"solveAsync",value:function solveAsync(fCallback){var _this53=this;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');tmpAnticipate.anticipate(this.onBeforeSolveAsync.bind(this));// Allow the callback to be passed in as the last parameter no matter what
|
|
3242
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this53.log.error("PictApp [".concat(_this53.UUID,"]::[").concat(_this53.Hash,"] ").concat(_this53.options.Name," solveAsync Auto Callback Error: ").concat(pError),pError);}};}// Walk through any loaded providers and solve them as well.
|
|
3242
3243
|
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToSolve=[];for(var i=0;i<tmpLoadedProviders.length;i++){var tmpProvider=this.pict.providers[tmpLoadedProviders[i]];if(tmpProvider.options.AutoSolveWithApp){tmpProvidersToSolve.push(tmpProvider);}}// Sort the views by their priority (if they are all priority 0, it will end up being add order due to JSON Object Property Key order stuff)
|
|
3243
|
-
tmpProvidersToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var
|
|
3244
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToSolve=[];for(var
|
|
3245
|
-
tmpViewsToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var
|
|
3244
|
+
tmpProvidersToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var _i38=0;_i38<tmpProvidersToSolve.length;_i38++){tmpAnticipate.anticipate(tmpProvidersToSolve[_i38].solveAsync.bind(tmpProvidersToSolve[_i38]));}// Walk through any loaded views and solve them as well.
|
|
3245
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToSolve=[];for(var _i39=0;_i39<tmpLoadedViews.length;_i39++){var tmpView=this.pict.views[tmpLoadedViews[_i39]];if(tmpView.options.AutoSolveWithApp){tmpViewsToSolve.push(tmpView);}}// Sort the views by their priority (if they are all priority 0, it will end up being add order due to JSON Object Property Key order stuff)
|
|
3246
|
+
tmpViewsToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var _i40=0;_i40<tmpViewsToSolve.length;_i40++){tmpAnticipate.anticipate(tmpViewsToSolve[_i40].solveAsync.bind(tmpViewsToSolve[_i40]));}tmpAnticipate.anticipate(this.onSolveAsync.bind(this));tmpAnticipate.anticipate(this.onAfterSolveAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this53.pict.LogNoisiness>2){_this53.log.trace("PictApp [".concat(_this53.UUID,"]::[").concat(_this53.Hash,"] ").concat(_this53.options.Name," solveAsync() complete."));}_this53.lastSolvedTimestamp=_this53.fable.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3246
3247
|
* @return {boolean}
|
|
3247
3248
|
*/},{key:"onAfterSolve",value:function onAfterSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterSolve:"));}return true;}/**
|
|
3248
3249
|
* @param {(error?: Error) => void} fCallback
|
|
@@ -3258,23 +3259,23 @@ tmpViewsToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.A
|
|
|
3258
3259
|
* @return {boolean}
|
|
3259
3260
|
*/},{key:"initialize",value:function initialize(){if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialize:"));}if(!this.initializeTimestamp){this.onBeforeInitialize();if('ConfigurationOnlyViews'in this.options){// Load all the configuration only views
|
|
3260
3261
|
for(var i=0;i<this.options.ConfigurationOnlyViews.length;i++){var tmpViewIdentifier=typeof this.options.ConfigurationOnlyViews[i].ViewIdentifier==='undefined'?"AutoView-".concat(this.fable.getUUID()):this.options.ConfigurationOnlyViews[i].ViewIdentifier;this.log.info("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," adding configuration only view: ").concat(tmpViewIdentifier));this.pict.addView(tmpViewIdentifier,this.options.ConfigurationOnlyViews[i]);}}this.onInitialize();// Walk through any loaded providers and initialize them as well.
|
|
3261
|
-
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToInitialize=[];for(var
|
|
3262
|
-
tmpProvidersToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3263
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToInitialize=[];for(var
|
|
3264
|
-
tmpViewsToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3262
|
+
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToInitialize=[];for(var _i41=0;_i41<tmpLoadedProviders.length;_i41++){var tmpProvider=this.pict.providers[tmpLoadedProviders[_i41]];if(tmpProvider.options.AutoInitialize){tmpProvidersToInitialize.push(tmpProvider);}}// Sort the views by their priority (if they are all priority 0, it will end up being add order due to JSON Object Property Key order stuff)
|
|
3263
|
+
tmpProvidersToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i42=0;_i42<tmpProvidersToInitialize.length;_i42++){tmpProvidersToInitialize[_i42].initialize();}// Now walk through any loaded views and initialize them as well.
|
|
3264
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToInitialize=[];for(var _i43=0;_i43<tmpLoadedViews.length;_i43++){var tmpView=this.pict.views[tmpLoadedViews[_i43]];if(tmpView.options.AutoInitialize){tmpViewsToInitialize.push(tmpView);}}// Sort the views by their priority (if they are all priority 0, it will end up being add order due to JSON Object Property Key order stuff)
|
|
3265
|
+
tmpViewsToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i44=0;_i44<tmpViewsToInitialize.length;_i44++){tmpViewsToInitialize[_i44].initialize();}this.onAfterInitialize();if(this.options.AutoSolveAfterInitialize){if(this.pict.LogNoisiness>1){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto solving after initialization..."));}// Solve the template synchronously
|
|
3265
3266
|
this.solve();}// Now check and see if we should automatically render as well
|
|
3266
3267
|
if(this.options.AutoRenderMainViewportViewAfterInitialize){if(this.pict.LogNoisiness>1){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto rendering after initialization..."));}// Render the template synchronously
|
|
3267
3268
|
this.render();}this.initializeTimestamp=this.fable.log.getTimeStamp();return true;}else{this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialize called but initialization is already completed. Aborting."));return false;}}/**
|
|
3268
3269
|
* @param {(error?: Error) => void} fCallback
|
|
3269
|
-
*/},{key:"initializeAsync",value:function initializeAsync(fCallback){var
|
|
3270
|
-
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initializeAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){
|
|
3270
|
+
*/},{key:"initializeAsync",value:function initializeAsync(fCallback){var _this54=this;if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initializeAsync:"));}// Allow the callback to be passed in as the last parameter no matter what
|
|
3271
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initializeAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this54.log.error("PictApp [".concat(_this54.UUID,"]::[").concat(_this54.Hash,"] ").concat(_this54.options.Name," initializeAsync Auto Callback Error: ").concat(pError),pError);}};}if(!this.initializeTimestamp){var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');if(this.pict.LogNoisiness>3){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," beginning initialization..."));}if('ConfigurationOnlyViews'in this.options){// Load all the configuration only views
|
|
3271
3272
|
for(var i=0;i<this.options.ConfigurationOnlyViews.length;i++){var tmpViewIdentifier=typeof this.options.ConfigurationOnlyViews[i].ViewIdentifier==='undefined'?"AutoView-".concat(this.fable.getUUID()):this.options.ConfigurationOnlyViews[i].ViewIdentifier;this.log.info("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," adding configuration only view: ").concat(tmpViewIdentifier));this.pict.addView(tmpViewIdentifier,this.options.ConfigurationOnlyViews[i]);}}tmpAnticipate.anticipate(this.onBeforeInitializeAsync.bind(this));tmpAnticipate.anticipate(this.onInitializeAsync.bind(this));// Walk through any loaded providers and solve them as well.
|
|
3272
|
-
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToInitialize=[];for(var
|
|
3273
|
-
tmpProvidersToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3273
|
+
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToInitialize=[];for(var _i45=0;_i45<tmpLoadedProviders.length;_i45++){var tmpProvider=this.pict.providers[tmpLoadedProviders[_i45]];if(tmpProvider.options.AutoInitialize){tmpProvidersToInitialize.push(tmpProvider);}}// Sort the views by their priority (if they are all priority 0, it will end up being add order due to JSON Object Property Key order stuff)
|
|
3274
|
+
tmpProvidersToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i46=0;_i46<tmpProvidersToInitialize.length;_i46++){tmpAnticipate.anticipate(tmpProvidersToInitialize[_i46].initializeAsync.bind(tmpProvidersToInitialize[_i46]));}// Now walk through any loaded views and initialize them as well.
|
|
3274
3275
|
// TODO: Some optimization cleverness could be gained by grouping them into a parallelized async operation, by ordinal.
|
|
3275
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToInitialize=[];for(var
|
|
3276
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToInitialize=[];for(var _i47=0;_i47<tmpLoadedViews.length;_i47++){var tmpView=this.pict.views[tmpLoadedViews[_i47]];if(tmpView.options.AutoInitialize){tmpViewsToInitialize.push(tmpView);}}// Sort the views by their priority
|
|
3276
3277
|
// If they are all the default priority 0, it will end up being add order due to JSON Object Property Key order stuff
|
|
3277
|
-
tmpViewsToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3278
|
+
tmpViewsToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i48=0;_i48<tmpViewsToInitialize.length;_i48++){var _tmpView=tmpViewsToInitialize[_i48];tmpAnticipate.anticipate(_tmpView.initializeAsync.bind(_tmpView));}tmpAnticipate.anticipate(this.onAfterInitializeAsync.bind(this));if(this.options.AutoSolveAfterInitialize){if(this.pict.LogNoisiness>1){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto solving (asynchronously) after initialization..."));}tmpAnticipate.anticipate(this.solveAsync.bind(this));}if(this.options.AutoRenderMainViewportViewAfterInitialize){if(this.pict.LogNoisiness>1){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto rendering (asynchronously) after initialization..."));}tmpAnticipate.anticipate(this.renderMainViewportAsync.bind(this));}tmpAnticipate.wait(function(pError){if(pError){_this54.log.error("PictApp [".concat(_this54.UUID,"]::[").concat(_this54.Hash,"] ").concat(_this54.options.Name," initializeAsync Error: ").concat(pError.message||pError),{stack:pError.stack});}_this54.initializeTimestamp=_this54.fable.log.getTimeStamp();if(_this54.pict.LogNoisiness>2){_this54.log.trace("PictApp [".concat(_this54.UUID,"]::[").concat(_this54.Hash,"] ").concat(_this54.options.Name," initialization complete."));}return tmpCallback();});}else{this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," async initialize called but initialization is already completed. Aborting."));// TODO: Should this be an error?
|
|
3278
3279
|
return tmpCallback();}}/**
|
|
3279
3280
|
* @return {boolean}
|
|
3280
3281
|
*/},{key:"onAfterInitialize",value:function onAfterInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterInitialize:"));}return true;}/**
|
|
@@ -3290,11 +3291,11 @@ return tmpCallback();}}/**
|
|
|
3290
3291
|
*/},{key:"onMarshalFromViewsAsync",value:function onMarshalFromViewsAsync(fCallback){this.onMarshalFromViews();return fCallback();}/**
|
|
3291
3292
|
* @return {boolean}
|
|
3292
3293
|
*/},{key:"marshalFromViews",value:function marshalFromViews(){if(this.pict.LogNoisiness>2){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," executing marshalFromViews() function..."));}this.onBeforeMarshalFromViews();// Now walk through any loaded views and initialize them as well.
|
|
3293
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalFromViews=[];for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];tmpViewsToMarshalFromViews.push(tmpView);}for(var
|
|
3294
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalFromViews=[];for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];tmpViewsToMarshalFromViews.push(tmpView);}for(var _i49=0;_i49<tmpViewsToMarshalFromViews.length;_i49++){tmpViewsToMarshalFromViews[_i49].marshalFromView();}this.onMarshalFromViews();this.onAfterMarshalFromViews();this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp();return true;}/**
|
|
3294
3295
|
* @param {(error?: Error) => void} fCallback
|
|
3295
|
-
*/},{key:"marshalFromViewsAsync",value:function marshalFromViewsAsync(fCallback){var
|
|
3296
|
-
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){
|
|
3297
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalFromViews=[];for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];tmpViewsToMarshalFromViews.push(tmpView);}for(var
|
|
3296
|
+
*/},{key:"marshalFromViewsAsync",value:function marshalFromViewsAsync(fCallback){var _this55=this;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');// Allow the callback to be passed in as the last parameter no matter what
|
|
3297
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this55.log.error("PictApp [".concat(_this55.UUID,"]::[").concat(_this55.Hash,"] ").concat(_this55.options.Name," marshalFromViewsAsync Auto Callback Error: ").concat(pError),pError);}};}tmpAnticipate.anticipate(this.onBeforeMarshalFromViewsAsync.bind(this));// Walk through any loaded views and marshalFromViews them as well.
|
|
3298
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalFromViews=[];for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];tmpViewsToMarshalFromViews.push(tmpView);}for(var _i50=0;_i50<tmpViewsToMarshalFromViews.length;_i50++){tmpAnticipate.anticipate(tmpViewsToMarshalFromViews[_i50].marshalFromViewAsync.bind(tmpViewsToMarshalFromViews[_i50]));}tmpAnticipate.anticipate(this.onMarshalFromViewsAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalFromViewsAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this55.pict.LogNoisiness>2){_this55.log.trace("PictApp [".concat(_this55.UUID,"]::[").concat(_this55.Hash,"] ").concat(_this55.options.Name," marshalFromViewsAsync() complete."));}_this55.lastMarshalFromViewsTimestamp=_this55.fable.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3298
3299
|
* @return {boolean}
|
|
3299
3300
|
*/},{key:"onAfterMarshalFromViews",value:function onAfterMarshalFromViews(){if(this.pict.LogNoisiness>3){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterMarshalFromViews:"));}return true;}/**
|
|
3300
3301
|
* @param {(error?: Error) => void} fCallback
|
|
@@ -3309,11 +3310,11 @@ var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalFromViews=[
|
|
|
3309
3310
|
*/},{key:"onMarshalToViewsAsync",value:function onMarshalToViewsAsync(fCallback){this.onMarshalToViews();return fCallback();}/**
|
|
3310
3311
|
* @return {boolean}
|
|
3311
3312
|
*/},{key:"marshalToViews",value:function marshalToViews(){if(this.pict.LogNoisiness>2){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," executing marshalToViews() function..."));}this.onBeforeMarshalToViews();// Now walk through any loaded views and initialize them as well.
|
|
3312
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalToViews=[];for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];tmpViewsToMarshalToViews.push(tmpView);}for(var
|
|
3313
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalToViews=[];for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];tmpViewsToMarshalToViews.push(tmpView);}for(var _i51=0;_i51<tmpViewsToMarshalToViews.length;_i51++){tmpViewsToMarshalToViews[_i51].marshalToView();}this.onMarshalToViews();this.onAfterMarshalToViews();this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp();return true;}/**
|
|
3313
3314
|
* @param {(error?: Error) => void} fCallback
|
|
3314
|
-
*/},{key:"marshalToViewsAsync",value:function marshalToViewsAsync(fCallback){var
|
|
3315
|
-
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){
|
|
3316
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalToViews=[];for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];tmpViewsToMarshalToViews.push(tmpView);}for(var
|
|
3315
|
+
*/},{key:"marshalToViewsAsync",value:function marshalToViewsAsync(fCallback){var _this56=this;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');// Allow the callback to be passed in as the last parameter no matter what
|
|
3316
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this56.log.error("PictApp [".concat(_this56.UUID,"]::[").concat(_this56.Hash,"] ").concat(_this56.options.Name," marshalToViewsAsync Auto Callback Error: ").concat(pError),pError);}};}tmpAnticipate.anticipate(this.onBeforeMarshalToViewsAsync.bind(this));// Walk through any loaded views and marshalToViews them as well.
|
|
3317
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalToViews=[];for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];tmpViewsToMarshalToViews.push(tmpView);}for(var _i52=0;_i52<tmpViewsToMarshalToViews.length;_i52++){tmpAnticipate.anticipate(tmpViewsToMarshalToViews[_i52].marshalToViewAsync.bind(tmpViewsToMarshalToViews[_i52]));}tmpAnticipate.anticipate(this.onMarshalToViewsAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalToViewsAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this56.pict.LogNoisiness>2){_this56.log.trace("PictApp [".concat(_this56.UUID,"]::[").concat(_this56.Hash,"] ").concat(_this56.options.Name," marshalToViewsAsync() complete."));}_this56.lastMarshalToViewsTimestamp=_this56.fable.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3317
3318
|
* @return {boolean}
|
|
3318
3319
|
*/},{key:"onAfterMarshalToViews",value:function onAfterMarshalToViews(){if(this.pict.LogNoisiness>3){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterMarshalToViews:"));}return true;}/**
|
|
3319
3320
|
* @param {(error?: Error) => void} fCallback
|
|
@@ -3341,8 +3342,8 @@ var tmpView=typeof tmpViewIdentifier==='string'?this.servicesMap.PictView[tmpVie
|
|
|
3341
3342
|
* @param {(error?: Error) => void} [fCallback] - The callback, if all other parameters are provided.
|
|
3342
3343
|
*
|
|
3343
3344
|
* TODO: Should we support objects for pTemplateDataAddress for parity with pict-view?
|
|
3344
|
-
*/},{key:"renderAsync",value:function renderAsync(pViewIdentifier,pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress,fCallback){var
|
|
3345
|
-
var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateDataAddress==='function'?pTemplateDataAddress:typeof pRenderDestinationAddress==='function'?pRenderDestinationAddress:typeof pRenderableHash==='function'?pRenderableHash:typeof pViewIdentifier==='function'?pViewIdentifier:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){
|
|
3345
|
+
*/},{key:"renderAsync",value:function renderAsync(pViewIdentifier,pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress,fCallback){var _this57=this;var tmpViewIdentifier=typeof pViewIdentifier!=='string'?this.options.MainViewportViewIdentifier:pViewIdentifier;var tmpRenderableHash=typeof pRenderableHash!=='string'?this.options.MainViewportRenderableHash:pRenderableHash;var tmpRenderDestinationAddress=typeof pRenderDestinationAddress!=='string'?this.options.MainViewportDestinationAddress:pRenderDestinationAddress;var tmpTemplateDataAddress=typeof pTemplateDataAddress!=='string'?this.options.MainViewportDefaultDataAddress:pTemplateDataAddress;// Allow the callback to be passed in as the last parameter no matter what
|
|
3346
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateDataAddress==='function'?pTemplateDataAddress:typeof pRenderDestinationAddress==='function'?pRenderDestinationAddress:typeof pRenderableHash==='function'?pRenderableHash:typeof pViewIdentifier==='function'?pViewIdentifier:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this57.log.error("PictApp [".concat(_this57.UUID,"]::[").concat(_this57.Hash,"] ").concat(_this57.options.Name," renderAsync Auto Callback Error: ").concat(pError),pError);}};}if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," VIEW Renderable[").concat(tmpRenderableHash,"] Destination[").concat(tmpRenderDestinationAddress,"] TemplateDataAddress[").concat(tmpTemplateDataAddress,"] renderAsync:"));}var tmpRenderAnticipate=this.fable.newAnticipate();tmpRenderAnticipate.anticipate(this.onBeforeRenderAsync.bind(this));var tmpView=typeof tmpViewIdentifier==='string'?this.servicesMap.PictView[tmpViewIdentifier]:false;if(!tmpView){var tmpErrorMessage="PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not asynchronously render from View ").concat(tmpViewIdentifier," because it is not a valid view.");if(this.pict.LogNoisiness>3){this.log.error(tmpErrorMessage);}return tmpCallback(new Error(tmpErrorMessage));}tmpRenderAnticipate.anticipate(this.onRenderAsync.bind(this));tmpRenderAnticipate.anticipate(function(fNext){tmpView.renderAsync.call(tmpView,tmpRenderableHash,tmpRenderDestinationAddress,tmpTemplateDataAddress,fNext);});tmpRenderAnticipate.anticipate(this.onAfterRenderAsync.bind(this));return tmpRenderAnticipate.wait(tmpCallback);}/**
|
|
3346
3347
|
* @return {boolean}
|
|
3347
3348
|
*/},{key:"onAfterRender",value:function onAfterRender(){if(this.pict.LogNoisiness>3){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterRender:"));}return true;}/**
|
|
3348
3349
|
* @param {(error?: Error) => void} fCallback
|
|
@@ -3352,34 +3353,34 @@ var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateDataAddr
|
|
|
3352
3353
|
* @param {(error?: Error) => void} fCallback
|
|
3353
3354
|
*/},{key:"renderMainViewportAsync",value:function renderMainViewportAsync(fCallback){if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderMainViewportAsync:"));}return this.renderAsync(fCallback);}/**
|
|
3354
3355
|
* @return {void}
|
|
3355
|
-
*/},{key:"renderAutoViews",value:function renderAutoViews(){var
|
|
3356
|
+
*/},{key:"renderAutoViews",value:function renderAutoViews(){var _this58=this;if(this.pict.LogNoisiness>0){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," beginning renderAutoViews..."));}// Now walk through any loaded views and sort them by the AutoRender ordinal
|
|
3356
3357
|
var tmpLoadedViews=Object.keys(this.pict.views);// Sort the views by their priority
|
|
3357
3358
|
// If they are all the default priority 0, it will end up being add order due to JSON Object Property Key order stuff
|
|
3358
|
-
tmpLoadedViews.sort(function(a,b){return
|
|
3359
|
+
tmpLoadedViews.sort(function(a,b){return _this58.pict.views[a].options.AutoRenderOrdinal-_this58.pict.views[b].options.AutoRenderOrdinal;});for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];if(tmpView.options.AutoRender){tmpView.render();}}if(this.pict.LogNoisiness>0){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAutoViewsAsync complete."));}}/**
|
|
3359
3360
|
* @param {(error?: Error) => void} fCallback
|
|
3360
|
-
*/},{key:"renderAutoViewsAsync",value:function renderAutoViewsAsync(fCallback){var
|
|
3361
|
-
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAutoViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){
|
|
3361
|
+
*/},{key:"renderAutoViewsAsync",value:function renderAutoViewsAsync(fCallback){var _this59=this;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');// Allow the callback to be passed in as the last parameter no matter what
|
|
3362
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAutoViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this59.log.error("PictApp [".concat(_this59.UUID,"]::[").concat(_this59.Hash,"] ").concat(_this59.options.Name," renderAutoViewsAsync Auto Callback Error: ").concat(pError),pError);}};}if(this.pict.LogNoisiness>0){this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," beginning renderAutoViewsAsync..."));}// Now walk through any loaded views and sort them by the AutoRender ordinal
|
|
3362
3363
|
// TODO: Some optimization cleverness could be gained by grouping them into a parallelized async operation, by ordinal.
|
|
3363
3364
|
var tmpLoadedViews=Object.keys(this.pict.views);// Sort the views by their priority
|
|
3364
3365
|
// If they are all the default priority 0, it will end up being add order due to JSON Object Property Key order stuff
|
|
3365
|
-
tmpLoadedViews.sort(function(a,b){return
|
|
3366
|
+
tmpLoadedViews.sort(function(a,b){return _this59.pict.views[a].options.AutoRenderOrdinal-_this59.pict.views[b].options.AutoRenderOrdinal;});for(var i=0;i<tmpLoadedViews.length;i++){var tmpView=this.pict.views[tmpLoadedViews[i]];if(tmpView.options.AutoRender){tmpAnticipate.anticipate(tmpView.renderAsync.bind(tmpView));}}tmpAnticipate.wait(function(pError){_this59.lastAutoRenderTimestamp=_this59.fable.log.getTimeStamp();if(_this59.pict.LogNoisiness>0){_this59.log.trace("PictApp [".concat(_this59.UUID,"]::[").concat(_this59.Hash,"] ").concat(_this59.options.Name," renderAutoViewsAsync complete."));}return tmpCallback(pError);});}/**
|
|
3366
3367
|
* @return {boolean}
|
|
3367
|
-
*/},{key:"isPictApplication",get:function get(){return true;}}]);}(libFableServiceBase);module.exports=PictApplication;},{"../package.json":138,"fable-serviceproviderbase":
|
|
3368
|
+
*/},{key:"isPictApplication",get:function get(){return true;}}]);}(libFableServiceBase);module.exports=PictApplication;},{"../package.json":138,"fable-serviceproviderbase":59}],140:[function(require,module,exports){module.exports={"name":"pict-provider","version":"1.0.3","description":"Pict Provider Base Class","main":"source/Pict-Provider.js","scripts":{"start":"node source/Pict-Provider.js","test":"npx mocha -u tdd -R spec","tests":"npx mocha -u tdd --exit -R spec --grep","coverage":"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-provider-image:local","docker-dev-run":"docker run -it -d --name pict-provider-dev -p 24125:8080 -p 30027:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict-provider\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-provider-image:local","docker-dev-shell":"docker exec -it pict-provider-dev /bin/bash"},"repository":{"type":"git","url":"git+https://github.com/stevenvelozo/pict-provider.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/pict-provider/issues"},"homepage":"https://github.com/stevenvelozo/pict-provider#readme","devDependencies":{"pict":"^1.0.215","quackage":"^1.0.33"},"dependencies":{"fable-serviceproviderbase":"^3.0.15"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]}};},{}],141:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var libPackage=require('../package.json');var defaultPictProviderSettings={ProviderIdentifier:false,// If this is set to true, when the App initializes this will.
|
|
3368
3369
|
// After the App initializes, initialize will be called as soon as it's added.
|
|
3369
|
-
AutoInitialize:true,AutoInitializeOrdinal:0,AutoSolveWithApp:true,AutoSolveOrdinal:0,Manifests:{},Templates:[]};var PictProvider=/*#__PURE__*/function(
|
|
3370
|
-
var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictProviderSettings)),pOptions);
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onAfterInitialize:"));}return true;}},{key:"onAfterInitializeAsync",value:function onAfterInitializeAsync(fCallback){this.onAfterInitialize();return fCallback();}},{key:"onPreRender",value:function onPreRender(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreRender:"));}return true;}},{key:"onPreRenderAsync",value:function onPreRenderAsync(fCallback){this.onPreRender();return fCallback();}},{key:"render",value:function render(){return this.onPreRender();}},{key:"renderAsync",value:function renderAsync(fCallback){this.onPreRender();return fCallback();}},{key:"onPreSolve",value:function onPreSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreSolve:"));}return true;}},{key:"onPreSolveAsync",value:function onPreSolveAsync(fCallback){this.onPreSolve();return fCallback();}},{key:"solve",value:function solve(){return this.onPreSolve();}},{key:"solveAsync",value:function solveAsync(fCallback){this.onPreSolve();return fCallback();}}]);}(libFableServiceBase);module.exports=PictProvider;},{"../package.json":140,"fable-serviceproviderbase":
|
|
3370
|
+
AutoInitialize:true,AutoInitializeOrdinal:0,AutoSolveWithApp:true,AutoSolveOrdinal:0,Manifests:{},Templates:[]};var PictProvider=/*#__PURE__*/function(_libFableServiceBase16){function PictProvider(pFable,pOptions,pServiceHash){var _this60;_classCallCheck2(this,PictProvider);// Intersect default options, parent constructor, service information
|
|
3371
|
+
var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictProviderSettings)),pOptions);_this60=_callSuper(this,PictProvider,[pFable,tmpOptions,pServiceHash]);if(!_this60.options.ProviderIdentifier){_this60.options.ProviderIdentifier="AutoProviderID-".concat(_this60.fable.getUUID());}_this60.serviceType='PictProvider';/** @type {Object} */_this60._Package=libPackage;// Convenience and consistency naming
|
|
3372
|
+
_this60.pict=_this60.fable;// Wire in the essential Pict application state
|
|
3373
|
+
_this60.AppData=_this60.pict.AppData;_this60.initializeTimestamp=false;_this60.lastSolvedTimestamp=false;for(var i=0;i<_this60.options.Templates.length;i++){var tmpDefaultTemplate=_this60.options.Templates[i];if(!tmpDefaultTemplate.hasOwnProperty('Postfix')||!tmpDefaultTemplate.hasOwnProperty('Template')){_this60.log.error("PictProvider [".concat(_this60.UUID,"]::[").concat(_this60.Hash,"] ").concat(_this60.options.ProviderIdentifier," could not load Default Template ").concat(i," in the options array."),tmpDefaultTemplate);}else{if(!tmpDefaultTemplate.Source){tmpDefaultTemplate.Source="PictProvider [".concat(_this60.UUID,"]::[").concat(_this60.Hash,"] ").concat(_this60.options.ProviderIdentifier," options object.");}_this60.pict.TemplateProvider.addDefaultTemplate(tmpDefaultTemplate.Prefix,tmpDefaultTemplate.Postfix,tmpDefaultTemplate.Template,tmpDefaultTemplate.Source);}}return _this60;}/* -------------------------------------------------------------------------- *//* Code Section: Initialization *//* -------------------------------------------------------------------------- */_inherits(PictProvider,_libFableServiceBase16);return _createClass2(PictProvider,[{key:"onBeforeInitialize",value:function onBeforeInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onBeforeInitialize:"));}return true;}},{key:"onBeforeInitializeAsync",value:function onBeforeInitializeAsync(fCallback){this.onBeforeInitialize();return fCallback();}},{key:"onInitialize",value:function onInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onInitialize:"));}return true;}},{key:"onInitializeAsync",value:function onInitializeAsync(fCallback){this.onInitialize();return fCallback();}},{key:"initialize",value:function initialize(){if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow PROVIDER [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialize:"));}if(!this.initializeTimestamp){this.onBeforeInitialize();this.onInitialize();this.onAfterInitialize();this.initializeTimestamp=this.pict.log.getTimeStamp();return true;}else{this.log.warn("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialize called but initialization is already completed. Aborting."));return false;}}},{key:"initializeAsync",value:function initializeAsync(fCallback){var _this61=this;if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow PROVIDER [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initializeAsync:"));}if(!this.initializeTimestamp){var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');if(this.pict.LogNoisiness>0){this.log.info("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," beginning initialization..."));}tmpAnticipate.anticipate(this.onBeforeInitializeAsync.bind(this));tmpAnticipate.anticipate(this.onInitializeAsync.bind(this));tmpAnticipate.anticipate(this.onAfterInitializeAsync.bind(this));tmpAnticipate.wait(function(pError){_this61.initializeTimestamp=_this61.pict.log.getTimeStamp();if(_this61.pict.LogNoisiness>0){_this61.log.info("PictProvider [".concat(_this61.UUID,"]::[").concat(_this61.Hash,"] ").concat(_this61.options.ProviderIdentifier," initialization complete."));}return fCallback();});}else{this.log.warn("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," async initialize called but initialization is already completed. Aborting."));// TODO: Should this be an error?
|
|
3374
|
+
return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onAfterInitialize:"));}return true;}},{key:"onAfterInitializeAsync",value:function onAfterInitializeAsync(fCallback){this.onAfterInitialize();return fCallback();}},{key:"onPreRender",value:function onPreRender(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreRender:"));}return true;}},{key:"onPreRenderAsync",value:function onPreRenderAsync(fCallback){this.onPreRender();return fCallback();}},{key:"render",value:function render(){return this.onPreRender();}},{key:"renderAsync",value:function renderAsync(fCallback){this.onPreRender();return fCallback();}},{key:"onPreSolve",value:function onPreSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreSolve:"));}return true;}},{key:"onPreSolveAsync",value:function onPreSolveAsync(fCallback){this.onPreSolve();return fCallback();}},{key:"solve",value:function solve(){return this.onPreSolve();}},{key:"solveAsync",value:function solveAsync(fCallback){this.onPreSolve();return fCallback();}}]);}(libFableServiceBase);module.exports=PictProvider;},{"../package.json":140,"fable-serviceproviderbase":59}],142:[function(require,module,exports){module.exports={"name":"pict-template","version":"1.0.10","description":"Pict Template Base Class","main":"source/Pict-Template.js","scripts":{"start":"node source/Pict-Template.js","test":"npx mocha -u tdd -R spec","tests":"npx mocha -u tdd --exit -R spec --grep","coverage":"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec","build":"npx quack build","types":"tsc -p ."},"types":"types/source/Pict-Template.d.ts","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/pict-view.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/pict-view/issues"},"homepage":"https://github.com/stevenvelozo/pict-view#readme","devDependencies":{"pict":"^1.0.227","quackage":"^1.0.36","typescript":"^5.7.2"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"dependencies":{"fable-serviceproviderbase":"^3.0.15"}};},{}],143:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var libPackage=require('../package.json');/** @typedef {import('pict') & {
|
|
3374
3375
|
* [key: string]: any, // represent services for now as a workaround
|
|
3375
3376
|
* }} Pict *//**
|
|
3376
3377
|
* @class PictTemplateExpression
|
|
3377
3378
|
* @classdesc The PictTemplateExpression class is a service provider for the pict anti-framework that provides template rendering services.
|
|
3378
|
-
*/var PictTemplateExpression=/*#__PURE__*/function(
|
|
3379
|
+
*/var PictTemplateExpression=/*#__PURE__*/function(_libFableServiceBase17){/**
|
|
3379
3380
|
* @param {Pict} pFable - The Fable Framework instance
|
|
3380
3381
|
* @param {any} [pOptions] - The options for the service
|
|
3381
3382
|
* @param {String} [pServiceHash] - The hash of the service
|
|
3382
|
-
*/function PictTemplateExpression(pFable,pOptions,pServiceHash){var
|
|
3383
|
+
*/function PictTemplateExpression(pFable,pOptions,pServiceHash){var _this62;_classCallCheck2(this,PictTemplateExpression);_this62=_callSuper(this,PictTemplateExpression,[pFable,pOptions,pServiceHash]);/** @type {Pict} */_this62.fable;/** @type {Pict} */_this62.pict=_this62.fable;_this62.serviceType='PictTemplate';/** @type {Object} */_this62._Package=libPackage;return _this62;}/**
|
|
3383
3384
|
* Render a template expression, returning a string with the resulting content.
|
|
3384
3385
|
*
|
|
3385
3386
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -3387,7 +3388,7 @@ return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize
|
|
|
3387
3388
|
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
3388
3389
|
*
|
|
3389
3390
|
* @return {string} The rendered template
|
|
3390
|
-
*/_inherits(PictTemplateExpression,
|
|
3391
|
+
*/_inherits(PictTemplateExpression,_libFableServiceBase17);return _createClass2(PictTemplateExpression,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){return'';}/**
|
|
3391
3392
|
* Render a template expression, deliver a string with the resulting content to a callback function.
|
|
3392
3393
|
*
|
|
3393
3394
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -3412,7 +3413,7 @@ return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize
|
|
|
3412
3413
|
* @param {any} pRootDataObject - The root data object to resolve (optional)
|
|
3413
3414
|
*
|
|
3414
3415
|
* @return {any} The value at the given address, or undefined
|
|
3415
|
-
*/},{key:"resolveStateFromAddress",value:function resolveStateFromAddress(pAddress,pRecord,pContextArray,pRootDataObject){var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this.pict];var tmpRootDataObject=_typeof(pRootDataObject)==='object'?pRootDataObject:{};tmpRootDataObject.Pict=this.pict;tmpRootDataObject.AppData=this.pict.AppData;tmpRootDataObject.Bundle=this.pict.Bundle;tmpRootDataObject.Context=tmpContextArray;tmpRootDataObject.Record=pRecord;return this.pict.manifest.getValueByHash(tmpRootDataObject,pAddress);}}]);}(libFableServiceBase);module.exports=PictTemplateExpression;module.exports.template_hash='Default';},{"../package.json":142,"fable-serviceproviderbase":
|
|
3416
|
+
*/},{key:"resolveStateFromAddress",value:function resolveStateFromAddress(pAddress,pRecord,pContextArray,pRootDataObject){var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this.pict];var tmpRootDataObject=_typeof(pRootDataObject)==='object'?pRootDataObject:{};tmpRootDataObject.Pict=this.pict;tmpRootDataObject.AppData=this.pict.AppData;tmpRootDataObject.Bundle=this.pict.Bundle;tmpRootDataObject.Context=tmpContextArray;tmpRootDataObject.Record=pRecord;return this.pict.manifest.getValueByHash(tmpRootDataObject,pAddress);}}]);}(libFableServiceBase);module.exports=PictTemplateExpression;module.exports.template_hash='Default';},{"../package.json":142,"fable-serviceproviderbase":59}],144:[function(require,module,exports){module.exports={"name":"pict-view","version":"1.0.60","description":"Pict View Base Class","main":"source/Pict-View.js","scripts":{"test":"./node_modules/.bin/mocha -u tdd -R spec","start":"node source/Pict-View.js","coverage":"./node_modules/.bin/nyc --reporter=lcov --reporter=text-lcov ./node_modules/mocha/bin/_mocha -- -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-view-image:local","docker-dev-run":"docker run -it -d --name pict-view-dev -p 30001:8080 -p 38086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict-view\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-view-image:local","docker-dev-shell":"docker exec -it pict-view-dev /bin/bash","types":"tsc -p .","lint":"eslint source/**"},"types":"types/source/Pict-View.d.ts","repository":{"type":"git","url":"git+https://github.com/stevenvelozo/pict-view.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/pict-view/issues"},"homepage":"https://github.com/stevenvelozo/pict-view#readme","devDependencies":{"@eslint/js":"^9.17.0","browser-env":"^3.3.0","eslint":"^9.17.0","pict":"^1.0.238","quackage":"^1.0.41","typescript":"^5.7.2"},"mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"dependencies":{"fable":"^3.1.3","fable-serviceproviderbase":"^3.0.15"}};},{}],145:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var libPackage=require('../package.json');var defaultPictViewSettings={DefaultRenderable:false,DefaultDestinationAddress:false,DefaultTemplateRecordAddress:false,ViewIdentifier:false,// If this is set to true, when the App initializes this will.
|
|
3416
3417
|
// After the App initializes, initialize will be called as soon as it's added.
|
|
3417
3418
|
AutoInitialize:true,AutoInitializeOrdinal:0,// If this is set to true, when the App autorenders (on load) this will.
|
|
3418
3419
|
// After the App initializes, render will be called as soon as it's added.
|
|
@@ -3429,25 +3430,25 @@ AutoRender:true,AutoRenderOrdinal:0,AutoSolveWithApp:true,AutoSolveOrdinal:0,CSS
|
|
|
3429
3430
|
* @property {string} [TestAddress] - The address to use for testing the renderable.
|
|
3430
3431
|
*//**
|
|
3431
3432
|
* Represents a view in the Pict ecosystem.
|
|
3432
|
-
*/var PictView=/*#__PURE__*/function(
|
|
3433
|
+
*/var PictView=/*#__PURE__*/function(_libFableServiceBase18){/**
|
|
3433
3434
|
* @param {any} pFable - The Fable object that this service is attached to.
|
|
3434
3435
|
* @param {any} [pOptions] - (optional) The options for this service.
|
|
3435
3436
|
* @param {string} [pServiceHash] - (optional) The hash of the service.
|
|
3436
|
-
*/function PictView(pFable,pOptions,pServiceHash){var
|
|
3437
|
-
var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictViewSettings)),pOptions);
|
|
3438
|
-
/** @type {any} */
|
|
3439
|
-
/** @type {import('pict') & { log: any, instantiateServiceProviderWithoutRegistration: (hash: String) => any }} */
|
|
3440
|
-
|
|
3437
|
+
*/function PictView(pFable,pOptions,pServiceHash){var _this63;_classCallCheck2(this,PictView);// Intersect default options, parent constructor, service information
|
|
3438
|
+
var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictViewSettings)),pOptions);_this63=_callSuper(this,PictView,[pFable,tmpOptions,pServiceHash]);//FIXME: add types to fable and ancillaries
|
|
3439
|
+
/** @type {any} */_this63.fable;/** @type {any} */_this63.options;/** @type {String} */_this63.UUID;/** @type {String} */_this63.Hash;/** @type {any} */_this63.log;if(!_this63.options.ViewIdentifier){_this63.options.ViewIdentifier="AutoViewID-".concat(_this63.fable.getUUID());}_this63.serviceType='PictView';/** @type {Object} */_this63._Package=libPackage;// Convenience and consistency naming
|
|
3440
|
+
/** @type {import('pict') & { log: any, instantiateServiceProviderWithoutRegistration: (hash: String) => any }} */_this63.pict=_this63.fable;// Wire in the essential Pict application state
|
|
3441
|
+
_this63.AppData=_this63.pict.AppData;/** @type {PictTimestamp} */_this63.initializeTimestamp=false;/** @type {PictTimestamp} */_this63.lastSolvedTimestamp=false;/** @type {PictTimestamp} */_this63.lastRenderedTimestamp=false;/** @type {PictTimestamp} */_this63.lastMarshalFromViewTimestamp=false;/** @type {PictTimestamp} */_this63.lastMarshalToViewTimestamp=false;// Load all templates from the array in the options
|
|
3441
3442
|
// Templates are in the form of {Hash:'Some-Template-Hash',Template:'Template content',Source:'TemplateSource'}
|
|
3442
|
-
for(var i=0;i<
|
|
3443
|
+
for(var i=0;i<_this63.options.Templates.length;i++){var tmpTemplate=_this63.options.Templates[i];if(!('Hash'in tmpTemplate)||!('Template'in tmpTemplate)){_this63.log.error("PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.options.ViewIdentifier," could not load Template ").concat(i," in the options array."),tmpTemplate);}else{if(!tmpTemplate.Source){tmpTemplate.Source="PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.options.ViewIdentifier," options object.");}_this63.pict.TemplateProvider.addTemplate(tmpTemplate.Hash,tmpTemplate.Template,tmpTemplate.Source);}}// Load all default templates from the array in the options
|
|
3443
3444
|
// Templates are in the form of {Prefix:'',Postfix:'-List-Row',Template:'Template content',Source:'TemplateSourceString'}
|
|
3444
|
-
for(var
|
|
3445
|
-
if(
|
|
3445
|
+
for(var _i53=0;_i53<_this63.options.DefaultTemplates.length;_i53++){var tmpDefaultTemplate=_this63.options.DefaultTemplates[_i53];if(!('Postfix'in tmpDefaultTemplate)||!('Template'in tmpDefaultTemplate)){_this63.log.error("PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.options.ViewIdentifier," could not load Default Template ").concat(_i53," in the options array."),tmpDefaultTemplate);}else{if(!tmpDefaultTemplate.Source){tmpDefaultTemplate.Source="PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.options.ViewIdentifier," options object.");}_this63.pict.TemplateProvider.addDefaultTemplate(tmpDefaultTemplate.Prefix,tmpDefaultTemplate.Postfix,tmpDefaultTemplate.Template,tmpDefaultTemplate.Source);}}// Load the CSS if it's available
|
|
3446
|
+
if(_this63.options.CSS){var tmpCSSHash=_this63.options.CSSHash?_this63.options.CSSHash:"View-".concat(_this63.options.ViewIdentifier);var tmpCSSProvider=_this63.options.CSSProvider?_this63.options.CSSProvider:tmpCSSHash;_this63.pict.CSSMap.addCSS(tmpCSSHash,_this63.options.CSS,tmpCSSProvider,_this63.options.CSSPriority);}// Load all renderables
|
|
3446
3447
|
// Renderables are launchable renderable instructions with templates
|
|
3447
3448
|
// They look as such: {Identifier:'ContentEntry', TemplateHash:'Content-Entry-Section-Main', ContentDestinationAddress:'#ContentSection', RecordAddress:'AppData.Content.DefaultText', ManifestTransformation:'ManyfestHash', ManifestDestinationAddress:'AppData.Content.DataToTransformContent'}
|
|
3448
3449
|
// The only parts that are necessary are Identifier and Template
|
|
3449
3450
|
// A developer can then do render('ContentEntry') and it just kinda works. Or they can override the ContentDestinationAddress
|
|
3450
|
-
/** @type {Object<String, Renderable>} */
|
|
3451
|
+
/** @type {Object<String, Renderable>} */_this63.renderables={};for(var _i54=0;_i54<_this63.options.Renderables.length;_i54++){/** @type {Renderable} */var tmpRenderable=_this63.options.Renderables[_i54];_this63.addRenderable(tmpRenderable);}return _this63;}/**
|
|
3451
3452
|
* Adds a renderable to the view.
|
|
3452
3453
|
*
|
|
3453
3454
|
* @param {string | Renderable} pRenderableHash - The hash of the renderable, or a renderable object.
|
|
@@ -3455,7 +3456,7 @@ if(_this61.options.CSS){var tmpCSSHash=_this61.options.CSSHash?_this61.options.C
|
|
|
3455
3456
|
* @param {string} [pDefaultTemplateRecordAddress] - (optional) The default data address for the template.
|
|
3456
3457
|
* @param {string} [pDefaultDestinationAddress] - (optional) The default destination address for the renderable.
|
|
3457
3458
|
* @param {RenderMethod} [pRenderMethod=replace] - (optional) The method to use when rendering the renderable (ex. 'replace').
|
|
3458
|
-
*/_inherits(PictView,
|
|
3459
|
+
*/_inherits(PictView,_libFableServiceBase18);return _createClass2(PictView,[{key:"addRenderable",value:function addRenderable(pRenderableHash,pTemplateHash,pDefaultTemplateRecordAddress,pDefaultDestinationAddress,pRenderMethod){/** @type {Renderable} */var tmpRenderable;if(_typeof(pRenderableHash)=='object'){// The developer passed in the renderable as an object.
|
|
3459
3460
|
// Use theirs instead!
|
|
3460
3461
|
tmpRenderable=pRenderableHash;}else{/** @type {RenderMethod} */var tmpRenderMethod=typeof pRenderMethod!=='string'?pRenderMethod:'replace';tmpRenderable={RenderableHash:pRenderableHash,TemplateHash:pTemplateHash,DefaultTemplateRecordAddress:pDefaultTemplateRecordAddress,ContentDestinationAddress:pDefaultDestinationAddress,RenderMethod:tmpRenderMethod};}if(typeof tmpRenderable.RenderableHash!='string'||typeof tmpRenderable.TemplateHash!='string'){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Renderable; RenderableHash or TemplateHash are invalid."),tmpRenderable);}else{if(this.pict.LogNoisiness>0){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," adding renderable [").concat(tmpRenderable.RenderableHash,"] pointed to template ").concat(tmpRenderable.TemplateHash,"."));}this.renderables[tmpRenderable.RenderableHash]=tmpRenderable;}}/* -------------------------------------------------------------------------- *//* Code Section: Initialization *//* -------------------------------------------------------------------------- *//**
|
|
3461
3462
|
* Lifecycle hook that triggers before the view is initialized.
|
|
@@ -3475,7 +3476,7 @@ tmpRenderable=pRenderableHash;}else{/** @type {RenderMethod} */var tmpRenderMeth
|
|
|
3475
3476
|
* Performs view initialization (async flow).
|
|
3476
3477
|
*
|
|
3477
3478
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3478
|
-
*/},{key:"initializeAsync",value:function initializeAsync(fCallback){var
|
|
3479
|
+
*/},{key:"initializeAsync",value:function initializeAsync(fCallback){var _this64=this;if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initializeAsync:"));}if(!this.initializeTimestamp){var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');if(this.pict.LogNoisiness>0){this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," beginning initialization..."));}tmpAnticipate.anticipate(this.onBeforeInitializeAsync.bind(this));tmpAnticipate.anticipate(this.onInitializeAsync.bind(this));tmpAnticipate.anticipate(this.onAfterInitializeAsync.bind(this));tmpAnticipate.wait(/** @param {Error} pError */function(pError){if(pError){_this64.log.error("PictView [".concat(_this64.UUID,"]::[").concat(_this64.Hash,"] ").concat(_this64.options.ViewIdentifier," initialization failed: ").concat(pError.message||pError),{stack:pError.stack});}_this64.initializeTimestamp=_this64.pict.log.getTimeStamp();if(_this64.pict.LogNoisiness>0){_this64.log.info("PictView [".concat(_this64.UUID,"]::[").concat(_this64.Hash,"] ").concat(_this64.options.ViewIdentifier," initialization complete."));}return fCallback();});}else{this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," async initialize called but initialization is already completed. Aborting."));// TODO: Should this be an error?
|
|
3479
3480
|
return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterInitialize:"));}return true;}/**
|
|
3480
3481
|
* Lifecycle hook that triggers after the view is initialized (async flow).
|
|
3481
3482
|
*
|
|
@@ -3529,10 +3530,10 @@ this.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord,tmpConten
|
|
|
3529
3530
|
* @param {ErrorCallback} [fCallback] - The callback to call when the async operation is complete.
|
|
3530
3531
|
*
|
|
3531
3532
|
* @return {void}
|
|
3532
|
-
*/},{key:"renderAsync",value:function renderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var
|
|
3533
|
-
var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAddress==='function'?pTemplateRecordAddress:typeof pRenderDestinationAddress==='function'?pRenderDestinationAddress:typeof pRenderableHash==='function'?pRenderableHash:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){
|
|
3534
|
-
|
|
3535
|
-
|
|
3533
|
+
*/},{key:"renderAsync",value:function renderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var _this65=this;var tmpRenderableHash=typeof pRenderableHash==='string'?pRenderableHash:typeof this.options.DefaultRenderable=='string'?this.options.DefaultRenderable:false;// Allow the callback to be passed in as the last parameter no matter what
|
|
3534
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAddress==='function'?pTemplateRecordAddress:typeof pRenderDestinationAddress==='function'?pRenderDestinationAddress:typeof pRenderableHash==='function'?pRenderableHash:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this65.log.error("PictView [".concat(_this65.UUID,"]::[").concat(_this65.Hash,"] ").concat(_this65.options.Name," renderAsync Auto Callback Error: ").concat(pError),pError);}};}if(!tmpRenderableHash){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,"because it is not a valid renderable."));return tmpCallback(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,"because it is not a valid renderable.")));}var tmpRenderable;if(tmpRenderableHash=='__Virtual'){tmpRenderable={RenderableHash:'__Virtual',TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,DestinationAddress:pRenderDestinationAddress,RenderMethod:'virtual-assignment'};}else{tmpRenderable=this.renderables[tmpRenderableHash];}if(!tmpRenderable){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,") because it does not exist."));return tmpCallback(Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,") because it does not exist.")));}var tmpRenderDestinationAddress=typeof pRenderDestinationAddress==='string'?pRenderDestinationAddress:typeof tmpRenderable.ContentDestinationAddress==='string'?tmpRenderable.ContentDestinationAddress:typeof this.options.DefaultDestinationAddress==='string'?this.options.DefaultDestinationAddress:false;if(!tmpRenderDestinationAddress){this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,") because it does not have a valid destination address."));return tmpCallback(Error("Could not render ".concat(tmpRenderableHash)));}var tmpRecordAddress;var tmpRecord;if(_typeof(pTemplateRecordAddress)==='object'){tmpRecord=pTemplateRecordAddress;tmpRecordAddress='Passed in as object';}else{tmpRecordAddress=typeof pTemplateRecordAddress==='string'?pTemplateRecordAddress:typeof tmpRenderable.DefaultTemplateRecordAddress==='string'?tmpRenderable.DefaultTemplateRecordAddress:typeof this.options.DefaultTemplateRecordAddress==='string'?this.options.DefaultTemplateRecordAddress:false;tmpRecord=typeof tmpRecordAddress==='string'?this.pict.DataProvider.getDataByAddress(tmpRecordAddress):undefined;}if(this.pict.LogControlFlow){this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] Renderable[").concat(tmpRenderableHash,"] Destination[").concat(tmpRenderDestinationAddress,"] TemplateRecordAddress[").concat(tmpRecordAddress,"] renderAsync:"));}if(this.pict.LogNoisiness>2){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Beginning Asynchronous Render (callback-style)..."));}var tmpAnticipate=this.fable.newAnticipate();tmpAnticipate.anticipate(function(fOnBeforeRenderCallback){_this65.onBeforeRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord);_this65.onBeforeRenderAsync(fOnBeforeRenderCallback);});var tmpContent;tmpAnticipate.anticipate(function(fAsyncTemplateCallback){// Render the template (asynchronously)
|
|
3535
|
+
_this65.pict.parseTemplateByHash(tmpRenderable.TemplateHash,tmpRecord,function(pError,pContent){if(pError){_this65.log.error("PictView [".concat(_this65.UUID,"]::[").concat(_this65.Hash,"] ").concat(_this65.options.ViewIdentifier," could not render (asynchronously) ").concat(tmpRenderableHash," (param ").concat(pRenderableHash,") because it did not parse the template."),pError);return fAsyncTemplateCallback(pError);}tmpContent=pContent;if(_this65.pict.LogNoisiness>0){_this65.log.trace("PictView [".concat(_this65.UUID,"]::[").concat(_this65.Hash,"] ").concat(_this65.options.ViewIdentifier," Assigning Renderable[").concat(tmpRenderableHash,"] content length ").concat(pContent.length," to Destination [").concat(tmpRenderDestinationAddress,"] using Async render method ").concat(tmpRenderable.RenderMethod,"."));}_this65.pict.ContentAssignment.projectContent(tmpRenderable.RenderMethod,tmpRenderDestinationAddress,pContent,tmpRenderable.TestAddress);// Execute the developer-overridable asynchronous post-render behavior
|
|
3536
|
+
_this65.lastRenderedTimestamp=_this65.pict.log.getTimeStamp();return fAsyncTemplateCallback();},[_this65]);});tmpAnticipate.anticipate(function(fOnAfterRenderCallback){_this65.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord,tmpContent);_this65.onAfterRenderAsync(fOnAfterRenderCallback);});tmpAnticipate.wait(tmpCallback);}/**
|
|
3536
3537
|
* Renders the default renderable.
|
|
3537
3538
|
*
|
|
3538
3539
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
@@ -3546,8 +3547,8 @@ this.renderAsync(fCallback);}/**
|
|
|
3546
3547
|
* @param {string|ErrorCallback} [pRenderDestinationAddress] - The address where the renderable will be rendered.
|
|
3547
3548
|
* @param {string|object|ErrorCallback} [pTemplateRecordAddress] - The address of (or actual obejct) where the data for the template is stored.
|
|
3548
3549
|
* @param {ErrorCallback} [fCallback] - The callback to call when the async operation is complete.
|
|
3549
|
-
*/},{key:"basicRenderAsync",value:function basicRenderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var
|
|
3550
|
-
var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAddress==='function'?pTemplateRecordAddress:typeof pRenderDestinationAddress==='function'?pRenderDestinationAddress:typeof pRenderableHash==='function'?pRenderableHash:false;var tmpRenderOptions=this.buildRenderOptions(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress);if(tmpRenderOptions.Valid){this.pict.parseTemplateByHash(tmpRenderOptions.Renderable.TemplateHash,tmpRenderOptions.Record,function(pError,pContent){if(pError){
|
|
3550
|
+
*/},{key:"basicRenderAsync",value:function basicRenderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var _this66=this;// Allow the callback to be passed in as the last parameter no matter what
|
|
3551
|
+
var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAddress==='function'?pTemplateRecordAddress:typeof pRenderDestinationAddress==='function'?pRenderDestinationAddress:typeof pRenderableHash==='function'?pRenderableHash:false;var tmpRenderOptions=this.buildRenderOptions(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress);if(tmpRenderOptions.Valid){this.pict.parseTemplateByHash(tmpRenderOptions.Renderable.TemplateHash,tmpRenderOptions.Record,function(pError,pContent){if(pError){_this66.log.error("PictView [".concat(_this66.UUID,"]::[").concat(_this66.Hash,"] ").concat(_this66.options.ViewIdentifier," could not render (asynchronously) ").concat(tmpRenderOptions.RenderableHash," because it did not parse the template."),pError);return tmpCallback(pError);}_this66.assignRenderContent(tmpRenderOptions.Renderable,tmpRenderOptions.DestinationAddress,pContent);return tmpCallback();},[this]);}else{var tmpErrorMessage="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not perform a basic render of ").concat(tmpRenderOptions.RenderableHash," because it is not valid.");this.log.error(tmpErrorMessage);return tmpCallback(tmpErrorMessage);}}/**
|
|
3551
3552
|
* Lifecycle hook that triggers after the view is rendered.
|
|
3552
3553
|
*
|
|
3553
3554
|
* @param {Renderable} pRenderable - The renderable that was rendered.
|
|
@@ -3578,7 +3579,7 @@ var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAd
|
|
|
3578
3579
|
* Performs view solving and triggers lifecycle hooks (async flow).
|
|
3579
3580
|
*
|
|
3580
3581
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3581
|
-
*/},{key:"solveAsync",value:function solveAsync(fCallback){var
|
|
3582
|
+
*/},{key:"solveAsync",value:function solveAsync(fCallback){var _this67=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this67.log.error("PictView [".concat(_this67.UUID,"]::[").concat(_this67.Hash,"] ").concat(_this67.options.Name," solveAsync Auto Callback Error: ").concat(pError),pError);}};}tmpAnticipate.anticipate(this.onBeforeSolveAsync.bind(this));tmpAnticipate.anticipate(this.onSolveAsync.bind(this));tmpAnticipate.anticipate(this.onAfterSolveAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this67.pict.LogNoisiness>2){_this67.log.trace("PictView [".concat(_this67.UUID,"]::[").concat(_this67.Hash,"] ").concat(_this67.options.ViewIdentifier," solveAsync() complete."));}_this67.lastSolvedTimestamp=_this67.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3582
3583
|
* Lifecycle hook that triggers after the view is solved.
|
|
3583
3584
|
*/},{key:"onAfterSolve",value:function onAfterSolve(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterSolve:"));}return true;}/**
|
|
3584
3585
|
* Lifecycle hook that triggers after the view is solved (async flow).
|
|
@@ -3606,7 +3607,7 @@ var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAd
|
|
|
3606
3607
|
* Marshals data from the view (async flow).
|
|
3607
3608
|
*
|
|
3608
3609
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3609
|
-
*/},{key:"marshalFromViewAsync",value:function marshalFromViewAsync(fCallback){var
|
|
3610
|
+
*/},{key:"marshalFromViewAsync",value:function marshalFromViewAsync(fCallback){var _this68=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this68.log.error("PictView [".concat(_this68.UUID,"]::[").concat(_this68.Hash,"] ").concat(_this68.options.Name," marshalFromViewAsync Auto Callback Error: ").concat(pError),pError);}};}tmpAnticipate.anticipate(this.onBeforeMarshalFromViewAsync.bind(this));tmpAnticipate.anticipate(this.onMarshalFromViewAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalFromViewAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this68.pict.LogNoisiness>2){_this68.log.trace("PictView [".concat(_this68.UUID,"]::[").concat(_this68.Hash,"] ").concat(_this68.options.ViewIdentifier," marshalFromViewAsync() complete."));}_this68.lastMarshalFromViewTimestamp=_this68.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3610
3611
|
* Lifecycle hook that triggers after data is marshaled from the view.
|
|
3611
3612
|
*/},{key:"onAfterMarshalFromView",value:function onAfterMarshalFromView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalFromView:"));}return true;}/**
|
|
3612
3613
|
* Lifecycle hook that triggers after data is marshaled from the view (async flow).
|
|
@@ -3632,13 +3633,13 @@ var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAd
|
|
|
3632
3633
|
* Marshals data into the view (async flow).
|
|
3633
3634
|
*
|
|
3634
3635
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3635
|
-
*/},{key:"marshalToViewAsync",value:function marshalToViewAsync(fCallback){var
|
|
3636
|
+
*/},{key:"marshalToViewAsync",value:function marshalToViewAsync(fCallback){var _this69=this;var tmpAnticipate=this.pict.instantiateServiceProviderWithoutRegistration('Anticipate');var tmpCallback=typeof fCallback==='function'?fCallback:false;if(!tmpCallback){this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions."));tmpCallback=function tmpCallback(pError){if(pError){_this69.log.error("PictView [".concat(_this69.UUID,"]::[").concat(_this69.Hash,"] ").concat(_this69.options.Name," marshalToViewAsync Auto Callback Error: ").concat(pError),pError);}};}tmpAnticipate.anticipate(this.onBeforeMarshalToViewAsync.bind(this));tmpAnticipate.anticipate(this.onMarshalToViewAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalToViewAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this69.pict.LogNoisiness>2){_this69.log.trace("PictView [".concat(_this69.UUID,"]::[").concat(_this69.Hash,"] ").concat(_this69.options.ViewIdentifier," marshalToViewAsync() complete."));}_this69.lastMarshalToViewTimestamp=_this69.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3636
3637
|
* Lifecycle hook that triggers after data is marshaled into the view.
|
|
3637
3638
|
*/},{key:"onAfterMarshalToView",value:function onAfterMarshalToView(){if(this.pict.LogNoisiness>3){this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalToView:"));}return true;}/**
|
|
3638
3639
|
* Lifecycle hook that triggers after data is marshaled into the view (async flow).
|
|
3639
3640
|
*
|
|
3640
3641
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3641
|
-
*/},{key:"onAfterMarshalToViewAsync",value:function onAfterMarshalToViewAsync(fCallback){this.onAfterMarshalToView();return fCallback();}/** @return {boolean} - True if the object is a PictView. */},{key:"isPictView",get:function get(){return true;}}]);}(libFableServiceBase);module.exports=PictView;},{"../package.json":144,"fable-serviceproviderbase":
|
|
3642
|
+
*/},{key:"onAfterMarshalToViewAsync",value:function onAfterMarshalToViewAsync(fCallback){this.onAfterMarshalToView();return fCallback();}/** @return {boolean} - True if the object is a PictView. */},{key:"isPictView",get:function get(){return true;}}]);}(libFableServiceBase);module.exports=PictView;},{"../package.json":144,"fable-serviceproviderbase":59}],146:[function(require,module,exports){/**
|
|
3642
3643
|
* Precedent Meta-Templating
|
|
3643
3644
|
*
|
|
3644
3645
|
* @license MIT
|
|
@@ -3741,7 +3742,7 @@ this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserS
|
|
|
3741
3742
|
* @param {function} fParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
|
|
3742
3743
|
* @return {bool} True if adding the pattern was successful
|
|
3743
3744
|
*/},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser){if(pPatternStart.length<1){return false;}if(typeof pPatternEnd==='string'&&pPatternEnd.length<1){return false;}var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
|
|
3744
|
-
for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!tmpLeaf.hasOwnProperty('PatternEnd')){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var
|
|
3745
|
+
for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!tmpLeaf.hasOwnProperty('PatternEnd')){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i55=0;_i55<tmpPatternEnd.length;_i55++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i55],_i55);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(){return fParser;}:function(pData){return pData;};return true;}}]);}();module.exports=WordTree;},{}],149:[function(require,module,exports){// shim for using process in browser
|
|
3745
3746
|
var process=module.exports={};// cached from whatever global is present so that test runners that stub it
|
|
3746
3747
|
// don't break things. But we need to wrap it in a try catch in case it is
|
|
3747
3748
|
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
@@ -4013,13 +4014,13 @@ key:key,next:objects.next,value:value};}};/** @type {import('./list.d.ts').listH
|
|
|
4013
4014
|
var listDelete=function listDelete(objects,key){if(objects){return listGetNode(objects,key,true);}};/** @type {import('.')} */module.exports=function getSideChannelList(){/** @typedef {ReturnType<typeof getSideChannelList>} Channel *//** @typedef {Parameters<Channel['get']>[0]} K *//** @typedef {Parameters<Channel['set']>[1]} V *//** @type {import('./list.d.ts').RootNode<V, K> | undefined} */var $o;/** @type {Channel} */var channel={assert:function assert(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function _delete(key){var root=$o&&$o.next;var deletedNode=listDelete($o,key);if(deletedNode&&root&&root===deletedNode){$o=void undefined;}return!!deletedNode;},get:function get(key){return listGet($o,key);},has:function has(key){return listHas($o,key);},set:function set(key,value){if(!$o){// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
|
|
4014
4015
|
$o={next:void undefined};}// eslint-disable-next-line no-extra-parens
|
|
4015
4016
|
listSet(/** @type {NonNullable<typeof $o>} */$o,key,value);}};// @ts-expect-error TODO: figure out why this is erroring
|
|
4016
|
-
return channel;};},{"es-errors/type":
|
|
4017
|
+
return channel;};},{"es-errors/type":47,"object-inspect":135}],161:[function(require,module,exports){'use strict';var GetIntrinsic=require('get-intrinsic');var callBound=require('call-bound');var inspect=require('object-inspect');var $TypeError=require('es-errors/type');var $Map=GetIntrinsic('%Map%',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */var $mapGet=callBound('Map.prototype.get',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */var $mapSet=callBound('Map.prototype.set',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */var $mapHas=callBound('Map.prototype.has',true);/** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */var $mapDelete=callBound('Map.prototype.delete',true);/** @type {<K, V>(thisArg: Map<K, V>) => number} */var $mapSize=callBound('Map.prototype.size',true);/** @type {import('.')} */module.exports=!!$Map&&/** @type {Exclude<import('.'), false>} */function getSideChannelMap(){/** @typedef {ReturnType<typeof getSideChannelMap>} Channel *//** @typedef {Parameters<Channel['get']>[0]} K *//** @typedef {Parameters<Channel['set']>[1]} V *//** @type {Map<K, V> | undefined} */var $m;/** @type {Channel} */var channel={assert:function assert(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function _delete(key){if($m){var result=$mapDelete($m,key);if($mapSize($m)===0){$m=void undefined;}return result;}return false;},get:function get(key){// eslint-disable-line consistent-return
|
|
4017
4018
|
if($m){return $mapGet($m,key);}},has:function has(key){if($m){return $mapHas($m,key);}return false;},set:function set(key,value){if(!$m){// @ts-expect-error TS can't handle narrowing a variable inside a closure
|
|
4018
4019
|
$m=new $Map();}$mapSet($m,key,value);}};// @ts-expect-error TODO: figure out why TS is erroring here
|
|
4019
|
-
return channel;};},{"call-bound":30,"es-errors/type":
|
|
4020
|
+
return channel;};},{"call-bound":30,"es-errors/type":47,"get-intrinsic":103,"object-inspect":135}],162:[function(require,module,exports){'use strict';var GetIntrinsic=require('get-intrinsic');var callBound=require('call-bound');var inspect=require('object-inspect');var getSideChannelMap=require('side-channel-map');var $TypeError=require('es-errors/type');var $WeakMap=GetIntrinsic('%WeakMap%',true);/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */var $weakMapGet=callBound('WeakMap.prototype.get',true);/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */var $weakMapSet=callBound('WeakMap.prototype.set',true);/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */var $weakMapHas=callBound('WeakMap.prototype.has',true);/** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */var $weakMapDelete=callBound('WeakMap.prototype.delete',true);/** @type {import('.')} */module.exports=$WeakMap?/** @type {Exclude<import('.'), false>} */function getSideChannelWeakMap(){/** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel *//** @typedef {Parameters<Channel['get']>[0]} K *//** @typedef {Parameters<Channel['set']>[1]} V *//** @type {WeakMap<K & object, V> | undefined} */var $wm;/** @type {Channel | undefined} */var $m;/** @type {Channel} */var channel={assert:function assert(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function _delete(key){if($WeakMap&&key&&(_typeof(key)==='object'||typeof key==='function')){if($wm){return $weakMapDelete($wm,key);}}else if(getSideChannelMap){if($m){return $m['delete'](key);}}return false;},get:function get(key){if($WeakMap&&key&&(_typeof(key)==='object'||typeof key==='function')){if($wm){return $weakMapGet($wm,key);}}return $m&&$m.get(key);},has:function has(key){if($WeakMap&&key&&(_typeof(key)==='object'||typeof key==='function')){if($wm){return $weakMapHas($wm,key);}}return!!$m&&$m.has(key);},set:function set(key,value){if($WeakMap&&key&&(_typeof(key)==='object'||typeof key==='function')){if(!$wm){$wm=new $WeakMap();}$weakMapSet($wm,key,value);}else if(getSideChannelMap){if(!$m){$m=getSideChannelMap();}// eslint-disable-next-line no-extra-parens
|
|
4020
4021
|
/** @type {NonNullable<typeof $m>} */$m.set(key,value);}}};// @ts-expect-error TODO: figure out why this is erroring
|
|
4021
|
-
return channel;}:getSideChannelMap;},{"call-bound":30,"es-errors/type":
|
|
4022
|
-
return channel;};},{"es-errors/type":
|
|
4022
|
+
return channel;}:getSideChannelMap;},{"call-bound":30,"es-errors/type":47,"get-intrinsic":103,"object-inspect":135,"side-channel-map":161}],163:[function(require,module,exports){'use strict';var $TypeError=require('es-errors/type');var inspect=require('object-inspect');var getSideChannelList=require('side-channel-list');var getSideChannelMap=require('side-channel-map');var getSideChannelWeakMap=require('side-channel-weakmap');var makeChannel=getSideChannelWeakMap||getSideChannelMap||getSideChannelList;/** @type {import('.')} */module.exports=function getSideChannel(){/** @typedef {ReturnType<typeof getSideChannel>} Channel *//** @type {Channel | undefined} */var $channelData;/** @type {Channel} */var channel={assert:function assert(key){if(!channel.has(key)){throw new $TypeError('Side channel does not contain '+inspect(key));}},'delete':function _delete(key){return!!$channelData&&$channelData['delete'](key);},get:function get(key){return $channelData&&$channelData.get(key);},has:function has(key){return!!$channelData&&$channelData.has(key);},set:function set(key,value){if(!$channelData){$channelData=makeChannel();}$channelData.set(key,value);}};// @ts-expect-error TODO: figure out why this is erroring
|
|
4023
|
+
return channel;};},{"es-errors/type":47,"object-inspect":135,"side-channel-list":160,"side-channel-map":161,"side-channel-weakmap":162}],164:[function(require,module,exports){(function(Buffer){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */module.exports=function(stream,cb){var chunks=[];stream.on('data',function(chunk){chunks.push(chunk);});stream.once('end',function(){if(cb)cb(null,Buffer.concat(chunks));cb=null;});stream.once('error',function(err){if(cb)cb(err);cb=null;});};}).call(this);}).call(this,require("buffer").Buffer);},{"buffer":20}],165:[function(require,module,exports){(function(Buffer){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */module.exports=simpleGet;var concat=require('simple-concat');var decompressResponse=require('decompress-response');// excluded from browser build
|
|
4023
4024
|
var http=require('http');var https=require('https');var once=require('once');var querystring=require('querystring');var url=require('url');var isStream=function isStream(o){return o!==null&&_typeof(o)==='object'&&typeof o.pipe==='function';};function simpleGet(opts,cb){opts=Object.assign({maxRedirects:10},typeof opts==='string'?{url:opts}:opts);cb=once(cb);if(opts.url){var _url$parse=url.parse(opts.url),hostname=_url$parse.hostname,port=_url$parse.port,_protocol=_url$parse.protocol,auth=_url$parse.auth,path=_url$parse.path;// eslint-disable-line node/no-deprecated-api
|
|
4024
4025
|
delete opts.url;if(!hostname&&!port&&!_protocol&&!auth)opts.path=path;// Relative redirect
|
|
4025
4026
|
else Object.assign(opts,{hostname:hostname,port:port,protocol:_protocol,auth:auth,path:path});// Absolute redirect
|
|
@@ -4403,7 +4404,7 @@ if(state.decoder)ret=state.buffer.join('');else if(state.buffer.length===1)ret=s
|
|
|
4403
4404
|
ret=state.buffer.consume(n,state.decoder);}return ret;}function endReadable(stream){var state=stream._readableState;debug('endReadable',state.endEmitted);if(!state.endEmitted){state.ended=true;process.nextTick(endReadableNT,state,stream);}}function endReadableNT(state,stream){debug('endReadableNT',state.endEmitted,state.length);// Check that we didn't get one last unshift.
|
|
4404
4405
|
if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit('end');if(state.autoDestroy){// In case of duplex streams we need a way to detect
|
|
4405
4406
|
// if the writable side is ready for autoDestroy as well
|
|
4406
|
-
var wState=stream._writableState;if(!wState||wState.autoDestroy&&wState.finished){stream.destroy();}}}}if(typeof Symbol==='function'){Readable.from=function(iterable,opts){if(from===undefined){from=require('./internal/streams/from');}return from(Readable,iterable,opts);};}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i;}return-1;}}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":170,"./_stream_duplex":171,"./internal/streams/async_iterator":176,"./internal/streams/buffer_list":177,"./internal/streams/destroy":178,"./internal/streams/from":180,"./internal/streams/state":182,"./internal/streams/stream":183,"_process":149,"buffer":20,"events":
|
|
4407
|
+
var wState=stream._writableState;if(!wState||wState.autoDestroy&&wState.finished){stream.destroy();}}}}if(typeof Symbol==='function'){Readable.from=function(iterable,opts){if(from===undefined){from=require('./internal/streams/from');}return from(Readable,iterable,opts);};}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i;}return-1;}}).call(this);}).call(this,require('_process'),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"../errors":170,"./_stream_duplex":171,"./internal/streams/async_iterator":176,"./internal/streams/buffer_list":177,"./internal/streams/destroy":178,"./internal/streams/from":180,"./internal/streams/state":182,"./internal/streams/stream":183,"_process":149,"buffer":20,"events":50,"inherits":114,"string_decoder/":185,"util":18}],174:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
4407
4408
|
//
|
|
4408
4409
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
4409
4410
|
// copy of this software and associated documentation files (the
|
|
@@ -4672,7 +4673,7 @@ stream.on('end',onlegacyfinish);stream.on('close',onlegacyfinish);}stream.on('en
|
|
|
4672
4673
|
'use strict';var eos;function once(callback){var called=false;return function(){if(called)return;called=true;callback.apply(void 0,arguments);};}var _require$codes=require('../../../errors').codes,ERR_MISSING_ARGS=_require$codes.ERR_MISSING_ARGS,ERR_STREAM_DESTROYED=_require$codes.ERR_STREAM_DESTROYED;function noop(err){// Rethrow the error if it exists to avoid swallowing it
|
|
4673
4674
|
if(err)throw err;}function isRequest(stream){return stream.setHeader&&typeof stream.abort==='function';}function destroyer(stream,reading,writing,callback){callback=once(callback);var closed=false;stream.on('close',function(){closed=true;});if(eos===undefined)eos=require('./end-of-stream');eos(stream,{readable:reading,writable:writing},function(err){if(err)return callback(err);closed=true;callback();});var destroyed=false;return function(err){if(closed)return;if(destroyed)return;destroyed=true;// request.destroy just do .end - .abort is what we want
|
|
4674
4675
|
if(isRequest(stream))return stream.abort();if(typeof stream.destroy==='function')return stream.destroy();callback(err||new ERR_STREAM_DESTROYED('pipe'));};}function call(fn){fn();}function pipe(from,to){return from.pipe(to);}function popCallback(streams){if(!streams.length)return noop;if(typeof streams[streams.length-1]!=='function')return noop;return streams.pop();}function pipeline(){for(var _len=arguments.length,streams=new Array(_len),_key=0;_key<_len;_key++){streams[_key]=arguments[_key];}var callback=popCallback(streams);if(Array.isArray(streams[0]))streams=streams[0];if(streams.length<2){throw new ERR_MISSING_ARGS('streams');}var error;var destroys=streams.map(function(stream,i){var reading=i<streams.length-1;var writing=i>0;return destroyer(stream,reading,writing,function(err){if(!error)error=err;if(err)destroys.forEach(call);if(reading)return;destroys.forEach(call);callback(error);});});return streams.reduce(pipe);}module.exports=pipeline;},{"../../../errors":170,"./end-of-stream":179}],182:[function(require,module,exports){'use strict';var ERR_INVALID_OPT_VALUE=require('../../../errors').codes.ERR_INVALID_OPT_VALUE;function highWaterMarkFrom(options,isDuplex,duplexKey){return options.highWaterMark!=null?options.highWaterMark:isDuplex?options[duplexKey]:null;}function getHighWaterMark(state,options,duplexKey,isDuplex){var hwm=highWaterMarkFrom(options,isDuplex,duplexKey);if(hwm!=null){if(!(isFinite(hwm)&&Math.floor(hwm)===hwm)||hwm<0){var name=isDuplex?duplexKey:'highWaterMark';throw new ERR_INVALID_OPT_VALUE(name,hwm);}return Math.floor(hwm);}// Default value
|
|
4675
|
-
return state.objectMode?16:16*1024;}module.exports={getHighWaterMark:getHighWaterMark};},{"../../../errors":170}],183:[function(require,module,exports){module.exports=require('events').EventEmitter;},{"events":
|
|
4676
|
+
return state.objectMode?16:16*1024;}module.exports={getHighWaterMark:getHighWaterMark};},{"../../../errors":170}],183:[function(require,module,exports){module.exports=require('events').EventEmitter;},{"events":50}],184:[function(require,module,exports){exports=module.exports=require('./lib/_stream_readable.js');exports.Stream=exports;exports.Readable=exports;exports.Writable=require('./lib/_stream_writable.js');exports.Duplex=require('./lib/_stream_duplex.js');exports.Transform=require('./lib/_stream_transform.js');exports.PassThrough=require('./lib/_stream_passthrough.js');exports.finished=require('./lib/internal/streams/end-of-stream.js');exports.pipeline=require('./lib/internal/streams/pipeline.js');},{"./lib/_stream_duplex.js":171,"./lib/_stream_passthrough.js":172,"./lib/_stream_readable.js":173,"./lib/_stream_transform.js":174,"./lib/_stream_writable.js":175,"./lib/internal/streams/end-of-stream.js":179,"./lib/internal/streams/pipeline.js":181}],185:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
4676
4677
|
//
|
|
4677
4678
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
4678
4679
|
// copy of this software and associated documentation files (the
|
|
@@ -4940,7 +4941,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
4940
4941
|
// presumably different callback function.
|
|
4941
4942
|
// This makes sure that own properties are retained, so that
|
|
4942
4943
|
// decorations and such are not lost along the way.
|
|
4943
|
-
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],190:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],191:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.
|
|
4944
|
+
module.exports=wrappy;function wrappy(fn,cb){if(fn&&cb)return wrappy(fn)(cb);if(typeof fn!=='function')throw new TypeError('need wrapper function');Object.keys(fn).forEach(function(k){wrapper[k]=fn[k];});return wrapper;function wrapper(){var args=new Array(arguments.length);for(var i=0;i<args.length;i++){args[i]=arguments[i];}var ret=fn.apply(this,args);var cb=args[args.length-1];if(typeof ret==='function'&&ret!==cb){Object.keys(cb).forEach(function(k){ret[k]=cb[k];});}return ret;}}},{}],190:[function(require,module,exports){module.exports=extend;var hasOwnProperty=Object.prototype.hasOwnProperty;function extend(){var target={};for(var i=0;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;}},{}],191:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.252","description":"Pict browser library.","main":"source/Pict.js","scripts":{"start":"node source/Pict.js","test":"npx mocha -u tdd -R spec","tests":"npx mocha -u tdd --exit -R spec --grep","coverage":"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec","build":"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-image:local","docker-dev-run":"docker run -it -d --name pict-dev -p 37447:8080 -p 19506:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/pict\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" pict-image:local","docker-dev-shell":"docker exec -it pict-dev /bin/bash","lint":"eslint source/**/*.js test/**/*.js","types":"tsc -p ."},"types":"types/source/Pict.d.ts","mocha":{"diff":true,"extension":["js"],"package":"./package.json","reporter":"spec","slow":"75","timeout":"5000","ui":"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},"repository":{"type":"git","url":"git+https://stevenvelozo@github.com/stevenvelozo/pict.git"},"author":"steven velozo <steven@velozo.com>","license":"MIT","bugs":{"url":"https://github.com/stevenvelozo/pict/issues"},"homepage":"https://github.com/stevenvelozo/pict#readme","devDependencies":{"@eslint/js":"^9.27.0","@types/jquery":"^3.5.32","eslint":"^9.27.0","globals":"^16.1.0","quackage":"^1.0.41"},"dependencies":{"cachetrax":"^1.0.4","fable":"^3.1.10","pict-application":"^1.0.25","pict-provider":"^1.0.3","pict-template":"^1.0.10","pict-view":"^1.0.60","typescript":"^5.8.3"}};},{}],192:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
|
|
4944
4945
|
/* global Pict, _Pict: writeable *//**
|
|
4945
4946
|
* Simple function to load a pict Application
|
|
4946
4947
|
*
|
|
@@ -4955,64 +4956,64 @@ if(pPictApplication&&_typeof(pPictApplication['default_configuration'])==='objec
|
|
|
4955
4956
|
if(document.readyState!='loading')fCallback();// Modern browsers have event listener capabilities
|
|
4956
4957
|
else if(document.addEventListener)document.addEventListener('DOMContentLoaded',function(){fCallback();});//@ts-ignore IE <= 8 and ... other abominations
|
|
4957
4958
|
else document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete')fCallback();});};},{}],194:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var defaultConfiguration={// This is the address for the <script /> tag that contains the CSS.
|
|
4958
|
-
CSSElementAddress:'#PICT-CSS'};var PictCSS=/*#__PURE__*/function(
|
|
4959
|
-
if(typeof
|
|
4959
|
+
CSSElementAddress:'#PICT-CSS'};var PictCSS=/*#__PURE__*/function(_libFableServiceBase19){function PictCSS(pFable,pOptions,pServiceHash){var _this70;_classCallCheck2(this,PictCSS);_this70=_callSuper(this,PictCSS,[pFable,pOptions,pServiceHash]);/** @type {any} */_this70.options;/** @type {{ ContentAssignment: import('./Pict-Content-Assignment') }} */_this70.services;// No merging of options necessary
|
|
4960
|
+
if(typeof _this70.options.CSSElementAddress==='undefined'){_this70.options.CSSElementAddress=defaultConfiguration.CSSElementAddress;}_this70.inlineCSSMap={};return _this70;}// Add a CSS fragment to the CSS map (each view can have its own CSS fragment)
|
|
4960
4961
|
// Hash is shared across all views, so if 10 views all load the "My-Table-View" fragment, it will only be loaded once.
|
|
4961
|
-
_inherits(PictCSS,
|
|
4962
|
-
tmpCSSHashes.sort(function(a,b){return
|
|
4962
|
+
_inherits(PictCSS,_libFableServiceBase19);return _createClass2(PictCSS,[{key:"addCSS",value:function addCSS(pHash,pContent,pPriority,pProvider){var tmpPriority=typeof pPriority!=='undefined'?pPriority:1000;var tmpProvidor=typeof pProvider==='string'?pProvider:'Unknown';this.inlineCSSMap[pHash]={Hash:pHash,Content:pContent,Provider:tmpProvidor,Priority:tmpPriority};}},{key:"removeCSS",value:function removeCSS(pHash){delete this.inlineCSSMap[pHash];}},{key:"generateCSS",value:function generateCSS(){var _this71=this;var tmpCSS='';var tmpCSSHashes=Object.keys(this.inlineCSSMap);// Sort the hashes by Priority
|
|
4963
|
+
tmpCSSHashes.sort(function(a,b){return _this71.inlineCSSMap[a].Priority-_this71.inlineCSSMap[b].Priority;});for(var i=0;i<tmpCSSHashes.length;i++){var tmpCSSFragment=this.inlineCSSMap[tmpCSSHashes[i]];var tmpCSSComment=tmpCSSFragment.Hash;if(tmpCSSFragment.Hash!=tmpCSSFragment.Provider){tmpCSSComment="".concat(tmpCSSComment," from ").concat(tmpCSSFragment.Provider);}tmpCSS+="/* ".concat(tmpCSSComment," */\n").concat(tmpCSSFragment.Content,"\n");}return tmpCSS;}// Inject the CSS into the magic DOM element for it
|
|
4963
4964
|
},{key:"injectCSS",value:function injectCSS(){this.services.ContentAssignment.assignContent(this.options.CSSElementAddress,this.generateCSS());}}]);}(libFableServiceBase);module.exports=PictCSS;},{"fable":68}],195:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;/**
|
|
4964
4965
|
* Class for moving content around in the DOM.
|
|
4965
|
-
*/var PictContentAssignment=/*#__PURE__*/function(
|
|
4966
|
+
*/var PictContentAssignment=/*#__PURE__*/function(_libFableServiceBase20){/**
|
|
4966
4967
|
* @param {import('fable')} pFable - The Fable library instance.
|
|
4967
4968
|
* @param {any} [pOptions] - The options for the service.
|
|
4968
4969
|
* @param {string} [pServiceHash] - The hash of services.
|
|
4969
|
-
*/function PictContentAssignment(pFable,pOptions,pServiceHash){var
|
|
4970
|
-
|
|
4971
|
-
if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){
|
|
4972
|
-
|
|
4970
|
+
*/function PictContentAssignment(pFable,pOptions,pServiceHash){var _this72;_classCallCheck2(this,PictContentAssignment);_this72=_callSuper(this,PictContentAssignment,[pFable,pOptions,pServiceHash]);/** @type {any} */_this72.log;/** @type {any} */_this72.fable;_this72.serviceType='PictContentAssignment';_this72.manifest=pFable.newManyfest();// Check to see if we are running in a browser
|
|
4971
|
+
_this72.inBrowser=false;_this72.hasDocument=false;if((typeof window==="undefined"?"undefined":_typeof(window))=='object'){_this72.inBrowser=true;// Now check that the browser has a document object
|
|
4972
|
+
if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){_this72.hasDocument=true;}}// If we're in a browser, check to see if jQuery is available.
|
|
4973
|
+
_this72.hasJquery=false;_this72.jQuery=false;if(_this72.inBrowser&&typeof window.jQuery!=='undefined'){_this72.hasJquery=true;}/**
|
|
4973
4974
|
* Set this to override the default mechanism for setting the content of a DOM element.
|
|
4974
4975
|
*
|
|
4975
4976
|
* @type {Function}
|
|
4976
4977
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4977
4978
|
* @param {string} pContent - The content to set.
|
|
4978
|
-
*/
|
|
4979
|
+
*/_this72.customAssignFunction=null;/**
|
|
4979
4980
|
* Set this to override the default mechanism for prepend content to a DOM element.
|
|
4980
4981
|
*
|
|
4981
4982
|
* @type {Function}
|
|
4982
4983
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4983
4984
|
* @param {string} pContent - The content to prepend.
|
|
4984
|
-
*/
|
|
4985
|
+
*/_this72.customPrependFunction=null;/**
|
|
4985
4986
|
* Set this to override the default mechanism for appending content to a DOM element.
|
|
4986
4987
|
*
|
|
4987
4988
|
* @type {Function}
|
|
4988
4989
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4989
4990
|
* @param {string} pContent - The content to append.
|
|
4990
|
-
*/
|
|
4991
|
+
*/_this72.customAppendFunction=null;/**
|
|
4991
4992
|
* Set this to override the default mechanism for reading content from the DOM.
|
|
4992
4993
|
*
|
|
4993
4994
|
* @type {Function}
|
|
4994
4995
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4995
4996
|
* @return {string} - The content of the element.
|
|
4996
|
-
*/
|
|
4997
|
+
*/_this72.customReadFunction=null;/**
|
|
4997
4998
|
* Set this to override the default mechanism for getting elements.
|
|
4998
4999
|
*
|
|
4999
5000
|
* @type {Function}
|
|
5000
5001
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
5001
5002
|
* @return {Array<any>} - The matched elements.
|
|
5002
|
-
*/
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5003
|
+
*/_this72.customGetElementFunction=null;// API Consumers can also craft their own attribute read function
|
|
5004
|
+
_this72.customReadAttributeFunction=null;// API Consumers can also craft their own attribute set function
|
|
5005
|
+
_this72.customSetAttributeFunction=null;// API Consumers can also craft their own attribute remove function
|
|
5006
|
+
_this72.customRemoveAttributeFunction=null;// API Consumers can also craft their own class read function
|
|
5007
|
+
_this72.customReadClassFunction=null;// API Consumers can also craft their own class set function
|
|
5008
|
+
_this72.customSetClassFunction=null;// API Consumers can also craft their own class remove function
|
|
5009
|
+
_this72.customRemoveClassFunction=null;return _this72;}/**
|
|
5009
5010
|
* Get an element from the DOM.
|
|
5010
5011
|
*
|
|
5011
5012
|
* @param {string} pAddress - The address of the element.
|
|
5012
5013
|
* @return {Array<any>} - The matched elements.
|
|
5013
|
-
*/_inherits(PictContentAssignment,
|
|
5014
|
+
*/_inherits(PictContentAssignment,_libFableServiceBase20);return _createClass2(PictContentAssignment,[{key:"getElement",value:function getElement(pAddress){if(this.customGetElementFunction){return this.customGetElementFunction(pAddress);}else if(this.hasJquery){var tmpElements=window.jQuery(pAddress);if(tmpElements.length==0){return[];}// TODO: This isn't the most efficient method, but it is the most compatible.
|
|
5014
5015
|
var tmpElementSet=[];for(var i=0;i<tmpElements.length;i++){tmpElementSet.push(tmpElements[i]);}return tmpElementSet;}else if(this.inBrowser&&this.hasDocument){// convert from NodeList to Array for consistent return type
|
|
5015
|
-
var _tmpElements=window.document.querySelectorAll(pAddress);var _tmpElementSet=[];for(var
|
|
5016
|
+
var _tmpElements=window.document.querySelectorAll(pAddress);var _tmpElementSet=[];for(var _i56=0;_i56<_tmpElements.length;_i56++){_tmpElementSet.push(_tmpElements[_i56]);}return _tmpElementSet;}else{// Just log it out for now
|
|
5016
5017
|
this.log.trace("PICT Content GET ELEMENT for [".concat(pAddress,"] will return empty because none of the browser methods are available"));return[];}}/**
|
|
5017
5018
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
5018
5019
|
* @param {string|boolean} pContent - The content to assign.
|
|
@@ -5020,7 +5021,7 @@ this.log.trace("PICT Content GET ELEMENT for [".concat(pAddress,"] will return e
|
|
|
5020
5021
|
*/},{key:"assignContent",value:function assignContent(pAddress,pContent){if(this.customAssignFunction){return this.customAssignFunction(pAddress,pContent);}else if(this.hasJquery){// Get the element(s)
|
|
5021
5022
|
//FIXME: this is silly, but it makes the type system happy - it picks a different overload for each case
|
|
5022
5023
|
var tmpTargetElementSet=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);for(var i=0;i<tmpTargetElementSet.length;i++){var tmpElement=tmpTargetElementSet[i];switch(tmpElement.tagName){case'INPUT':if(tmpElement instanceof HTMLInputElement&&tmpElement.type=='checkbox'){tmpElement.checked=Boolean(pContent);}/* falls through */case'SELECT':case'TEXTAREA':if(tmpElement instanceof HTMLInputElement||tmpElement instanceof HTMLSelectElement||tmpElement instanceof HTMLTextAreaElement){tmpElement.value=String(pContent);}break;case'SCRIPT':if(tmpElement instanceof HTMLScriptElement){tmpElement.text=String(pContent);}break;default:tmpElement.innerHTML=String(pContent);}}}else if(this.inBrowser&&this.hasDocument){// Get the element(s)
|
|
5023
|
-
var _tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var
|
|
5024
|
+
var _tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var _i57=0;_i57<_tmpTargetElementSet.length;_i57++){var _tmpElement=_tmpTargetElementSet[_i57];switch(_tmpTargetElementSet[_i57].tagName){case'INPUT':if(_tmpElement instanceof HTMLInputElement&&_tmpElement.type=='checkbox'){_tmpElement.checked=Boolean(pContent);}/* falls through */case'SELECT':case'TEXTAREA':if(_tmpElement instanceof HTMLInputElement||_tmpElement instanceof HTMLSelectElement||_tmpElement instanceof HTMLTextAreaElement){_tmpElement.value=String(pContent);}break;case'SCRIPT':if(_tmpElement instanceof HTMLScriptElement){_tmpElement.text=String(pContent);}break;default:_tmpElement.innerHTML=String(pContent);}}}else{// Just log it out for now
|
|
5024
5025
|
this.log.trace("PICT Content ASSIGN to [".concat(pAddress,"]:"),pContent);}}/**
|
|
5025
5026
|
* Append content to an element.
|
|
5026
5027
|
*
|
|
@@ -5101,49 +5102,57 @@ var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.j
|
|
|
5101
5102
|
*
|
|
5102
5103
|
* @return {boolean} - Whether the element has the class. If multiple elements are matched, returns true if any have the class.
|
|
5103
5104
|
*/},{key:"hasClass",value:function hasClass(pAddress,pClass){if(this.customReadClassFunction){return this.customReadClassFunction(pAddress,pClass);}if(this.hasJquery){//FIXME: this is silly, but it makes the type system happy - it picks a different overload for each case
|
|
5104
|
-
var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));return false;}}}]);}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":68}],196:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(
|
|
5105
|
+
var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.jQuery(pAddress);return tmpTargetElement.hasClass(pClass);}else if(this.inBrowser&&this.hasDocument){var tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var i=0;i<tmpTargetElementSet.length;i++){if(tmpTargetElementSet[i].classList.contains(pClass)){return true;}}return false;}else{this.log.trace("PICT Content HASCLASS for [".concat(pAddress,"] CLASS [").concat(pClass,"]:"));return false;}}}]);}(libFableServiceBase);module.exports=PictContentAssignment;},{"fable":68}],196:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase21){function PictDataProvider(pFable,pOptions,pServiceHash){var _this73;_classCallCheck2(this,PictDataProvider);_this73=_callSuper(this,PictDataProvider,[pFable,pOptions,pServiceHash]);/** @type {import('fable') & import('pict')} */_this73.fable;_this73.serviceType='PictDataProvider';return _this73;}/**
|
|
5105
5106
|
* @param {string} pAddress - The address of the data to retrieve
|
|
5106
5107
|
* @param {object} [pData] - (optional) The record to provide to the address resolver
|
|
5107
|
-
*/_inherits(PictDataProvider,
|
|
5108
|
-
|
|
5108
|
+
*/_inherits(PictDataProvider,_libFableServiceBase21);return _createClass2(PictDataProvider,[{key:"getDataByAddress",value:function getDataByAddress(pAddress,pData){var tmpData=typeof pData==='undefined'?{}:pData;return this.fable.manifest.getValueByHash({AppData:this.fable.AppData,Bundle:this.fable.Bundle,Record:tmpData},pAddress);}}]);}(libFableServiceBase);module.exports=PictDataProvider;},{"fable":68}],197:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase22){function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this74$fable$RestCli;var _this74;_classCallCheck2(this,PictMeadowEntityProvider);_this74=_callSuper(this,PictMeadowEntityProvider,[pFable,pOptions,pServiceHash]);/** @type {any} */_this74.options;/** @type {import('pict') & { settings: any } & { newAnticipate: any }} */_this74.fable;/** @type {any} */_this74.log;_this74.serviceType='PictMeadowProvider';if(_this74.fable.settings.PictDefaultURLPrefix){_this74.options.urlPrefix=_this74.fable.settings.PictDefaultURLPrefix;}else if(!_this74.options.urlPrefix){_this74.options.urlPrefix='/1.0/';}if(_this74.fable.settings.PictDefaultDownloadBatchSize){_this74.options.downloadBatchSize=_this74.fable.settings.PictDefaultDownloadBatchSize;}else if(!_this74.options.downloadBatchSize){_this74.options.downloadBatchSize=100;}//@ts-ignore - FIXME - remove once we have fable types
|
|
5109
|
+
_this74.restClient=(_this74$fable$RestCli=_this74.fable.RestClient)!==null&&_this74$fable$RestCli!==void 0?_this74$fable$RestCli:_this74.fable.instantiateServiceProviderWithoutRegistration('RestClient');_this74.cache={};_this74.prepareRequestOptions=function(pOptions){return pOptions;};return _this74;}_inherits(PictMeadowEntityProvider,_libFableServiceBase22);return _createClass2(PictMeadowEntityProvider,[{key:"initializeCache",value:function initializeCache(pEntity){// This should not be happening as often as it's happening.
|
|
5109
5110
|
if(!(pEntity in this.cache)){//@ts-ignore - FIXME - remove once we have fable types
|
|
5110
5111
|
this.cache[pEntity]=this.fable.instantiateServiceProviderWithoutRegistration('ObjectCache');// TODO: Make this a configuration?
|
|
5111
5112
|
// For now cache for 30 seconds.
|
|
5112
|
-
this.cache[pEntity].maxAge=30000;this.cache[pEntity].maxLength=10000;this.fable.Bundle[pEntity]=this.cache[pEntity].RecordMap;}}},{key:"gatherEntitySet",value:function gatherEntitySet(pEntityInformation,fCallback){var
|
|
5113
|
+
this.cache[pEntity].maxAge=30000;this.cache[pEntity].maxLength=10000;this.fable.Bundle[pEntity]=this.cache[pEntity].RecordMap;}}},{key:"gatherEntitySet",value:function gatherEntitySet(pEntityInformation,fCallback){var _this75=this;// First sanity check the pEntityInformation
|
|
5113
5114
|
if(!('Entity'in pEntityInformation)||typeof pEntityInformation.Entity!='string'){this.log.warn("EntityBundleRequest failed to parse entity request because the entity stanza did not contain an Entity string.");return fCallback();}if(!('Destination'in pEntityInformation)||typeof pEntityInformation.Destination!='string'){this.log.warn("EntityBundleRequest failed to parse entity request because the entity stanza did not contain a Destination string.");return fCallback();}if(!('Filter'in pEntityInformation)||typeof pEntityInformation.Filter!='string'){pEntityInformation.Filter='';}if(!('FilterData'in pEntityInformation)||_typeof(pEntityInformation.FilterData)!='object'){pEntityInformation.FilterData={};}if(!('RecordStartCursor'in pEntityInformation)||typeof pEntityInformation.RecordStartCursor!='number'){pEntityInformation.RecordStartCursor=0;}if(!('PageSize'in pEntityInformation)||typeof pEntityInformation.PageSize!='number'){pEntityInformation.PageSize=100;}var tmpRecordStartCursor=null;var tmpRecordCount=null;if(pEntityInformation.RecordCount){tmpRecordStartCursor=pEntityInformation.RecordStartCursor;tmpRecordCount=pEntityInformation.RecordCount;}// Parse the filter template
|
|
5114
5115
|
var tmpFilterString=this.fable.parseTemplate(pEntityInformation.Filter,pEntityInformation.FilterData);// Create a callback function to handle receiving the record set
|
|
5115
|
-
var fRecordFetchComplete=function fRecordFetchComplete(pError,pRecordSet){if(pError){
|
|
5116
|
-
if(pEntityInformation.SingleRecord){if(pRecordSet.length>1){
|
|
5116
|
+
var fRecordFetchComplete=function fRecordFetchComplete(pError,pRecordSet){if(pError){_this75.log.error("EntityBundleRequest request Error getting entity set for [".concat(pEntityInformation.Entity,"] with filter [").concat(tmpFilterString,"]: ").concat(pError),pError);return fCallback(pError,'');}_this75.log.trace("EntityBundleRequest found ".concat(pRecordSet.length," records for ").concat(pEntityInformation.Entity," filtered to [").concat(tmpFilterString,"]"));// Now assign it back to the destination; because this is not view specific it doesn't use the manifests from them (to deal with scope overlap with subgrids).
|
|
5117
|
+
if(pEntityInformation.SingleRecord){if(pRecordSet.length>1){_this75.log.warn("EntityBundleRequest found more than one record for ".concat(pEntityInformation.Entity," filtered to [").concat(tmpFilterString,"] but SingleRecord is true; setting the first record."));}if(pRecordSet.length<1){_this75.fable.manifest.setValueByHash(_this75.fable,pEntityInformation.Destination,false);}_this75.fable.manifest.setValueByHash(_this75.fable,pEntityInformation.Destination,pRecordSet[0]);}else{_this75.fable.manifest.setValueByHash(_this75.fable,pEntityInformation.Destination,pRecordSet);}return fCallback();};if(tmpRecordCount){this.getEntitySetPage(pEntityInformation.Entity,tmpFilterString,tmpRecordStartCursor,tmpRecordCount,fRecordFetchComplete);}else{this.getEntitySet(pEntityInformation.Entity,tmpFilterString,fRecordFetchComplete);}}},{key:"gatherCustomDataSet",value:function gatherCustomDataSet(pCustomRequestInformation,fCallback){var _this76=this;// First sanity check the pCustomRequestInformation
|
|
5118
|
+
if(!('URL'in pCustomRequestInformation)||typeof pCustomRequestInformation.URL!='string'){this.log.warn("EntityBundleRequest failed to parse custom data request because the stanza did not contain a URL string.");return fCallback();}if(!('URLData'in pCustomRequestInformation)||_typeof(pCustomRequestInformation.URLData)!='object'){pCustomRequestInformation.URLData={};}// Parse the filter template
|
|
5119
|
+
var tmpURLTemplateString=this.fable.parseTemplate(pCustomRequestInformation.URL,pCustomRequestInformation.URLData);if(tmpURLTemplateString==''){// We may want to continue, but for now let's say nah and nope out.
|
|
5120
|
+
this.log.warn("EntityBundleRequest failed to parse custom data request because the entity Filter did not return a string for FilterBy");}var tmpURLPrefix='';// This will only be true if the "Host" is set.
|
|
5121
|
+
var tmpCustomURIHost=pCustomRequestInformation.Host?pCustomRequestInformation.Host:false;// If "Host" is set, protocol and port are optional.
|
|
5122
|
+
var tmpCustomURIProtocol=pCustomRequestInformation.Protocol?pCustomRequestInformation.Protocol:'https';var tmpCustomURIPort=pCustomRequestInformation.Port?pCustomRequestInformation.Port:false;if(tmpCustomURIHost){tmpURLPrefix="".concat(tmpCustomURIProtocol,"://").concat(tmpCustomURIHost);if(tmpCustomURIPort){tmpURLPrefix+=":".concat(tmpCustomURIPort);}}else{tmpURLPrefix=this.fable.EntityProvider.options.urlPrefix;}// Now get the records
|
|
5123
|
+
var callback=function callback(pError,pResponse,pData){if(pError){_this76.log.error("EntityBundleRequest request Error getting data set for [".concat(pCustomRequestInformation.Entity,"] with filter [").concat(tmpURLTemplateString,"]: ").concat(pError),pError);return fCallback(pError,'');}_this76.log.trace("EntityBundleRequest completed request for ".concat(pCustomRequestInformation.Entity," filtered to [").concat(tmpURLTemplateString,"]"));// Since this is a templated endpoint it can be used for logging etc.
|
|
5124
|
+
if(pCustomRequestInformation.Destination){_this76.fable.manifest.setValueByHash(_this76.fable,pCustomRequestInformation.Destination,pData);}return fCallback();};var tmpOptions={url:"".concat(tmpURLPrefix).concat(tmpURLTemplateString)};tmpOptions=this.fable.EntityProvider.prepareRequestOptions(tmpOptions);return this.fable.EntityProvider.restClient.getJSON(tmpOptions,callback);}/**
|
|
5117
5125
|
* Gather data from the server returning a promise when it is complete.
|
|
5118
5126
|
*
|
|
5119
5127
|
* @param {Object} pEntitiesBundleDescription - The entity bundle description object.
|
|
5120
5128
|
*
|
|
5121
5129
|
* @return {Promise<any>} - Returns a promise that resolves when the data has been gathered.
|
|
5122
|
-
*/},{key:"gatherDataFromServer",value:function gatherDataFromServer(pEntitiesBundleDescription,fCallback){var
|
|
5123
|
-
|
|
5124
|
-
|
|
5130
|
+
*/},{key:"gatherDataFromServer",value:function gatherDataFromServer(pEntitiesBundleDescription,fCallback){var _this77=this;if(!Array.isArray(pEntitiesBundleDescription)){this.log.error("EntityBundleRequest failed to parse entity bundle request because the input was not an array.");return Promise.reject(new Error('EntityBundleRequest failed to parse entity bundle request because the input was not an array.'));}var tmpAnticipate=this.fable.newAnticipate();var _loop3=function _loop3(){var tmpEntityBundleEntry=pEntitiesBundleDescription[i];tmpAnticipate.anticipate(function(fNext){try{switch(tmpEntityBundleEntry.Type){case'Custom':return _this77.gatherCustomDataSet(tmpEntityBundleEntry,fNext);// This is the default case, for a meadow entity set or single entity
|
|
5131
|
+
case'MeadowEntity':default:return _this77.gatherEntitySet(tmpEntityBundleEntry,fNext);}}catch(pError){_this77.log.error("EntityBundleRequest error gathering entity set: ".concat(pError),pError);}return fNext();});};for(var i=0;i<pEntitiesBundleDescription.length;i++){_loop3();}tmpAnticipate.wait(function(pError){//FIXME: should we be ignoring this error? rejecting here is unsafe since the result isn't guaranteed to be handled, so will crash stuff currently
|
|
5132
|
+
if(pError){_this77.log.error("EntityBundleRequest error gathering entity set: ".concat(pError),pError);return fCallback(pError);}return fCallback();});}},{key:"getEntity",value:function getEntity(pEntity,pIDRecord,fCallback){this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
|
|
5133
|
+
this.cache[pEntity].prune(function(){var _this78=this;var tmpPossibleRecord=this.cache[pEntity].read(pIDRecord);if(tmpPossibleRecord){return fCallback(null,tmpPossibleRecord);}var tmpOptions={url:"".concat(this.options.urlPrefix).concat(pEntity,"/").concat(pIDRecord)};tmpOptions=this.prepareRequestOptions(tmpOptions);return this.restClient.getJSON(tmpOptions,function(pError,pResponse,pBody){if(pBody){_this78.cache[pEntity].put(pBody,pIDRecord);}return fCallback(pError,pBody);});}.bind(this));}},{key:"getEntitySetPage",value:function getEntitySetPage(pEntity,pMeadowFilterExpression,pRecordStartCursor,pRecordCount,fCallback){var tmpURL="".concat(this.options.urlPrefix).concat(pEntity,"s/FilteredTo/").concat(pMeadowFilterExpression,"/").concat(pRecordStartCursor,"/").concat(pRecordCount);return this.restClient.getJSON(tmpURL,function(pDownloadError,pDownloadResponse,pDownloadBody){return fCallback(pDownloadError,pDownloadBody);}.bind(this));}},{key:"getEntitySetRecordCount",value:function getEntitySetRecordCount(pEntity,pMeadowFilterExpression,fCallback){var tmpURL="".concat(this.options.urlPrefix).concat(pEntity,"s/Count/FilteredTo/").concat(pMeadowFilterExpression);return this.restClient.getJSON(tmpURL,function(pError,pResponse,pBody){if(pError){this.log.error("Error getting entity count of [".concat(pEntity,"] filtered to [").concat(pMeadowFilterExpression,"] from url [").concat(tmpURL,"]: ").concat(pError));return fCallback(pError);}var tmpRecordCount=0;if(pBody.Count){tmpRecordCount=pBody.Count;}return fCallback(pError,tmpRecordCount);}.bind(this));}},{key:"getEntitySet",value:function getEntitySet(pEntity,pMeadowFilterExpression,fCallback){// TODO: Should we test for too many record IDs here by string length in pMeadowFilterExpression?
|
|
5125
5134
|
// FBL~ID${pDestinationEntity}~INN~${tmpIDRecordsCommaSeparated}
|
|
5126
5135
|
// If the list is mega-long we can parse it and break it into chunks.
|
|
5127
5136
|
this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
|
|
5128
|
-
this.cache[pEntity].prune(function(){var
|
|
5129
|
-
tmpDownloadURIFragments.push("".concat(
|
|
5130
|
-
|
|
5131
|
-
return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){return fCallback(pFullDownloadError,tmpEntitySet);});});}.bind(this));}}]);}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":68}],198:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(
|
|
5137
|
+
this.cache[pEntity].prune(function(){var _this79=this;return this.getEntitySetRecordCount(pEntity,pMeadowFilterExpression,function(pRecordCountError,pRecordCount){if(pRecordCountError){return fCallback(pRecordCountError);}var tmpRecordCount=pRecordCount;if(isNaN(pRecordCount)){_this79.log.error("Entity count did not return a number for [".concat(pEntity,"] filtered to [").concat(pMeadowFilterExpression,"]... something is fatally wrong from the server accessed in getEntitySet call."));return fCallback(new Error('Entity count did not return a number in getEntitySet.'));}var tmpDownloadURIFragments=[];var tmpDownloadBatchSize=_this79.options.downloadBatchSize;for(var i=0;i<tmpRecordCount/tmpDownloadBatchSize;i++){// Generate each of the URI fragments to download
|
|
5138
|
+
tmpDownloadURIFragments.push("".concat(_this79.options.urlPrefix).concat(pEntity,"s/FilteredTo/").concat(pMeadowFilterExpression,"/").concat(i*tmpDownloadBatchSize,"/").concat(tmpDownloadBatchSize));}var tmpEntitySet=[];// Now run these in series (it's possible to parallelize the requests but they would not be in server order)
|
|
5139
|
+
_this79.fable.Utility.eachLimit(tmpDownloadURIFragments,1,function(pURIFragment,fDownloadCallback){_this79.restClient.getJSON(pURIFragment,function(pDownloadError,pDownloadResponse,pDownloadBody){tmpEntitySet=tmpEntitySet.concat(pDownloadBody);// Should we be caching each record?
|
|
5140
|
+
return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){return fCallback(pFullDownloadError,tmpEntitySet);});});}.bind(this));}}]);}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":68}],198:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(_libFableServiceBase23){/**
|
|
5132
5141
|
* @param {Object} pFable - The Fable Framework instance
|
|
5133
5142
|
* @param {Object} pOptions - The options for the service
|
|
5134
5143
|
* @param {String} pServiceHash - The hash of the service
|
|
5135
|
-
*/function PictTemplateProvider(pFable,pOptions,pServiceHash){var
|
|
5144
|
+
*/function PictTemplateProvider(pFable,pOptions,pServiceHash){var _this80;_classCallCheck2(this,PictTemplateProvider);_this80=_callSuper(this,PictTemplateProvider,[pFable,pOptions,pServiceHash]);/** @type {any} */_this80.log;/** @type {string} */_this80.UUID;/** @type {string} */_this80.Hash;_this80.serviceType='PictTemplateProvider';_this80.templates={};_this80.templateSources={};// Default templates are stored by prefix.
|
|
5136
5145
|
// The longest prefix match is used.
|
|
5137
5146
|
// Case sensitive.
|
|
5138
|
-
|
|
5147
|
+
_this80.defaultTemplates=[];/**
|
|
5139
5148
|
* @type {(hash?: string) => { template: string, source: string }?} loadTemplateFunction - The function to load a template
|
|
5140
|
-
*/
|
|
5149
|
+
*/_this80.loadTemplateFunction=function(){return null;};return _this80;}/**
|
|
5141
5150
|
* Add a template to the provider.
|
|
5142
5151
|
*
|
|
5143
5152
|
* @param {String} pTemplateHash - The hash of the template
|
|
5144
5153
|
* @param {String} pTemplate - The template
|
|
5145
5154
|
* @param {String} [pTemplateSource] - (optional) The source of the template
|
|
5146
|
-
*/_inherits(PictTemplateProvider,
|
|
5155
|
+
*/_inherits(PictTemplateProvider,_libFableServiceBase23);return _createClass2(PictTemplateProvider,[{key:"addTemplate",value:function addTemplate(pTemplateHash,pTemplate,pTemplateSource){this.templates[pTemplateHash]=pTemplate;if(typeof pTemplateSource=='string'){this.templateSources[pTemplateHash]=pTemplateSource;}else{this.templateSources[pTemplateHash]="Direct addTemplate('".concat(pTemplateHash,"') function load into PictTemplateProvider [").concat(this.UUID,"]::[").concat(this.Hash,"]");}}/**
|
|
5147
5156
|
* Add a default template to the provider.
|
|
5148
5157
|
*
|
|
5149
5158
|
* @param {String} pPrefix - The prefix of the template identifier.
|
|
@@ -5200,35 +5209,35 @@ if(!(pTemplateHash in this.templates)){this.checkDefaultTemplateHash(pTemplateHa
|
|
|
5200
5209
|
* Pict management object.
|
|
5201
5210
|
*/var Pict=/*#__PURE__*/function(_libFable){/**
|
|
5202
5211
|
* @param {Object<String, any>} pSettings - The settings for the Pict instance.
|
|
5203
|
-
*/function Pict(pSettings){var
|
|
5204
|
-
/** @type {any} */
|
|
5205
|
-
|
|
5212
|
+
*/function Pict(pSettings){var _this81;_classCallCheck2(this,Pict);_this81=_callSuper(this,Pict,[pSettings]);/** @type {any} */_this81.settings;_this81.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");/** @type {Object} */_this81._PackageFable=_this81._Package;_this81._Package=libPackage;_this81.browserAddress="window._Pict";if("BrowserAddress"in _this81.settings){_this81.browserAddress=_this81.settings.BrowserAddress;}_this81.children=[];/** @type {import('pict-application')} */_this81.PictApplication=null;// shim types from fable until we export types properly
|
|
5213
|
+
/** @type {any} */_this81.log;//NOTE: This needs to come before any other providers which may instantiate a rest client so we don't proliferate them
|
|
5214
|
+
_this81.instantiateServiceProvider("RestClient");/**
|
|
5206
5215
|
* The templateProvider provides a basic key->template mapping with default fallback capabilities
|
|
5207
5216
|
*
|
|
5208
5217
|
* @type {PictTemplateProvider}
|
|
5209
|
-
*/
|
|
5218
|
+
*/_this81.TemplateProvider=null;_this81.addAndInstantiateServiceType("TemplateProvider",PictTemplateProvider);/**
|
|
5210
5219
|
* The meadow entity provider.
|
|
5211
5220
|
*
|
|
5212
5221
|
* @type {PictMeadowEntityProvider}
|
|
5213
|
-
*/
|
|
5222
|
+
*/_this81.EntityProvider=null;_this81.addAndInstantiateServiceType("EntityProvider",PictMeadowEntityProvider);/**
|
|
5214
5223
|
* The data provider.
|
|
5215
5224
|
*
|
|
5216
5225
|
* @type {PictDataProvider}
|
|
5217
|
-
*/
|
|
5226
|
+
*/_this81.DataProvider=null;_this81.addAndInstantiateServiceType("DataProvider",PictDataProvider);/**
|
|
5218
5227
|
* The content assignment module.
|
|
5219
5228
|
*
|
|
5220
5229
|
* @type {PictContentAssignment}
|
|
5221
|
-
*/
|
|
5230
|
+
*/_this81.ContentAssignment=null;_this81.addAndInstantiateServiceType("ContentAssignment",PictContentAssignment);/**
|
|
5222
5231
|
* The CSS module.
|
|
5223
5232
|
*
|
|
5224
5233
|
* @type {PictCSS}
|
|
5225
5234
|
* @public
|
|
5226
|
-
*/
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
if(
|
|
5231
|
-
|
|
5235
|
+
*/_this81.CSSMap=null;_this81.addAndInstantiateServiceType("CSSMap",PictCSS);_this81.addServiceType("PictTemplate",require("pict-template"));_this81.instantiateServiceProvider("MetaTemplate");_this81.instantiateServiceProvider("DataGeneration");_this81.manifest=_this81.instantiateServiceProvider("Manifest");_this81.AppData={};if("DefaultAppData"in _this81.fable.settings){_this81.AppData=_this81.fable.settings.DefaultAppData;}_this81.Bundle={};// Log noisness goes from 0 - 5, where 5 is show me everything.
|
|
5236
|
+
_this81.LogNoisiness=0;// Although we have log noisiness, sometimes we need control flow without all the other noise for hard to diagnose interpreters.
|
|
5237
|
+
_this81.LogControlFlow=false;// And an easy way to be introspective about data at various locations
|
|
5238
|
+
_this81.LogControlFlowWatchAddressList=[];// Load manifest sets
|
|
5239
|
+
if(_this81.settings.Manifests){_this81.loadManifestSet(_this81.settings.Manifests);}_this81._DefaultPictTemplatesInitialized=false;_this81.initializePictTemplateEngine();_this81.addServiceType("PictView",require("pict-view"));_this81.addServiceType("PictProvider",require("pict-provider"));_this81.addServiceType("PictApplication",require("pict-application"));// Expose the named views directly, through a convenience accessor
|
|
5240
|
+
_this81.providers=_this81.servicesMap.PictProvider;_this81.views=_this81.servicesMap.PictView;return _this81;}/**
|
|
5232
5241
|
* Load manifests in as Hashed services
|
|
5233
5242
|
*
|
|
5234
5243
|
* @param {Object<String, String>} pManifestSet - The manifest set to load.
|
|
@@ -5300,7 +5309,7 @@ if("default_configuration"in pApplicationPrototype){tmpOptions=this.fable.Utilit
|
|
|
5300
5309
|
*/},{key:"initializePictTemplateEngine",value:function initializePictTemplateEngine(){if(!this._DefaultPictTemplatesInitialized){// Just looking up data in the application state template expression
|
|
5301
5310
|
//{~Data:AppData.Some.Value.to.Render~}
|
|
5302
5311
|
//{~D:AppData.Some.Value.to.Render~}
|
|
5303
|
-
this.addTemplate(require("./templates/Pict-Template-Data.js"));this.addTemplate(require("./templates/Pict-Template-DataValueByKey.js"));this.addTemplate(require("./templates/Pict-Template-View.js"));// HTML Comment Start and End based on truthiness ... if the value is false, the comment shows up.
|
|
5312
|
+
this.addTemplate(require("./templates/Pict-Template-Data.js"));this.addTemplate(require("./templates/Pict-Template-TemplateByReference.js"));this.addTemplate(require("./templates/Pict-Template-DataValueByKey.js"));this.addTemplate(require("./templates/Pict-Template-View.js"));// HTML Comment Start and End based on truthiness ... if the value is false, the comment shows up.
|
|
5304
5313
|
// {~HtmlCommentStart:Some.Address~} gives you "<!--"
|
|
5305
5314
|
// {~HCS:Some.Address~} gives you "<!--"
|
|
5306
5315
|
this.addTemplate(require("./templates/data/Pict-Template-HtmlCommentStart.js"));// {~HtmlCommentEnd:Some.Address~} gives you "-->"
|
|
@@ -5340,7 +5349,7 @@ this.addTemplate(require("./templates/debugging/Pict-Template-Breakpoint.js"));t
|
|
|
5340
5349
|
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5341
5350
|
*
|
|
5342
5351
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5343
|
-
*/},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback,pContextArray){var
|
|
5352
|
+
*/},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback,pContextArray){var _this82=this;var tmpData=_typeof(pData)==="object"?pData:{};var tmpContextArray=Array.isArray(pContextArray)?pContextArray:[this];var tmpParseUUID;if(this.LogControlFlow){tmpParseUUID=this.fable.getUUID();this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," [").concat(pTemplateString.substring(0,50).replace("\n","\\n"),"...").concat(pTemplateString.length,"] (fCallback: ").concat(_typeof(fCallback),") with data size [").concat(JSON.stringify(tmpData).length,"]"));if(this.LogNoisiness>1){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," template:\n").concat(pTemplateString));}if(this.LogControlFlowWatchAddressList.length>0){for(var i=0;i<this.LogControlFlowWatchAddressList.length;i++){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Watch Value: [").concat(this.LogControlFlowWatchAddressList[i],"]=>[").concat(this.resolveStateFromAddress(this.LogControlFlowWatchAddressList[i],tmpData),"]"));}}}if(typeof fCallback==="function"){this.MetaTemplate.parseString(pTemplateString,tmpData,function(pError,pParsedTemplate){if(_this82.LogControlFlow&&_this82.LogNoisiness>1){_this82.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Template Async Return Value:\n").concat(pParsedTemplate));}return fCallback(pError,pParsedTemplate);},tmpContextArray);}else{var tmpResult=this.MetaTemplate.parseString(pTemplateString,tmpData,null,tmpContextArray);if(this.LogControlFlow&&this.LogNoisiness>1){this.log.info("PICT-ControlFlow parseTemplate ".concat(tmpParseUUID," Template Return Value:\n").concat(tmpResult));}return tmpResult;}}/**
|
|
5344
5353
|
* Parse a template by hash.
|
|
5345
5354
|
*
|
|
5346
5355
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
@@ -5359,8 +5368,8 @@ if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplate(tmpTempla
|
|
|
5359
5368
|
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5360
5369
|
*
|
|
5361
5370
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5362
|
-
*/},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback,pContextArray){var
|
|
5363
|
-
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return
|
|
5371
|
+
*/},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback,pContextArray){var _this83=this;// TODO: This will need streaming -- for now janky old string append does the trick
|
|
5372
|
+
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this83.parseTemplate(pTemplateString,pRecord,function(pError,pTemplateResult){tmpValue+=pTemplateResult;return fRecordTemplateCallback();});},function(pError){return fCallback(pError,tmpValue);});}else{return fCallback(Error("Pict: Template Set: pDataSet is not an array or object."),"");}}else{if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){if(Array.isArray(pDataSet)){for(var i=0;i<pDataSet.length;i++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[i],null,pContextArray);}}else{var tmpKeys=Object.keys(pDataSet);for(var _i58=0;_i58<tmpKeys.length;_i58++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i58]],null,pContextArray);}}return tmpValue;}else{return"";}}}/**
|
|
5364
5373
|
* Parse a template set by hash.
|
|
5365
5374
|
*
|
|
5366
5375
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
@@ -5379,8 +5388,8 @@ if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplateSet(tmpTem
|
|
|
5379
5388
|
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5380
5389
|
*
|
|
5381
5390
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5382
|
-
*/},{key:"parseTemplateSetWithPayload",value:function parseTemplateSetWithPayload(pTemplateString,pDataSet,pPayload,fCallback,pContextArray){var
|
|
5383
|
-
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return
|
|
5391
|
+
*/},{key:"parseTemplateSetWithPayload",value:function parseTemplateSetWithPayload(pTemplateString,pDataSet,pPayload,fCallback,pContextArray){var _this84=this;// TODO: This will need streaming -- for now janky old string append does the trick
|
|
5392
|
+
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this84.parseTemplate(pTemplateString,{Data:pRecord,Payload:pPayload},function(pError,pTemplateResult){tmpValue+=pTemplateResult;return fRecordTemplateCallback();});},function(pError){return fCallback(pError,tmpValue);});}else{return fCallback(Error("Pict: Template Set: pDataSet is not an array or object."),"");}}else{if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){if(Array.isArray(pDataSet)){for(var i=0;i<pDataSet.length;i++){tmpValue+=this.parseTemplate(pTemplateString,{Data:pDataSet[i],Payload:pPayload},null,pContextArray);}}else{var tmpKeys=Object.keys(pDataSet);for(var _i59=0;_i59<tmpKeys.length;_i59++){tmpValue+=this.parseTemplate(pTemplateString,{Data:pDataSet[tmpKeys[_i59]],Payload:pPayload},null,pContextArray);}}return tmpValue;}else{return"";}}}/**
|
|
5384
5393
|
* Parse a template set by hash.
|
|
5385
5394
|
*
|
|
5386
5395
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
@@ -5392,7 +5401,7 @@ var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_ty
|
|
|
5392
5401
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5393
5402
|
*/},{key:"parseTemplateSetWithPayloadByHash",value:function parseTemplateSetWithPayloadByHash(pTemplateHash,pDataSet,pPayload,fCallback,pContextArray){var tmpTemplateString=this.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
5394
5403
|
if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplateSetWithPayload(tmpTemplateString,pDataSet,pPayload,fCallback,pContextArray);}}]);}(libFable);module.exports=Pict;module.exports.PictApplicationClass=require("pict-application");module.exports.PictViewClass=require("pict-view");module.exports.PictProviderClass=require("pict-provider");module.exports.PictTemplateClass=require("pict-template");module.exports.EnvironmentLog=require("./environments/Pict-Environment-Log.js");module.exports.EnvironmentObject=require("./environments/Pict-Environment-Object.js");// This is to help understand the type of enivironement we're executing in
|
|
5395
|
-
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require("./Pict-Browser-SafeOnDocumentReady.js");module.exports.safeLoadPictApplication=require("./Pict-Browser-SafeLoad.js");},{"../package.json":191,"./Pict-Browser-SafeLoad.js":192,"./Pict-Browser-SafeOnDocumentReady.js":193,"./Pict-CSS.js":194,"./Pict-Content-Assignment.js":195,"./Pict-DataProvider.js":196,"./Pict-Meadow-EntityProvider.js":197,"./Pict-Template-Provider.js":198,"./environments/Pict-Environment-Log.js":200,"./environments/Pict-Environment-Object.js":201,"./templates/Pict-Template-Data.js":202,"./templates/Pict-Template-DataValueByKey.js":203,"./templates/Pict-Template-Entity.js":204,"./templates/Pict-Template-Self.js":205,"./templates/Pict-Template-Template.js":206,"./templates/Pict-Template-
|
|
5404
|
+
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require("./Pict-Browser-SafeOnDocumentReady.js");module.exports.safeLoadPictApplication=require("./Pict-Browser-SafeLoad.js");},{"../package.json":191,"./Pict-Browser-SafeLoad.js":192,"./Pict-Browser-SafeOnDocumentReady.js":193,"./Pict-CSS.js":194,"./Pict-Content-Assignment.js":195,"./Pict-DataProvider.js":196,"./Pict-Meadow-EntityProvider.js":197,"./Pict-Template-Provider.js":198,"./environments/Pict-Environment-Log.js":200,"./environments/Pict-Environment-Object.js":201,"./templates/Pict-Template-Data.js":202,"./templates/Pict-Template-DataValueByKey.js":203,"./templates/Pict-Template-Entity.js":204,"./templates/Pict-Template-Self.js":205,"./templates/Pict-Template-Template.js":206,"./templates/Pict-Template-TemplateByReference.js":207,"./templates/Pict-Template-TemplateFromMap.js":208,"./templates/Pict-Template-TemplateSet.js":209,"./templates/Pict-Template-TemplateSetFromMap.js":210,"./templates/Pict-Template-TemplateSetWithPayload.js":211,"./templates/Pict-Template-TemplateValueSet.js":212,"./templates/Pict-Template-View.js":213,"./templates/data-generation/Pict-Template-RandomNumber.js":214,"./templates/data-generation/Pict-Template-RandomNumberString.js":215,"./templates/data/Pict-Template-DataJson.js":216,"./templates/data/Pict-Template-DateOnlyFormat.js":217,"./templates/data/Pict-Template-DateOnlyYMD.js":218,"./templates/data/Pict-Template-DateTimeFormat.js":219,"./templates/data/Pict-Template-DateTimeYMD.js":220,"./templates/data/Pict-Template-Digits.js":221,"./templates/data/Pict-Template-Dollars.js":222,"./templates/data/Pict-Template-HtmlCommentEnd.js":223,"./templates/data/Pict-Template-HtmlCommentStart.js":224,"./templates/data/Pict-Template-Join.js":225,"./templates/data/Pict-Template-JoinUnique.js":226,"./templates/data/Pict-Template-PascalCaseIdentifier.js":227,"./templates/data/Pict-Template-PluckJoinUnique.js":228,"./templates/debugging/Pict-Template-Breakpoint.js":229,"./templates/debugging/Pict-Template-DataValueTree.js":230,"./templates/debugging/Pict-Template-LogStatement.js":231,"./templates/debugging/Pict-Template-LogValue.js":232,"./templates/debugging/Pict-Template-LogValueTree.js":233,"./templates/logic/Pict-Template-NotEmpty.js":234,"./templates/logic/Pict-Template-TemplateIf.js":236,"./templates/logic/Pict-Template-TemplateIfAbsolute.js":237,"fable":68,"pict-application":139,"pict-provider":141,"pict-template":143,"pict-view":145}],200:[function(require,module,exports){/**
|
|
5396
5405
|
* Pict browser shim loader
|
|
5397
5406
|
* @author <steven@velozo.com>
|
|
5398
5407
|
*
|
|
@@ -5494,15 +5503,15 @@ return this.contentMap[pAddress];}this.pict.log.warn("Mock read from Address ".c
|
|
|
5494
5503
|
* @param {Object} pFable - The Fable Framework instance
|
|
5495
5504
|
* @param {Object} pOptions - The options for the service
|
|
5496
5505
|
* @param {String} pServiceHash - The hash of the service
|
|
5497
|
-
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var
|
|
5506
|
+
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this85;_classCallCheck2(this,PictTemplateProviderData);_this85=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);/** @type {any} */_this85.log;_this85.addPattern('{~Data:','~}');_this85.addPattern('{~D:','~}');return _this85;}_inherits(PictTemplateProviderData,_libPictTemplate);return _createClass2(PictTemplateProviderData,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpRecord=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"]"));}var tmpDefaultValue='';if(tmpHash.indexOf(':')>-1){tmpDefaultValue=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}var tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray);}if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'||tmpValue===''){return tmpDefaultValue;}return tmpValue;}}]);}(libPictTemplate);module.exports=PictTemplateProviderData;},{"pict-template":143}],203:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDataValueByKey=/*#__PURE__*/function(_libPictTemplate2){/**
|
|
5498
5507
|
* @param {Object} pFable - The Fable Framework instance
|
|
5499
5508
|
* @param {Object} pOptions - The options for the service
|
|
5500
5509
|
* @param {String} pServiceHash - The hash of the service
|
|
5501
|
-
*/function PictTemplateProviderDataValueByKey(pFable,pOptions,pServiceHash){var
|
|
5510
|
+
*/function PictTemplateProviderDataValueByKey(pFable,pOptions,pServiceHash){var _this86;_classCallCheck2(this,PictTemplateProviderDataValueByKey);_this86=_callSuper(this,PictTemplateProviderDataValueByKey,[pFable,pOptions,pServiceHash]);/** @type {any} */_this86.log;_this86.addPattern('{~DataValueByKey:','~}');_this86.addPattern('{~DVBK:','~}');return _this86;}_inherits(PictTemplateProviderDataValueByKey,_libPictTemplate2);return _createClass2(PictTemplateProviderDataValueByKey,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpRecord=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"]"));}var tmpHashArray=tmpHash.split(':');if(tmpHashArray.length<2){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] failed because there were not two stanzas in the expression [").concat(pTemplateHash,"]"));return'';}var tmpDefaultValue='';if(tmpHashArray.length>2){tmpDefaultValue=tmpHashArray[2];}var tmpValueObject=this.resolveStateFromAddress(tmpHashArray[0],tmpRecord,pContextArray);var tmpValueAddress=this.resolveStateFromAddress(tmpHashArray[1],tmpRecord,pContextArray);var tmpValue=this.pict.manifest.getValueByHash(tmpValueObject,tmpValueAddress);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return tmpDefaultValue;}return tmpValue;}}]);}(libPictTemplate);module.exports=PictTemplateProviderDataValueByKey;},{"pict-template":143}],204:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderEntity=/*#__PURE__*/function(_libPictTemplate3){/**
|
|
5502
5511
|
* @param {Object} pFable - The Fable Framework instance
|
|
5503
5512
|
* @param {Object} pOptions - The options for the service
|
|
5504
5513
|
* @param {String} pServiceHash - The hash of the service
|
|
5505
|
-
*/function PictTemplateProviderEntity(pFable,pOptions,pServiceHash){var
|
|
5514
|
+
*/function PictTemplateProviderEntity(pFable,pOptions,pServiceHash){var _this87;_classCallCheck2(this,PictTemplateProviderEntity);_this87=_callSuper(this,PictTemplateProviderEntity,[pFable,pOptions,pServiceHash]);/** @type {any} */_this87.log;_this87.addPattern('{~E:','~}');_this87.addPattern('{~Entity:','~}');return _this87;}/**
|
|
5506
5515
|
* Render a template expression, returning a string with the resulting content.
|
|
5507
5516
|
*
|
|
5508
5517
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5520,7 +5529,7 @@ if(tmpEntityTemplate){return this.pict.parseTemplateByHash(tmpEntityTemplate,pRe
|
|
|
5520
5529
|
* @param {Object} pFable - The Fable Framework instance
|
|
5521
5530
|
* @param {Object} pOptions - The options for the service
|
|
5522
5531
|
* @param {String} pServiceHash - The hash of the service
|
|
5523
|
-
*/function PictTemplateProviderSelf(pFable,pOptions,pServiceHash){var
|
|
5532
|
+
*/function PictTemplateProviderSelf(pFable,pOptions,pServiceHash){var _this88;_classCallCheck2(this,PictTemplateProviderSelf);_this88=_callSuper(this,PictTemplateProviderSelf,[pFable,pOptions,pServiceHash]);_this88.addPattern('{~Pict','~}');_this88.addPattern('{~P','~}');_this88.addPattern('{~p','~}');return _this88;}/**
|
|
5524
5533
|
* Render a template expression, returning a string with the resulting content.
|
|
5525
5534
|
*
|
|
5526
5535
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5532,18 +5541,33 @@ if(tmpEntityTemplate){return this.pict.parseTemplateByHash(tmpEntityTemplate,pRe
|
|
|
5532
5541
|
* @param {Object} pFable - The Fable Framework instance
|
|
5533
5542
|
* @param {Object} pOptions - The options for the service
|
|
5534
5543
|
* @param {String} pServiceHash - The hash of the service
|
|
5535
|
-
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var
|
|
5544
|
+
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var _this89;_classCallCheck2(this,PictTemplateProviderTemplate);_this89=_callSuper(this,PictTemplateProviderTemplate,[pFable,pOptions,pServiceHash]);/** @type {any} */_this89.log;_this89.addPattern('{~Template:','~}');_this89.addPattern('{~T:','~}');return _this89;}_inherits(PictTemplateProviderTemplate,_libPictTemplate5);return _createClass2(PictTemplateProviderTemplate,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash;var tmpAddressOfData;// This is just a simple 2 part hash (the entity and the ID)
|
|
5536
5545
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
5537
5546
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
5538
5547
|
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateHash;var tmpAddressOfData;// This is just a simple 2 part hash (the entity and the ID)
|
|
5539
5548
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
5540
5549
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render Async: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render Async: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
5541
5550
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
5542
|
-
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplate;},{"pict-template":143}],207:[function(require,module,exports){var libPictTemplate=require('pict-template');var
|
|
5551
|
+
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplate;},{"pict-template":143}],207:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplate=/*#__PURE__*/function(_libPictTemplate6){/**
|
|
5552
|
+
* @param {Object} pFable - The Fable Framework instance
|
|
5553
|
+
* @param {Object} pOptions - The options for the service
|
|
5554
|
+
* @param {String} pServiceHash - The hash of the service
|
|
5555
|
+
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var _this90;_classCallCheck2(this,PictTemplateProviderTemplate);_this90=_callSuper(this,PictTemplateProviderTemplate,[pFable,pOptions,pServiceHash]);/** @type {any} */_this90.log;_this90.addPattern('{~TemplateByReference:','~}');_this90.addPattern('{~TBR:','~}');return _this90;}_inherits(PictTemplateProviderTemplate,_libPictTemplate6);return _createClass2(PictTemplateProviderTemplate,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateRender]::[".concat(tmpHash,"]"));}var tmpTemplateHashReferenceLocation;var tmpAddressOfData;// This is just a simple 2 part hash (the entity and the ID)
|
|
5556
|
+
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHashReferenceLocation=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHashReferenceLocation=tmpHash;}// No template hash
|
|
5557
|
+
if(!tmpTemplateHashReferenceLocation){this.log.warn("Pict: Template Render: TemplateHashReferenceLocation not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHashReferenceLocation not resolved for [".concat(tmpHash,"]");}// Now look up the template by the reference
|
|
5558
|
+
var tmpTemplateHash=this.resolveStateFromAddress(tmpTemplateHashReferenceLocation,pRecord,pContextArray);// No template hash
|
|
5559
|
+
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
5560
|
+
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateHashReferenceLocation;var tmpAddressOfData;// This is just a simple 2 part hash (the entity and the ID)
|
|
5561
|
+
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHashReferenceLocation=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHashReferenceLocation=tmpHash;}// No template hash
|
|
5562
|
+
if(!tmpTemplateHashReferenceLocation){this.log.warn("Pict: Template Render Async: TemplateHashReferenceLocation not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render Async: TemplateHashReferenceLocation not resolved for [".concat(tmpHash,"]");}// Now look up the template by the reference
|
|
5563
|
+
var tmpTemplateHash=this.resolveStateFromAddress(tmpTemplateHashReferenceLocation,pRecord,pContextArray);// No template hash
|
|
5564
|
+
if(!tmpTemplateHash){this.log.warn("Pict: Template Render Async: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render Async: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
5565
|
+
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
5566
|
+
return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplate;},{"pict-template":143}],208:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateFromMap=/*#__PURE__*/function(_libPictTemplate7){/**
|
|
5543
5567
|
* @param {Object} pFable - The Fable Framework instance
|
|
5544
5568
|
* @param {Object} pOptions - The options for the service
|
|
5545
5569
|
* @param {String} pServiceHash - The hash of the service
|
|
5546
|
-
*/function PictTemplateProviderTemplateFromMap(pFable,pOptions,pServiceHash){var
|
|
5570
|
+
*/function PictTemplateProviderTemplateFromMap(pFable,pOptions,pServiceHash){var _this91;_classCallCheck2(this,PictTemplateProviderTemplateFromMap);_this91=_callSuper(this,PictTemplateProviderTemplateFromMap,[pFable,pOptions,pServiceHash]);/** @type {any} */_this91.log;_this91.addPattern('{~TFM:','~}');_this91.addPattern('{~TemplateFromMap:','~}');return _this91;}_inherits(PictTemplateProviderTemplateFromMap,_libPictTemplate7);return _createClass2(PictTemplateProviderTemplateFromMap,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRender]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash;var tmpAddressOfMap;var tmpAddressOfKey;// This is a 3 part hash with the map address and the key address both
|
|
5547
5571
|
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return'';}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfMap=tmpTemplateHashPart[1];tmpAddressOfKey=tmpTemplateHashPart[2];// No TemplateFromMap hash
|
|
5548
5572
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return'';}// Now resolve the data
|
|
5549
5573
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMap Render: Map not resolved for [".concat(tmpHash,"]"));return'';}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
@@ -5552,11 +5576,11 @@ var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this
|
|
|
5552
5576
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
5553
5577
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMap Render: Map not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
5554
5578
|
// The async portion of this is a mind bender because of how entry can happen dynamically from TemplateFromMaps
|
|
5555
|
-
return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateFromMap;},{"pict-template":143}],
|
|
5579
|
+
return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateFromMap;},{"pict-template":143}],209:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateSet=/*#__PURE__*/function(_libPictTemplate8){/**
|
|
5556
5580
|
* @param {Object} pFable - The Fable Framework instance
|
|
5557
5581
|
* @param {Object} pOptions - The options for the service
|
|
5558
5582
|
* @param {String} pServiceHash - The hash of the service
|
|
5559
|
-
*/function PictTemplateProviderTemplateSet(pFable,pOptions,pServiceHash){var
|
|
5583
|
+
*/function PictTemplateProviderTemplateSet(pFable,pOptions,pServiceHash){var _this92;_classCallCheck2(this,PictTemplateProviderTemplateSet);_this92=_callSuper(this,PictTemplateProviderTemplateSet,[pFable,pOptions,pServiceHash]);/** @type {any} */_this92.log;_this92.addPattern('{~TemplateSet:','~}');_this92.addPattern('{~TS:','~}');return _this92;}_inherits(PictTemplateProviderTemplateSet,_libPictTemplate8);return _createClass2(PictTemplateProviderTemplateSet,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash;var tmpAddressOfData;// This is just a simple 2 part hash (the entity and the ID)
|
|
5560
5584
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
5561
5585
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
5562
5586
|
return this.pict.parseTemplateSetByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateSetRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateSetRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash;var tmpAddressOfData;// This is a 3 part hash with the map address and the key address both
|
|
@@ -5564,11 +5588,11 @@ var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this
|
|
|
5564
5588
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
5565
5589
|
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
5566
5590
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
5567
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateSet;},{"pict-template":143}],
|
|
5591
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateSet;},{"pict-template":143}],210:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateSetFromMap=/*#__PURE__*/function(_libPictTemplate9){/**
|
|
5568
5592
|
* @param {Object} pFable - The Fable Framework instance
|
|
5569
5593
|
* @param {Object} pOptions - The options for the service
|
|
5570
5594
|
* @param {String} pServiceHash - The hash of the service
|
|
5571
|
-
*/function PictTemplateProviderTemplateSetFromMap(pFable,pOptions,pServiceHash){var
|
|
5595
|
+
*/function PictTemplateProviderTemplateSetFromMap(pFable,pOptions,pServiceHash){var _this93;_classCallCheck2(this,PictTemplateProviderTemplateSetFromMap);_this93=_callSuper(this,PictTemplateProviderTemplateSetFromMap,[pFable,pOptions,pServiceHash]);/** @type {any} */_this93.log;_this93.addPattern('{~TSFM:','~}');_this93.addPattern('{~TemplateSetFromMap:','~}');return _this93;}_inherits(PictTemplateProviderTemplateSetFromMap,_libPictTemplate9);return _createClass2(PictTemplateProviderTemplateSetFromMap,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT TemplateFromMap [fTemplateFromMapSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT TemplateFromMap [fTemplateFromMapSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash;var tmpAddressOfMap;var tmpAddressOfKey;// This is a 3 part hash with the map address and the key address both
|
|
5572
5596
|
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this.log.trace("PICT TemplateFromMap [fTemplateFromMapRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return'';}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfMap=tmpTemplateHashPart[1];tmpAddressOfKey=tmpTemplateHashPart[2];// No TemplateFromMap hash
|
|
5573
5597
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return'';}// Now resolve the data
|
|
5574
5598
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMap Render: Map not resolved for [".concat(tmpHash,"]"));return'';}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
@@ -5577,29 +5601,29 @@ var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this
|
|
|
5577
5601
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMapSet Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
5578
5602
|
var tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray);var tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray);if(!tmpMap){this.log.warn("Pict: TemplateFromMapSet Render: Map not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
5579
5603
|
// The async portion of this is a mind bender because of how entry can happen dynamically from TemplateFromMaps
|
|
5580
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateSetFromMap;},{"pict-template":143}],
|
|
5604
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateSetFromMap;},{"pict-template":143}],211:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateSetWithPayload=/*#__PURE__*/function(_libPictTemplate10){/**
|
|
5581
5605
|
* @param {Object} pFable - The Fable Framework instance
|
|
5582
5606
|
* @param {Object} pOptions - The options for the service
|
|
5583
5607
|
* @param {String} pServiceHash - The hash of the service
|
|
5584
|
-
*/function PictTemplateProviderTemplateSetWithPayload(pFable,pOptions,pServiceHash){var
|
|
5608
|
+
*/function PictTemplateProviderTemplateSetWithPayload(pFable,pOptions,pServiceHash){var _this94;_classCallCheck2(this,PictTemplateProviderTemplateSetWithPayload);_this94=_callSuper(this,PictTemplateProviderTemplateSetWithPayload,[pFable,pOptions,pServiceHash]);/** @type {any} */_this94.log;_this94.addPattern('{~TemplateSetWithPayload:','~}');_this94.addPattern('{~TSWP:','~}');return _this94;}_inherits(PictTemplateProviderTemplateSetWithPayload,_libPictTemplate10);return _createClass2(PictTemplateProviderTemplateSetWithPayload,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateSetWithPayloadRender]::[".concat(tmpHash,"] with record:"),pRecord);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateSetWithPayloadRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash;var tmpAddressOfData;var tmpAddressOfPayload;// This is just a simple 3 part hash (template, address of set, address of payload)
|
|
5585
5609
|
var tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){this.log.trace("PICT Template [fTemplateSetWithPayloadRender]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return"";}tmpTemplateHash=tmpTemplateHashes[0];tmpAddressOfData=tmpTemplateHashes[1];tmpAddressOfPayload=tmpTemplateHashes[2];var tmpData=this.resolveStateFromAddress(tmpAddressOfData,pRecord,pContextArray);if(!tmpData){tmpData=pRecord;}if(!tmpData){tmpData={};}var tmpPayloadData=this.resolveStateFromAddress(tmpAddressOfPayload,pRecord,pContextArray);if(!tmpPayloadData){tmpPayloadData=pRecord;}if(!tmpPayloadData){tmpPayloadData={};}return this.pict.parseTemplateSetWithPayloadByHash(tmpTemplateHash,tmpData,tmpPayloadData,null,pContextArray);}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateSetWithPayloadRenderAsync]::[".concat(tmpHash,"]"));}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateSetWithPayloadRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateHash;var tmpAddressOfData;var tmpAddressOfPayload;// This is just a simple 3 part hash (template, address of set, address of payload)
|
|
5586
|
-
var tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){this.log.trace("PICT Template [fTemplateSetWithPayloadRender]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return"";}tmpTemplateHash=tmpTemplateHashes[0];tmpAddressOfData=tmpTemplateHashes[1];tmpAddressOfPayload=tmpTemplateHashes[2];var tmpData=this.resolveStateFromAddress(tmpAddressOfData,pRecord,pContextArray);if(!tmpData){tmpData=pRecord;}if(!tmpData){tmpData={};}var tmpPayloadData=this.resolveStateFromAddress(tmpAddressOfPayload,pRecord,pContextArray);if(!tmpPayloadData){tmpPayloadData=pRecord;}if(!tmpPayloadData){tmpPayloadData={};}return this.pict.parseTemplateSetWithPayloadByHash(tmpTemplateHash,tmpData,tmpPayloadData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateSetWithPayload;},{"pict-template":143}],
|
|
5610
|
+
var tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){this.log.trace("PICT Template [fTemplateSetWithPayloadRender]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return"";}tmpTemplateHash=tmpTemplateHashes[0];tmpAddressOfData=tmpTemplateHashes[1];tmpAddressOfPayload=tmpTemplateHashes[2];var tmpData=this.resolveStateFromAddress(tmpAddressOfData,pRecord,pContextArray);if(!tmpData){tmpData=pRecord;}if(!tmpData){tmpData={};}var tmpPayloadData=this.resolveStateFromAddress(tmpAddressOfPayload,pRecord,pContextArray);if(!tmpPayloadData){tmpPayloadData=pRecord;}if(!tmpPayloadData){tmpPayloadData={};}return this.pict.parseTemplateSetWithPayloadByHash(tmpTemplateHash,tmpData,tmpPayloadData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateSetWithPayload;},{"pict-template":143}],212:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateValueSet=/*#__PURE__*/function(_libPictTemplate11){/**
|
|
5587
5611
|
* @param {Object} pFable - The Fable Framework instance
|
|
5588
5612
|
* @param {Object} pOptions - The options for the service
|
|
5589
5613
|
* @param {String} pServiceHash - The hash of the service
|
|
5590
|
-
*/function PictTemplateProviderTemplateValueSet(pFable,pOptions,pServiceHash){var
|
|
5614
|
+
*/function PictTemplateProviderTemplateValueSet(pFable,pOptions,pServiceHash){var _this95;_classCallCheck2(this,PictTemplateProviderTemplateValueSet);_this95=_callSuper(this,PictTemplateProviderTemplateValueSet,[pFable,pOptions,pServiceHash]);/** @type {any} */_this95.log;_this95.addPattern('{~TemplateValueSet:','~}');_this95.addPattern('{~TVS:','~}');return _this95;}_inherits(PictTemplateProviderTemplateValueSet,_libPictTemplate11);return _createClass2(PictTemplateProviderTemplateValueSet,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateValueSetRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateValueSetRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash;var tmpAddressOfData;// This is just a simple 2 part hash (the entity and the ID)
|
|
5591
5615
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
5592
|
-
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var
|
|
5616
|
+
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var _i60=0;_i60<tmpValueKeys.length;_i60++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i60]],Key:tmpValueKeys[_i60]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
5593
5617
|
return this.pict.parseTemplateSetByHash(tmpTemplateHash,pRecord,null,pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateHash,tmpData,null,pContextArray);}}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpCallback=typeof fCallback==='function'?fCallback:function(){return'';};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateValueSetRenderAsync]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateValueSetRenderAsync]::[".concat(tmpHash,"]"));}var tmpTemplateFromMapHash;var tmpAddressOfData;// This is a 3 part hash with the map address and the key address both
|
|
5594
5618
|
var tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this.log.trace("PICT TemplateFromMap [fTemplateRenderAsync]::[".concat(tmpHash,"] failed because there were not three stanzas in the expression [").concat(pTemplateHash,"]"));return fCallback(null,'');}tmpTemplateFromMapHash=tmpTemplateHashPart[0];tmpAddressOfData=tmpTemplateHashPart[1];// No TemplateFromMap hash
|
|
5595
5619
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
5596
|
-
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var
|
|
5620
|
+
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray);var tmpDataValueSet=[];if(Array.isArray(tmpData)){for(var i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(_typeof(tmpData)==='object'){var tmpValueKeys=Object.keys(tmpData);for(var _i61=0;_i61<tmpValueKeys.length;_i61++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i61]],Key:tmpData[tmpValueKeys[_i61]]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
5597
5621
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
5598
|
-
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateValueSet;},{"pict-template":143}],
|
|
5622
|
+
return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateValueSet;},{"pict-template":143}],213:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderView=/*#__PURE__*/function(_libPictTemplate12){/**
|
|
5599
5623
|
* @param {Object} pFable - The Fable Framework instance
|
|
5600
5624
|
* @param {Object} pOptions - The options for the service
|
|
5601
5625
|
* @param {String} pServiceHash - The hash of the service
|
|
5602
|
-
*/function PictTemplateProviderView(pFable,pOptions,pServiceHash){var
|
|
5626
|
+
*/function PictTemplateProviderView(pFable,pOptions,pServiceHash){var _this96;_classCallCheck2(this,PictTemplateProviderView);_this96=_callSuper(this,PictTemplateProviderView,[pFable,pOptions,pServiceHash]);/** @type {any} */_this96.log;_this96.addPattern('{~V:','~}');_this96.addPattern('{~View:','~}');if(!('__TemplateOutputCache'in _this96.pict)){_this96.pict.__TemplateOutputCache={};}return _this96;}/**
|
|
5603
5627
|
* Render a template expression, returning a string with the resulting content.
|
|
5604
5628
|
*
|
|
5605
5629
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5607,38 +5631,38 @@ return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(
|
|
|
5607
5631
|
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
5608
5632
|
*
|
|
5609
5633
|
* @return {string} The rendered template
|
|
5610
|
-
*/_inherits(PictTemplateProviderView,
|
|
5634
|
+
*/_inherits(PictTemplateProviderView,_libPictTemplate12);return _createClass2(PictTemplateProviderView,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpViewHash=pTemplateHash.trim();if(!(tmpViewHash in this.pict.views)){this.log.warn("Pict: View Template Render: View not found for [".concat(tmpViewHash,"]"));return'';}var tmpRenderGUID=this.pict.getUUID();var tmpView=this.pict.views[tmpViewHash];tmpView.render('__Virtual',"__TemplateOutputCache.".concat(tmpRenderGUID),pRecord);var tmpResult=this.pict.__TemplateOutputCache[tmpRenderGUID];// TODO: Uncomment this when we like how it's working
|
|
5611
5635
|
//delete this.pict.__TemplateOutputCache[tmpRenderGUID];
|
|
5612
|
-
return tmpResult;}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var
|
|
5636
|
+
return tmpResult;}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var _this97=this;var tmpViewHash=pTemplateHash.trim();if(!(tmpViewHash in this.pict.views)){this.log.warn("Pict: View Template Render: View not found for [".concat(tmpViewHash,"]"));return'';}var tmpRenderGUID=this.pict.getUUID();var tmpView=this.pict.views[tmpViewHash];return tmpView.renderAsync('__Virtual',"__TemplateOutputCache.".concat(tmpRenderGUID),pRecord,function(pError,pResult){if(pError){_this97.log.warn("Pict: View Template Render: Error rendering view [".concat(tmpViewHash,"]"),pError);return fCallback(pError,'');}var tmpResult=_this97.pict.__TemplateOutputCache[tmpRenderGUID];// TODO: Uncomment this when we like how it's working
|
|
5613
5637
|
//delete this.pict.__TemplateOutputCache[tmpRenderGUID];
|
|
5614
|
-
return fCallback(null,tmpResult);});}}]);}(libPictTemplate);module.exports=PictTemplateProviderView;},{"pict-template":143}],
|
|
5638
|
+
return fCallback(null,tmpResult);});}}]);}(libPictTemplate);module.exports=PictTemplateProviderView;},{"pict-template":143}],214:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderRandomNumber=/*#__PURE__*/function(_libPictTemplate13){/**
|
|
5615
5639
|
* @param {Object} pFable - The Fable Framework instance
|
|
5616
5640
|
* @param {Object} pOptions - The options for the service
|
|
5617
5641
|
* @param {String} pServiceHash - The hash of the service
|
|
5618
|
-
*/function PictTemplateProviderRandomNumber(pFable,pOptions,pServiceHash){var
|
|
5642
|
+
*/function PictTemplateProviderRandomNumber(pFable,pOptions,pServiceHash){var _this98;_classCallCheck2(this,PictTemplateProviderRandomNumber);_this98=_callSuper(this,PictTemplateProviderRandomNumber,[pFable,pOptions,pServiceHash]);/** @type {any} */_this98.log;_this98.addPattern('{~RandomNumber:','~}');_this98.addPattern('{~RN:','~}');return _this98;}_inherits(PictTemplateProviderRandomNumber,_libPictTemplate13);return _createClass2(PictTemplateProviderRandomNumber,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fRandomNumber]::[".concat(tmpHash,"]"));}var tmpMinimumNumber=0;var tmpMaxNumber=9999999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpMinimumNumber=parseInt(tmpHashParts[0]);}catch(_unused2){tmpMinimumNumber=0;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch(_unused3){tmpMaxNumber=9999999;}}}return this.fable.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);}}]);}(libPictTemplate);module.exports=PictTemplateProviderRandomNumber;},{"pict-template":143}],215:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderRandomNumberString=/*#__PURE__*/function(_libPictTemplate14){/**
|
|
5619
5643
|
* @param {Object} pFable - The Fable Framework instance
|
|
5620
5644
|
* @param {Object} pOptions - The options for the service
|
|
5621
5645
|
* @param {String} pServiceHash - The hash of the service
|
|
5622
|
-
*/function PictTemplateProviderRandomNumberString(pFable,pOptions,pServiceHash){var
|
|
5646
|
+
*/function PictTemplateProviderRandomNumberString(pFable,pOptions,pServiceHash){var _this99;_classCallCheck2(this,PictTemplateProviderRandomNumberString);_this99=_callSuper(this,PictTemplateProviderRandomNumberString,[pFable,pOptions,pServiceHash]);/** @type {any} */_this99.log;_this99.addPattern('{~RandomNumberString:','~}');_this99.addPattern('{~RNS:','~}');return _this99;}_inherits(PictTemplateProviderRandomNumberString,_libPictTemplate14);return _createClass2(PictTemplateProviderRandomNumberString,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fRandomNumberString]::[".concat(tmpHash,"]"));}var tmpStringLength=4;var tmpMaxNumber=9999;if(tmpHash.length>0){var tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpStringLength=parseInt(tmpHashParts[0]);}catch(_unused4){tmpStringLength=4;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch(_unused5){tmpMaxNumber=9999;}}}return this.fable.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);}}]);}(libPictTemplate);module.exports=PictTemplateProviderRandomNumberString;},{"pict-template":143}],216:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDollars=/*#__PURE__*/function(_libPictTemplate15){/**
|
|
5623
5647
|
* @param {Object} pFable - The Fable Framework instance
|
|
5624
5648
|
* @param {Object} pOptions - The options for the service
|
|
5625
5649
|
* @param {String} pServiceHash - The hash of the service
|
|
5626
|
-
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var
|
|
5650
|
+
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var _this100;_classCallCheck2(this,PictTemplateProviderDollars);_this100=_callSuper(this,PictTemplateProviderDollars,[pFable,pOptions,pServiceHash]);/** @type {any} */_this100.log;_this100.addPattern('{~DataJson:','~}');_this100.addPattern('{~DJ:','~}');return _this100;}_inherits(PictTemplateProviderDollars,_libPictTemplate15);return _createClass2(PictTemplateProviderDollars,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataJson]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataJson]::[".concat(tmpHash,"]"));}var tmpDataToStringify=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(!tmpDataToStringify){tmpDataToStringify=pRecord;}return JSON.stringify(tmpDataToStringify);}}]);}(libPictTemplate);module.exports=PictTemplateProviderDollars;},{"pict-template":143}],217:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateOnlyFormat=/*#__PURE__*/function(_libPictTemplate16){/**
|
|
5627
5651
|
* @param {import('fable')} pFable - The Fable Framework instance
|
|
5628
5652
|
* @param {any} pOptions - The options for the service
|
|
5629
5653
|
* @param {String} pServiceHash - The hash of the service
|
|
5630
|
-
*/function PictTemplateProviderDateOnlyFormat(pFable,pOptions,pServiceHash){var
|
|
5654
|
+
*/function PictTemplateProviderDateOnlyFormat(pFable,pOptions,pServiceHash){var _this101;_classCallCheck2(this,PictTemplateProviderDateOnlyFormat);_this101=_callSuper(this,PictTemplateProviderDateOnlyFormat,[pFable,pOptions,pServiceHash]);/** @type {any} */_this101.options;/** @type {any} */_this101.log;_this101.addPattern('{~DateOnlyFormat:','~}');return _this101;}_inherits(PictTemplateProviderDateOnlyFormat,_libPictTemplate16);return _createClass2(PictTemplateProviderDateOnlyFormat,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpDateValueSet=tmpHash.split('^');if(tmpDateValueSet.length<2){this.log.error("PICT Template [fDateOnlyFormat]::[".concat(tmpHash,"] did not have a valid format string and date."));return'';}var tmpDateValue=this.resolveStateFromAddress(tmpDateValueSet[0],tmpData,pContextArray);if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDateOnlyFormat]::[".concat(tmpHash,"] with data:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDateOnlyFormat]::[".concat(tmpHash,"]"));}// TODO: Modularize this
|
|
5631
5655
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue).tz('UTC');return tmpDayJS.format(tmpDateValueSet[1]);}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateOnlyFormat;/*
|
|
5632
5656
|
# DEAR DEAD CODE DIARY:
|
|
5633
5657
|
|
|
5634
5658
|
```javascript
|
|
5635
5659
|
|
|
5636
5660
|
```
|
|
5637
|
-
*/},{"pict-template":143}],
|
|
5661
|
+
*/},{"pict-template":143}],218:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateOnlyYMD=/*#__PURE__*/function(_libPictTemplate17){/**
|
|
5638
5662
|
* @param {Object} pFable - The Fable Framework instance
|
|
5639
5663
|
* @param {Object} pOptions - The options for the service
|
|
5640
5664
|
* @param {String} pServiceHash - The hash of the service
|
|
5641
|
-
*/function PictTemplateProviderDateOnlyYMD(pFable,pOptions,pServiceHash){var
|
|
5665
|
+
*/function PictTemplateProviderDateOnlyYMD(pFable,pOptions,pServiceHash){var _this102;_classCallCheck2(this,PictTemplateProviderDateOnlyYMD);_this102=_callSuper(this,PictTemplateProviderDateOnlyYMD,[pFable,pOptions,pServiceHash]);/** @type {any} */_this102.options;/** @type {any} */_this102.log;_this102.addPattern('{~DateOnlyYMD:','~}');return _this102;}/**
|
|
5642
5666
|
* Render a template expression, returning a string with the resulting content.
|
|
5643
5667
|
*
|
|
5644
5668
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5646,15 +5670,15 @@ var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue).tz('UTC');return tmpDayJS.
|
|
|
5646
5670
|
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
5647
5671
|
*
|
|
5648
5672
|
* @return {string} The rendered template
|
|
5649
|
-
*/_inherits(PictTemplateProviderDateOnlyYMD,
|
|
5673
|
+
*/_inherits(PictTemplateProviderDateOnlyYMD,_libPictTemplate17);return _createClass2(PictTemplateProviderDateOnlyYMD,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpDateValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDateTimeYMD]::[".concat(tmpHash,"] with data:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDateTimeYMD]::[".concat(tmpHash,"]"));}// TODO: Modularize this
|
|
5650
5674
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue).tz('UTC');//FIXME: this is kind of wacked out; -62167219200000 is the unix ms timestamp for 0000-01-01 00:00:00 UTC
|
|
5651
5675
|
// not even sure showing negative is right; showing the era is probably better (BCE vs CE)
|
|
5652
|
-
var prefix=tmpDayJS.valueOf()<-62167219200000?'-':'';return prefix+tmpDayJS.format('YYYY-MM-DD');}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateOnlyYMD;},{"pict-template":143}],
|
|
5676
|
+
var prefix=tmpDayJS.valueOf()<-62167219200000?'-':'';return prefix+tmpDayJS.format('YYYY-MM-DD');}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateOnlyYMD;},{"pict-template":143}],219:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateTimeFormat=/*#__PURE__*/function(_libPictTemplate18){/**
|
|
5653
5677
|
* @param {Object} pFable - The Fable Framework instance
|
|
5654
5678
|
* @param {Object} pOptions - The options for the service
|
|
5655
5679
|
* @param {String} pServiceHash - The hash of the service
|
|
5656
|
-
*/function PictTemplateProviderDateTimeFormat(pFable,pOptions,pServiceHash){var
|
|
5657
|
-
return
|
|
5680
|
+
*/function PictTemplateProviderDateTimeFormat(pFable,pOptions,pServiceHash){var _this103;_classCallCheck2(this,PictTemplateProviderDateTimeFormat);_this103=_callSuper(this,PictTemplateProviderDateTimeFormat,[pFable,pOptions,pServiceHash]);/** @type {any} */_this103.options;/** @type {any} */_this103.log;_this103.addPattern('{~DateTimeFormat:','~}');_this103.addPattern('{~DateFormat:','~}');// for backwards compatibility
|
|
5681
|
+
return _this103;}_inherits(PictTemplateProviderDateTimeFormat,_libPictTemplate18);return _createClass2(PictTemplateProviderDateTimeFormat,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpDateValueSet=tmpHash.split('^');if(tmpDateValueSet.length<2){this.log.error("PICT Template [fDateTimeFormat]::[".concat(tmpHash,"] did not have a valid format string and date."));return'';}var tmpDateValue=this.resolveStateFromAddress(tmpDateValueSet[0],tmpData,pContextArray);if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDateTimeFormat]::[".concat(tmpHash,"] with data:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDateTimeFormat]::[".concat(tmpHash,"]"));}// TODO: Modularize this
|
|
5658
5682
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);try{// Try to cast the day to be a specific timezone if one is set for the app
|
|
5659
5683
|
if(this.options.Timezone){tmpDayJS=tmpDayJS.tz(this.options.Timezone);}else{try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}}catch(_unused6){//this.log.error(`Error casting date passed timezone using tz .. casting to the browser guess which is [${this.fable.Dates.dayJS.tz.guess()}].`);
|
|
5660
5684
|
// Day.js will try to guess the user's timezone for us
|
|
@@ -5664,12 +5688,12 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
5664
5688
|
```javascript
|
|
5665
5689
|
|
|
5666
5690
|
```
|
|
5667
|
-
*/},{"pict-template":143}],
|
|
5691
|
+
*/},{"pict-template":143}],220:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateTimeYMD=/*#__PURE__*/function(_libPictTemplate19){/**
|
|
5668
5692
|
* @param {Object} pFable - The Fable Framework instance
|
|
5669
5693
|
* @param {Object} pOptions - The options for the service
|
|
5670
5694
|
* @param {String} pServiceHash - The hash of the service
|
|
5671
|
-
*/function PictTemplateProviderDateTimeYMD(pFable,pOptions,pServiceHash){var
|
|
5672
|
-
return
|
|
5695
|
+
*/function PictTemplateProviderDateTimeYMD(pFable,pOptions,pServiceHash){var _this104;_classCallCheck2(this,PictTemplateProviderDateTimeYMD);_this104=_callSuper(this,PictTemplateProviderDateTimeYMD,[pFable,pOptions,pServiceHash]);/** @type {any} */_this104.options;/** @type {any} */_this104.log;_this104.addPattern('{~DateTimeYMD:','~}');_this104.addPattern('{~DateYMD:','~}');// for backwards compatibility
|
|
5696
|
+
return _this104;}/**
|
|
5673
5697
|
* Render a template expression, returning a string with the resulting content.
|
|
5674
5698
|
*
|
|
5675
5699
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5677,90 +5701,90 @@ return _this100;}/**
|
|
|
5677
5701
|
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
5678
5702
|
*
|
|
5679
5703
|
* @return {string} The rendered template
|
|
5680
|
-
*/_inherits(PictTemplateProviderDateTimeYMD,
|
|
5704
|
+
*/_inherits(PictTemplateProviderDateTimeYMD,_libPictTemplate19);return _createClass2(PictTemplateProviderDateTimeYMD,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpDateValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDateTimeYMD]::[".concat(tmpHash,"] with data:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDateTimeYMD]::[".concat(tmpHash,"]"));}// TODO: Modularize this
|
|
5681
5705
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);try{// Try to cast the day to be a specific timezone if one is set for the app
|
|
5682
5706
|
if(this.options.Timezone){tmpDayJS=tmpDayJS.tz(this.options.Timezone);}else{try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}}catch(_unused7){//this.log.error(`Error casting timezone using tz .. casting to the browser guess which is [${this.fable.Dates.dayJS.tz.guess()}].`);
|
|
5683
5707
|
// Day.js will try to guess the user's timezone for us
|
|
5684
|
-
try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}return tmpDayJS.format('YYYY-MM-DD');}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateTimeYMD;},{"pict-template":143}],
|
|
5708
|
+
try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.log.error("Error guessing dayJS guess() function; dates may be formatted to GMT by default. (".concat(pError.message||pError,")"));}}return tmpDayJS.format('YYYY-MM-DD');}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateTimeYMD;},{"pict-template":143}],221:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDigits=/*#__PURE__*/function(_libPictTemplate20){/**
|
|
5685
5709
|
* @param {Object} pFable - The Fable Framework instance
|
|
5686
5710
|
* @param {Object} pOptions - The options for the service
|
|
5687
5711
|
* @param {String} pServiceHash - The hash of the service
|
|
5688
|
-
*/function PictTemplateProviderDigits(pFable,pOptions,pServiceHash){var
|
|
5712
|
+
*/function PictTemplateProviderDigits(pFable,pOptions,pServiceHash){var _this105;_classCallCheck2(this,PictTemplateProviderDigits);_this105=_callSuper(this,PictTemplateProviderDigits,[pFable,pOptions,pServiceHash]);/** @type {any} */_this105.options;/** @type {any} */_this105.log;_this105.addPattern('{~Digits:','~}');return _this105;}_inherits(PictTemplateProviderDigits,_libPictTemplate20);return _createClass2(PictTemplateProviderDigits,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDigits]::[".concat(tmpHash,"]"));}var tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);return this.fable.DataFormat.formatterAddCommasToNumber(this.fable.DataFormat.formatterRoundNumber(tmpColumnData,2));}}]);}(libPictTemplate);module.exports=PictTemplateProviderDigits;},{"pict-template":143}],222:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDollars=/*#__PURE__*/function(_libPictTemplate21){/**
|
|
5689
5713
|
* @param {Object} pFable - The Fable Framework instance
|
|
5690
5714
|
* @param {Object} pOptions - The options for the service
|
|
5691
5715
|
* @param {String} pServiceHash - The hash of the service
|
|
5692
|
-
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var
|
|
5716
|
+
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var _this106;_classCallCheck2(this,PictTemplateProviderDollars);_this106=_callSuper(this,PictTemplateProviderDollars,[pFable,pOptions,pServiceHash]);/** @type {any} */_this106.options;/** @type {any} */_this106.log;_this106.addPattern('{~Dollars:','~}');return _this106;}_inherits(PictTemplateProviderDollars,_libPictTemplate21);return _createClass2(PictTemplateProviderDollars,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDollars]::[".concat(tmpHash,"]"));}var tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);return this.fable.DataFormat.formatterDollars(tmpColumnData);}}]);}(libPictTemplate);module.exports=PictTemplateProviderDollars;},{"pict-template":143}],223:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderData=/*#__PURE__*/function(_libPictTemplate22){/**
|
|
5693
5717
|
* @param {Object} pFable - The Fable Framework instance
|
|
5694
5718
|
* @param {Object} pOptions - The options for the service
|
|
5695
5719
|
* @param {String} pServiceHash - The hash of the service
|
|
5696
|
-
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var
|
|
5720
|
+
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this107;_classCallCheck2(this,PictTemplateProviderData);_this107=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);/** @type {any} */_this107.log;_this107.addPattern('{~HtmlCommentEnd:','~}');_this107.addPattern('{~HCE:','~}');return _this107;}_inherits(PictTemplateProviderData,_libPictTemplate22);return _createClass2(PictTemplateProviderData,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpRecord=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"]"));}var tmpValue=false;if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray);}if(!tmpValue){return' -->';}return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderData;},{"pict-template":143}],224:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderData=/*#__PURE__*/function(_libPictTemplate23){/**
|
|
5697
5721
|
* @param {Object} pFable - The Fable Framework instance
|
|
5698
5722
|
* @param {Object} pOptions - The options for the service
|
|
5699
5723
|
* @param {String} pServiceHash - The hash of the service
|
|
5700
|
-
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var
|
|
5724
|
+
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this108;_classCallCheck2(this,PictTemplateProviderData);_this108=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);/** @type {any} */_this108.log;_this108.addPattern('{~HtmlCommentStart:','~}');_this108.addPattern('{~HCS:','~}');return _this108;}_inherits(PictTemplateProviderData,_libPictTemplate23);return _createClass2(PictTemplateProviderData,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpRecord=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fDataRender]::[".concat(tmpHash,"]"));}var tmpValue=false;if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray);}if(!tmpValue){return'<!-- ';}return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderData;},{"pict-template":143}],225:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderJoin=/*#__PURE__*/function(_libPictTemplate24){/**
|
|
5701
5725
|
* @param {Object} pFable - The Fable Framework instance
|
|
5702
5726
|
* @param {Object} pOptions - The options for the service
|
|
5703
5727
|
* @param {String} pServiceHash - The hash of the service
|
|
5704
|
-
*/function PictTemplateProviderJoin(pFable,pOptions,pServiceHash){var
|
|
5705
|
-
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoin;},{"pict-template":143}],
|
|
5728
|
+
*/function PictTemplateProviderJoin(pFable,pOptions,pServiceHash){var _this109;_classCallCheck2(this,PictTemplateProviderJoin);_this109=_callSuper(this,PictTemplateProviderJoin,[pFable,pOptions,pServiceHash]);/** @type {any} */_this109.options;/** @type {any} */_this109.log;_this109.addPattern('{~Join:','~}');_this109.addPattern('{~J:','~}');return _this109;}_inherits(PictTemplateProviderJoin,_libPictTemplate24);return _createClass2(PictTemplateProviderJoin,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash;var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Join [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Join [fDataRender]::[".concat(tmpHash,"]"));}var tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
5729
|
+
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoin;},{"pict-template":143}],226:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderJoinUnique=/*#__PURE__*/function(_libPictTemplate25){/**
|
|
5706
5730
|
* @param {Object} pFable - The Fable Framework instance
|
|
5707
5731
|
* @param {Object} pOptions - The options for the service
|
|
5708
5732
|
* @param {String} pServiceHash - The hash of the service
|
|
5709
|
-
*/function PictTemplateProviderJoinUnique(pFable,pOptions,pServiceHash){var
|
|
5710
|
-
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];var tmpValueMap={};for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){if(!(tmpValueSet[j]in tmpValueMap)){tmpValueMap[tmpValueSet[j]]=true;tmpValueList.push(tmpValueSet[j]);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoinUnique;},{"pict-template":143}],
|
|
5733
|
+
*/function PictTemplateProviderJoinUnique(pFable,pOptions,pServiceHash){var _this110;_classCallCheck2(this,PictTemplateProviderJoinUnique);_this110=_callSuper(this,PictTemplateProviderJoinUnique,[pFable,pOptions,pServiceHash]);/** @type {any} */_this110.options;/** @type {any} */_this110.log;_this110.addPattern('{~JoinUnique:','~}');_this110.addPattern('{~JU:','~}');return _this110;}_inherits(PictTemplateProviderJoinUnique,_libPictTemplate25);return _createClass2(PictTemplateProviderJoinUnique,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash;var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Join Unique [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Join Unique [fDataRender]::[".concat(tmpHash,"]"));}var tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
5734
|
+
var tmpSeparator=tmpDataAddresses.shift();var tmpValueList=[];var tmpValueMap={};for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(var j=0;j<tmpValueSet.length;j++){if(!(tmpValueSet[j]in tmpValueMap)){tmpValueMap[tmpValueSet[j]]=true;tmpValueList.push(tmpValueSet[j]);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderJoinUnique;},{"pict-template":143}],227:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderPascalCaseIdentifier=/*#__PURE__*/function(_libPictTemplate26){/**
|
|
5711
5735
|
* @param {Object} pFable - The Fable Framework instance
|
|
5712
5736
|
* @param {Object} pOptions - The options for the service
|
|
5713
5737
|
* @param {String} pServiceHash - The hash of the service
|
|
5714
|
-
*/function PictTemplateProviderPascalCaseIdentifier(pFable,pOptions,pServiceHash){var
|
|
5738
|
+
*/function PictTemplateProviderPascalCaseIdentifier(pFable,pOptions,pServiceHash){var _this111;_classCallCheck2(this,PictTemplateProviderPascalCaseIdentifier);_this111=_callSuper(this,PictTemplateProviderPascalCaseIdentifier,[pFable,pOptions,pServiceHash]);/** @type {any} */_this111.options;/** @type {any} */_this111.log;_this111.addPattern('{~PascalCaseIdentifier:','~}');return _this111;}_inherits(PictTemplateProviderPascalCaseIdentifier,_libPictTemplate26);return _createClass2(PictTemplateProviderPascalCaseIdentifier,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Template [fPascalCaseIdentifier]::[".concat(tmpHash,"]"));}var tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return'';}return this.pict.DataFormat.cleanNonAlphaCharacters(this.pict.DataFormat.capitalizeEachWord(tmpValue));}}]);}(libPictTemplate);module.exports=PictTemplateProviderPascalCaseIdentifier;/*
|
|
5715
5739
|
# DEAR DEAD CODE DIARY:
|
|
5716
5740
|
|
|
5717
5741
|
```javascript
|
|
5718
5742
|
|
|
5719
5743
|
```
|
|
5720
|
-
*/},{"pict-template":143}],
|
|
5744
|
+
*/},{"pict-template":143}],228:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderPluckJoinUnique=/*#__PURE__*/function(_libPictTemplate27){/**
|
|
5721
5745
|
* @param {Object} pFable - The Fable Framework instance
|
|
5722
5746
|
* @param {Object} pOptions - The options for the service
|
|
5723
5747
|
* @param {String} pServiceHash - The hash of the service
|
|
5724
|
-
*/function PictTemplateProviderPluckJoinUnique(pFable,pOptions,pServiceHash){var
|
|
5748
|
+
*/function PictTemplateProviderPluckJoinUnique(pFable,pOptions,pServiceHash){var _this112;_classCallCheck2(this,PictTemplateProviderPluckJoinUnique);_this112=_callSuper(this,PictTemplateProviderPluckJoinUnique,[pFable,pOptions,pServiceHash]);/** @type {any} */_this112.options;/** @type {any} */_this112.log;_this112.addPattern('{~PluckJoinUnique:','~}');_this112.addPattern('{~PJU:','~}');return _this112;}_inherits(PictTemplateProviderPluckJoinUnique,_libPictTemplate27);return _createClass2(PictTemplateProviderPluckJoinUnique,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash;var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Pluck Join Unique [fDataRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace("PICT Pluck Join Unique [fDataRender]::[".concat(tmpHash,"]"));}var tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<3){return'';}// Get the separator string
|
|
5725
5749
|
var tmpSeparator=tmpDataAddresses.shift();var tmpAddress=tmpDataAddresses.shift();var tmpValueList=[];var tmpValueMap={};for(var i=0;i<tmpDataAddresses.length;i++){var tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray);if(tmpValueSet&&Array.isArray(tmpValueSet)){// This one only works on arrays of objects.
|
|
5726
|
-
for(var j=0;j<tmpValueSet.length;j++){if(tmpValueSet[j]===null||_typeof(tmpValueSet)!=='object'){continue;}var tmpValue=this.pict.manifest.getValueByHash(tmpValueSet[j],tmpAddress);if(!(tmpValue in tmpValueMap)){tmpValueMap[tmpValue]=true;tmpValueList.push(tmpValue);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderPluckJoinUnique;},{"pict-template":143}],
|
|
5750
|
+
for(var j=0;j<tmpValueSet.length;j++){if(tmpValueSet[j]===null||_typeof(tmpValueSet)!=='object'){continue;}var tmpValue=this.pict.manifest.getValueByHash(tmpValueSet[j],tmpAddress);if(!(tmpValue in tmpValueMap)){tmpValueMap[tmpValue]=true;tmpValueList.push(tmpValue);}}}else if(tmpValueSet){if(!(tmpValueSet in tmpValueMap)){tmpValueMap[tmpValueSet]=true;tmpValueList.push(tmpValueSet);}}}return tmpValueList.join(tmpSeparator);}}]);}(libPictTemplate);module.exports=PictTemplateProviderPluckJoinUnique;},{"pict-template":143}],229:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderBreakpoint=/*#__PURE__*/function(_libPictTemplate28){/**
|
|
5727
5751
|
* @param {Object} pFable - The Fable Framework instance
|
|
5728
5752
|
* @param {Object} pOptions - The options for the service
|
|
5729
5753
|
* @param {String} pServiceHash - The hash of the service
|
|
5730
|
-
*/function PictTemplateProviderBreakpoint(pFable,pOptions,pServiceHash){var
|
|
5754
|
+
*/function PictTemplateProviderBreakpoint(pFable,pOptions,pServiceHash){var _this113;_classCallCheck2(this,PictTemplateProviderBreakpoint);_this113=_callSuper(this,PictTemplateProviderBreakpoint,[pFable,pOptions,pServiceHash]);/** @type {any} */_this113.log;_this113.addPattern('{~Breakpoint','~}');return _this113;}_inherits(PictTemplateProviderBreakpoint,_libPictTemplate28);return _createClass2(PictTemplateProviderBreakpoint,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpError=new Error("PICT Template Breakpoint: ".concat(tmpHash));this.log.trace("PICT Template Breakpoint: ".concat(tmpHash),tmpError.stack);//throw tmpError;
|
|
5731
5755
|
debugger;// eslint-disable-line no-debugger
|
|
5732
|
-
return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderBreakpoint;},{"pict-template":143}],
|
|
5756
|
+
return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderBreakpoint;},{"pict-template":143}],230:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDataValueTree=/*#__PURE__*/function(_libPictTemplate29){/**
|
|
5733
5757
|
* @param {Object} pFable - The Fable Framework instance
|
|
5734
5758
|
* @param {Object} pOptions - The options for the service
|
|
5735
5759
|
* @param {String} pServiceHash - The hash of the service
|
|
5736
|
-
*/function PictTemplateProviderDataValueTree(pFable,pOptions,pServiceHash){var
|
|
5760
|
+
*/function PictTemplateProviderDataValueTree(pFable,pOptions,pServiceHash){var _this114;_classCallCheck2(this,PictTemplateProviderDataValueTree);_this114=_callSuper(this,PictTemplateProviderDataValueTree,[pFable,pOptions,pServiceHash]);/** @type {any} */_this114.log;_this114.addPattern('{~DataTree:','~}');_this114.addPattern('{~DT:','~}');return _this114;}_inherits(PictTemplateProviderDataValueTree,_libPictTemplate29);return _createClass2(PictTemplateProviderDataValueTree,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpData=_typeof(pRecord)==='object'?pRecord:{};tmpData.TemplateHash=pTemplateHash.trim();tmpData.ValueTreeParameters=tmpData.TemplateHash.split('^');if(tmpData.ValueTreeParameters.length<1){return'';}tmpData.ResolvedValue=this.resolveStateFromAddress(tmpData.ValueTreeParameters[0],tmpData,pContextArray);tmpData.ResolvedValueType=_typeof(tmpData.ResolvedValue);try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch(_unused8){tmpData.TreeMaxDepth=1;}var tmpPictObjectWrapTemplate=this.pict.TemplateProvider.getTemplate('PICT-Object-Wrap');if(!tmpPictObjectWrapTemplate){// This template is here because it is a default template. Users can override this template by providing their own as PICT-Object-Wrap
|
|
5737
5761
|
tmpPictObjectWrapTemplate="<div class=\"PICT PICTObjectSet\">{~D:Record.ObjectValueTree~}</div>";}if(tmpData.ResolvedValueType=='object'){tmpData.ObjectValueTree=this.dataValueTreeObjectSet(tmpData.ResolvedValue,tmpData.ResolvedValue,0,tmpData.TreeMaxDepth,pContextArray);}else{this.log.trace("PICT Template Log Value Tree: [".concat(tmpData.TemplateHash,"] resolved data is not an object."),tmpData.ResolvedValue);tmpData.ObjectValueTree=tmpData.ResolveValue;}return this.pict.parseTemplate(tmpPictObjectWrapTemplate,tmpData,null,pContextArray);}},{key:"dataValueTreeObjectSet",value:function dataValueTreeObjectSet(pObject,pRootObject,pCurrentDepth,pMaxDepth,pContextArray){var tmpTemplateResult='';if(_typeof(pObject)!=='object'){return tmpTemplateResult;}var tmpObjectValueKeys=Object.keys(pObject);var tmpPictObjectBranchTemplate=this.pict.TemplateProvider.getTemplate('PICT-Object-Branch');if(!tmpPictObjectBranchTemplate){// This template is here because it is a default template. Users can override this template by providing their own as PICT-Object-Branch
|
|
5738
|
-
tmpPictObjectBranchTemplate="\n<div class=\"PICTObjectBranchDepth_{~D:Record.CurrentDepth~}\"><div class=\"PICTObjectBranch\">{~D:Record.BranchKey~}</div><div class=\"PICTObjectBranchValue\">{~D:Record.BranchValue~}</div></div>\n";}for(var i=0;i<tmpObjectValueKeys.length;i++){var tmpBranchType=_typeof(pObject[tmpObjectValueKeys[i]]);var tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}var tmpDataValue={AppData:this.pict.AppData,Bundle:this.pict.Bundle,RootContainer:pRootObject,Container:pObject,BranchEntryCount:tmpObjectValueKeys.length,BranchIndex:i,BranchKey:tmpObjectValueKeys[i],BranchValue:tmpBranchValue,BranchDataType:tmpBranchType,CurrentDepth:pCurrentDepth,MaxDepth:pMaxDepth};tmpTemplateResult+=this.pict.parseTemplate(tmpPictObjectBranchTemplate,tmpDataValue,null,pContextArray);}return tmpTemplateResult;}}]);}(libPictTemplate);module.exports=PictTemplateProviderDataValueTree;},{"pict-template":143}],
|
|
5762
|
+
tmpPictObjectBranchTemplate="\n<div class=\"PICTObjectBranchDepth_{~D:Record.CurrentDepth~}\"><div class=\"PICTObjectBranch\">{~D:Record.BranchKey~}</div><div class=\"PICTObjectBranchValue\">{~D:Record.BranchValue~}</div></div>\n";}for(var i=0;i<tmpObjectValueKeys.length;i++){var tmpBranchType=_typeof(pObject[tmpObjectValueKeys[i]]);var tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}var tmpDataValue={AppData:this.pict.AppData,Bundle:this.pict.Bundle,RootContainer:pRootObject,Container:pObject,BranchEntryCount:tmpObjectValueKeys.length,BranchIndex:i,BranchKey:tmpObjectValueKeys[i],BranchValue:tmpBranchValue,BranchDataType:tmpBranchType,CurrentDepth:pCurrentDepth,MaxDepth:pMaxDepth};tmpTemplateResult+=this.pict.parseTemplate(tmpPictObjectBranchTemplate,tmpDataValue,null,pContextArray);}return tmpTemplateResult;}}]);}(libPictTemplate);module.exports=PictTemplateProviderDataValueTree;},{"pict-template":143}],231:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogStatement=/*#__PURE__*/function(_libPictTemplate30){/**
|
|
5739
5763
|
* @param {Object} pFable - The Fable Framework instance
|
|
5740
5764
|
* @param {Object} pOptions - The options for the service
|
|
5741
5765
|
* @param {String} pServiceHash - The hash of the service
|
|
5742
|
-
*/function PictTemplateProviderLogStatement(pFable,pOptions,pServiceHash){var
|
|
5766
|
+
*/function PictTemplateProviderLogStatement(pFable,pOptions,pServiceHash){var _this115;_classCallCheck2(this,PictTemplateProviderLogStatement);_this115=_callSuper(this,PictTemplateProviderLogStatement,[pFable,pOptions,pServiceHash]);/** @type {any} */_this115.log;_this115.addPattern('{~LogStatement:','~}');_this115.addPattern('{~LS:','~}');return _this115;}_inherits(PictTemplateProviderLogStatement,_libPictTemplate30);return _createClass2(PictTemplateProviderLogStatement,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();this.log.trace("PICT Template Log Message: ".concat(tmpHash));return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogStatement;},{"pict-template":143}],232:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogValue=/*#__PURE__*/function(_libPictTemplate31){/**
|
|
5743
5767
|
* @param {Object} pFable - The Fable Framework instance
|
|
5744
5768
|
* @param {Object} pOptions - The options for the service
|
|
5745
5769
|
* @param {String} pServiceHash - The hash of the service
|
|
5746
|
-
*/function PictTemplateProviderLogValue(pFable,pOptions,pServiceHash){var
|
|
5770
|
+
*/function PictTemplateProviderLogValue(pFable,pOptions,pServiceHash){var _this116;_classCallCheck2(this,PictTemplateProviderLogValue);_this116=_callSuper(this,PictTemplateProviderLogValue,[pFable,pOptions,pServiceHash]);/** @type {any} */_this116.log;_this116.addPattern('{~LogValue:','~}');_this116.addPattern('{~LV:','~}');return _this116;}_inherits(PictTemplateProviderLogValue,_libPictTemplate31);return _createClass2(PictTemplateProviderLogValue,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};var tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray);var tmpValueType=_typeof(tmpValue);if(tmpValue==null||tmpValueType=='undefined'){this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is ").concat(tmpValueType,"."));}else if(tmpValueType=='object'){this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is an object."),tmpValue);}else{this.log.trace("PICT Template Log Value: [".concat(tmpHash,"] is a ").concat(tmpValueType," = [").concat(tmpValue,"]"));}return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogValue;},{"pict-template":143}],233:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogValueTree=/*#__PURE__*/function(_libPictTemplate32){/**
|
|
5747
5771
|
* @param {Object} pFable - The Fable Framework instance
|
|
5748
5772
|
* @param {Object} pOptions - The options for the service
|
|
5749
5773
|
* @param {String} pServiceHash - The hash of the service
|
|
5750
|
-
*/function PictTemplateProviderLogValueTree(pFable,pOptions,pServiceHash){var
|
|
5774
|
+
*/function PictTemplateProviderLogValueTree(pFable,pOptions,pServiceHash){var _this117;_classCallCheck2(this,PictTemplateProviderLogValueTree);_this117=_callSuper(this,PictTemplateProviderLogValueTree,[pFable,pOptions,pServiceHash]);/** @type {any} */_defineProperty2(_this117,"logValueTreeObjectSet",function(pObject,pBaseAddress,pRootObject,pCurrentDepth,pMaxDepth){var tmpTemplateResult='';if(_typeof(pObject)!=='object'){return tmpTemplateResult;}var tmpObjectValueKeys=Object.keys(pObject);for(var i=0;i<tmpObjectValueKeys.length;i++){var tmpBranchType=_typeof(pObject[tmpObjectValueKeys[i]]);var tmpBranchValue='';switch(tmpBranchType){case'object':tmpBranchValue='...';break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}_this117.log.trace("[".concat(pBaseAddress,".").concat(tmpObjectValueKeys[i],"] (").concat(tmpBranchType,"): ").concat(tmpBranchValue));if(pCurrentDepth+1>pMaxDepth){return'';}else if(tmpBranchType=='object'){tmpBranchValue=_this117.logValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],"".concat(pBaseAddress,".").concat(tmpObjectValueKeys[i]),pRootObject,pCurrentDepth+1,pMaxDepth);}}return'';});_this117.log;_this117.addPattern('{~LogValueTree:','~}');_this117.addPattern('{~LVT:','~}');return _this117;}_inherits(PictTemplateProviderLogValueTree,_libPictTemplate32);return _createClass2(PictTemplateProviderLogValueTree,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpData=_typeof(pRecord)==='object'?pRecord:{};tmpData.TemplateHash=pTemplateHash.trim();tmpData.ValueTreeParameters=tmpData.TemplateHash.split('^');if(tmpData.ValueTreeParameters.length<1){return'';}tmpData.ResolvedValue=this.resolveStateFromAddress(tmpData.ValueTreeParameters[0],tmpData,pContextArray);tmpData.ResolvedValueType=_typeof(tmpData.ResolvedValue);try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch(_unused9){tmpData.TreeMaxDepth=1;}if(tmpData.ResolvedValueType=='object'){this.logValueTreeObjectSet(tmpData.ResolvedValue,tmpData.ValueTreeParameters[0],tmpData.ResolvedValue,0,tmpData.TreeMaxDepth);}else{this.log.trace("PICT Template Log Value Tree: [".concat(tmpData.TemplateHash,"] resolved data is not an object."),tmpData.ResolvedValue);}return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderLogValueTree;},{"pict-template":143}],234:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderNotEmpty=/*#__PURE__*/function(_libPictTemplate33){/**
|
|
5751
5775
|
* @param {Object} pFable - The Fable Framework instance
|
|
5752
5776
|
* @param {Object} pOptions - The options for the service
|
|
5753
5777
|
* @param {String} pServiceHash - The hash of the service
|
|
5754
|
-
*/function PictTemplateProviderNotEmpty(pFable,pOptions,pServiceHash){var
|
|
5755
|
-
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray)){return tmpHashParts[1];}else{return'';}}}]);}(libPictTemplate);module.exports=PictTemplateProviderNotEmpty;},{"pict-template":143}],
|
|
5778
|
+
*/function PictTemplateProviderNotEmpty(pFable,pOptions,pServiceHash){var _this118;_classCallCheck2(this,PictTemplateProviderNotEmpty);_this118=_callSuper(this,PictTemplateProviderNotEmpty,[pFable,pOptions,pServiceHash]);/** @type {any} */_this118.log;_this118.addPattern('{~NotEmpty:','~}');_this118.addPattern('{~NE:','~}');return _this118;}_inherits(PictTemplateProviderNotEmpty,_libPictTemplate33);return _createClass2(PictTemplateProviderNotEmpty,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>2){this.log.trace("PICT Template [fNotEmptyRender]::[".concat(tmpHash,"]"));}var tmpHashParts=tmpHash.split('^');// For now just check truthiness. Not sure if this is grand.
|
|
5779
|
+
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray)){return tmpHashParts[1];}else{return'';}}}]);}(libPictTemplate);module.exports=PictTemplateProviderNotEmpty;},{"pict-template":143}],235:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateIfBase=/*#__PURE__*/function(_libPictTemplate34){/**
|
|
5756
5780
|
* @param {Object} pFable - The Fable Framework instance
|
|
5757
5781
|
* @param {Object} pOptions - The options for the service
|
|
5758
5782
|
* @param {String} pServiceHash - The hash of the service
|
|
5759
|
-
*/function PictTemplateProviderTemplateIfBase(pFable,pOptions,pServiceHash){_classCallCheck2(this,PictTemplateProviderTemplateIfBase);return _callSuper(this,PictTemplateProviderTemplateIfBase,[pFable,pOptions,pServiceHash]);}_inherits(PictTemplateProviderTemplateIfBase,
|
|
5783
|
+
*/function PictTemplateProviderTemplateIfBase(pFable,pOptions,pServiceHash){_classCallCheck2(this,PictTemplateProviderTemplateIfBase);return _callSuper(this,PictTemplateProviderTemplateIfBase,[pFable,pOptions,pServiceHash]);}_inherits(PictTemplateProviderTemplateIfBase,_libPictTemplate34);return _createClass2(PictTemplateProviderTemplateIfBase,[{key:"compareValues",value:function compareValues(pValueLeft,pOperator,pValueRight){switch(pOperator){case'TRUE':return pValueLeft===true;case'FALSE':return pValueLeft===false;case'LNGT':case'LENGTH_GREATER_THAN':switch(_typeof(pValueLeft)){case'string':return pValueLeft.length>pValueRight;case'object':return pValueLeft.length>pValueRight;default:return false;}case'LNLT':case'LENGTH_LESS_THAN':switch(_typeof(pValueLeft)){case'string':return pValueLeft.length<pValueRight;case'object':return pValueLeft.length<pValueRight;default:return false;}case'!=':return pValueLeft!=pValueRight;case'<':return pValueLeft<pValueRight;case'>':return pValueLeft>pValueRight;case'<=':return pValueLeft<=pValueRight;case'>=':return pValueLeft>=pValueRight;case'===':return pValueLeft===pValueRight;case'==':return pValueLeft==pValueRight;default:return false;}}}]);}(libPictTemplate);module.exports=PictTemplateProviderTemplateIfBase;},{"pict-template":143}],236:[function(require,module,exports){var libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');var PictTemplateProviderTemplateIf=/*#__PURE__*/function(_libPictTemplateIf){/**
|
|
5760
5784
|
* @param {Object} pFable - The Fable Framework instance
|
|
5761
5785
|
* @param {Object} pOptions - The options for the service
|
|
5762
5786
|
* @param {String} pServiceHash - The hash of the service
|
|
5763
|
-
*/function PictTemplateProviderTemplateIf(pFable,pOptions,pServiceHash){var
|
|
5787
|
+
*/function PictTemplateProviderTemplateIf(pFable,pOptions,pServiceHash){var _this119;_classCallCheck2(this,PictTemplateProviderTemplateIf);_this119=_callSuper(this,PictTemplateProviderTemplateIf,[pFable,pOptions,pServiceHash]);/** @type {any} */_this119.log;_this119.addPattern('{~TemplateIf:','~}');_this119.addPattern('{~TIf:','~}');return _this119;}_inherits(PictTemplateProviderTemplateIf,_libPictTemplateIf);return _createClass2(PictTemplateProviderTemplateIf,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash;var tmpAddressOfData;var tmpComparisonOperation;var tmpHashParts=tmpHash.split(':');if(tmpHashParts.length<3){this.log.warn("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]"));return"Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]");}tmpTemplateHash=tmpHashParts[0];tmpAddressOfData=tmpHashParts[1];tmpComparisonOperation=tmpHashParts[2];// No template hash
|
|
5764
5788
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}// No comparison operation
|
|
5765
5789
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]");}// Now try to break the comparison into three parts...
|
|
5766
5790
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]");}// Now look up the data at the comparison location
|
|
@@ -5770,11 +5794,11 @@ if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not reso
|
|
|
5770
5794
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]")));}// Now try to break the comparison into three parts...
|
|
5771
5795
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]")));}// Now look up the data at the comparison location
|
|
5772
5796
|
try{// This is the only thing that's different from the absolute value function above. Collapse these.
|
|
5773
|
-
var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray));if(!tmpComparisonResult){return tmpCallback(null,'');}else{if(!tmpAddressOfData){return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}catch(pError){this.log.error("Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError),pError);return tmpCallback(pError,'');}}}]);}(libPictTemplateIf);module.exports=PictTemplateProviderTemplateIf;},{"./Pict-Template-TemplateIf-Base.js":
|
|
5797
|
+
var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray));if(!tmpComparisonResult){return tmpCallback(null,'');}else{if(!tmpAddressOfData){return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}catch(pError){this.log.error("Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError),pError);return tmpCallback(pError,'');}}}]);}(libPictTemplateIf);module.exports=PictTemplateProviderTemplateIf;},{"./Pict-Template-TemplateIf-Base.js":235}],237:[function(require,module,exports){var libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');var PictTemplateProviderTemplateIfAbsolute=/*#__PURE__*/function(_libPictTemplateIf2){/**
|
|
5774
5798
|
* @param {Object} pFable - The Fable Framework instance
|
|
5775
5799
|
* @param {Object} pOptions - The options for the service
|
|
5776
5800
|
* @param {String} pServiceHash - The hash of the service
|
|
5777
|
-
*/function PictTemplateProviderTemplateIfAbsolute(pFable,pOptions,pServiceHash){var
|
|
5801
|
+
*/function PictTemplateProviderTemplateIfAbsolute(pFable,pOptions,pServiceHash){var _this120;_classCallCheck2(this,PictTemplateProviderTemplateIfAbsolute);_this120=_callSuper(this,PictTemplateProviderTemplateIfAbsolute,[pFable,pOptions,pServiceHash]);/** @type {any} */_this120.log;_this120.addPattern('{~TemplateIfAbsolute:','~}');_this120.addPattern('{~TIfAbs:','~}');return _this120;}_inherits(PictTemplateProviderTemplateIfAbsolute,_libPictTemplateIf2);return _createClass2(PictTemplateProviderTemplateIfAbsolute,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){var tmpHash=pTemplateHash.trim();var tmpData=_typeof(pRecord)==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"] with tmpData:"),tmpData);}else if(this.pict.LogNoisiness>0){this.log.trace("PICT Template [fTemplateIfAbsoluteValueRender]::[".concat(tmpHash,"]"));}var tmpTemplateHash;var tmpAddressOfData;var tmpComparisonOperation;var tmpHashParts=tmpHash.split(':');if(tmpHashParts.length<3){this.log.warn("Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]"));return"Pict: Template If Absolute Value Render: TemplateHash not complete for [".concat(tmpHash,"]");}tmpTemplateHash=tmpHashParts[0];tmpAddressOfData=tmpHashParts[1];tmpComparisonOperation=tmpHashParts[2];// No template hash
|
|
5778
5802
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]");}// No comparison operation
|
|
5779
5803
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]");}// Now try to break the comparison into three parts...
|
|
5780
5804
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return"Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]");}// Now look up the data at the comparison location
|
|
@@ -5783,5 +5807,5 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray)
|
|
|
5783
5807
|
if(!tmpTemplateHash){this.log.warn("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: TemplateHash not resolved for [".concat(tmpHash,"]")));}// No comparison operation
|
|
5784
5808
|
if(!tmpComparisonOperation){this.log.warn("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: Comparison Operation not resolved for [".concat(tmpHash,"]")));}// Now try to break the comparison into three parts...
|
|
5785
5809
|
var tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]"));return tmpCallback(new Error("Pict: Template Render: Comparison Operation not complete (three parts expected) for [".concat(tmpHash,"]")));}// Now look up the data at the comparison location
|
|
5786
|
-
try{var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return tmpCallback(null,'');}else{if(!tmpAddressOfData){return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}catch(pError){this.log.error("Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError),pError);return tmpCallback(pError,'');}}}]);}(libPictTemplateIf);module.exports=PictTemplateProviderTemplateIfAbsolute;},{"./Pict-Template-TemplateIf-Base.js":
|
|
5810
|
+
try{var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return tmpCallback(null,'');}else{if(!tmpAddressOfData){return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}else{return this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray),function(pError,pValue){if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray);}}}catch(pError){this.log.error("Pict: Template Render: Error looking up comparison data for [".concat(tmpHash,"]: ").concat(pError),pError);return tmpCallback(pError,'');}}}]);}(libPictTemplateIf);module.exports=PictTemplateProviderTemplateIfAbsolute;},{"./Pict-Template-TemplateIf-Base.js":235}]},{},[199])(199);});
|
|
5787
5811
|
//# sourceMappingURL=pict.compatible.js.map
|