pict 1.0.247 → 1.0.249
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 +475 -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 +124 -125
- 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 +2 -2
- package/source/templates/Pict-Template-TemplateSetWithPayload.js +1 -1
- 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":58}],23:[function(require,module,exports){/**
|
|
446
446
|
* Double Linked List Node
|
|
447
447
|
*
|
|
448
448
|
* @author Steven Velozo <steven@velozo.com>
|
|
@@ -493,78 +493,11 @@ 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":100}],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":100}],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":101}],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
|
|
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":100}],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":100}],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":101}],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
|
|
564
497
|
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
|
|
565
498
|
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
|
|
566
|
-
return $getPrototypeOf(value==null?value:$Object(value));}:false;},{"call-bind-apply-helpers":28,"gopd":106}],
|
|
567
|
-
$defineProperty=false;}}module.exports=$defineProperty;},{}],
|
|
499
|
+
return $getPrototypeOf(value==null?value:$Object(value));}:false;},{"call-bind-apply-helpers":28,"gopd":106}],40:[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
|
|
500
|
+
$defineProperty=false;}}module.exports=$defineProperty;},{}],41:[function(require,module,exports){'use strict';/** @type {import('./eval')} */module.exports=EvalError;},{}],42:[function(require,module,exports){'use strict';/** @type {import('.')} */module.exports=Error;},{}],43:[function(require,module,exports){'use strict';/** @type {import('./range')} */module.exports=RangeError;},{}],44:[function(require,module,exports){'use strict';/** @type {import('./ref')} */module.exports=ReferenceError;},{}],45:[function(require,module,exports){'use strict';/** @type {import('./syntax')} */module.exports=SyntaxError;},{}],46:[function(require,module,exports){'use strict';/** @type {import('./type')} */module.exports=TypeError;},{}],47:[function(require,module,exports){'use strict';/** @type {import('./uri')} */module.exports=URIError;},{}],48:[function(require,module,exports){'use strict';/** @type {import('.')} */module.exports=Object;},{}],49:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
568
501
|
//
|
|
569
502
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
570
503
|
// copy of this software and associated documentation files (the
|
|
@@ -613,7 +546,7 @@ for(i=listeners.length-1;i>=0;i--){this.removeListener(type,listeners[i]);}}retu
|
|
|
613
546
|
// EventEmitters, we do not listen for `error` events here.
|
|
614
547
|
emitter.addEventListener(name,function wrapListener(arg){// IE does not have builtin `{ once: true }` support so we
|
|
615
548
|
// have to do it manually.
|
|
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));}}},{}],
|
|
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));}}},{}],50:[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"}};},{}],51:[function(require,module,exports){/**
|
|
617
550
|
* Base Logger Class
|
|
618
551
|
*
|
|
619
552
|
*
|
|
@@ -629,18 +562,18 @@ _inherits(BaseLogger,_libFableServiceProvi2);return _createClass2(BaseLogger,[{k
|
|
|
629
562
|
// ..but good enough for unique log stream identifiers
|
|
630
563
|
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.
|
|
631
564
|
}},{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.
|
|
632
|
-
return true;}}]);}(libFableServiceProviderBase);module.exports=BaseLogger;},{"fable-serviceproviderbase":
|
|
565
|
+
return true;}}]);}(libFableServiceProviderBase);module.exports=BaseLogger;},{"fable-serviceproviderbase":58}],52:[function(require,module,exports){/**
|
|
633
566
|
* Default Logger Provider Function
|
|
634
567
|
*
|
|
635
568
|
*
|
|
636
569
|
* @author Steven Velozo <steven@velozo.com>
|
|
637
570
|
*/// Return the providers that are available without extensions loaded
|
|
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":
|
|
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":54}],53:[function(require,module,exports){module.exports=[{"loggertype":"console","streamtype":"console","level":"trace"}];},{}],54:[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
|
|
639
572
|
_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
|
|
640
573
|
_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
|
|
641
574
|
_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
|
|
642
575
|
if(this._OutputObjectsToConsole&&typeof pObject!=='undefined'){console.log(JSON.stringify(pObject,null,2));}// Provide an easy way to be overridden and be consistent
|
|
643
|
-
return tmpLogLine;}}]);}(libBaseLogger);module.exports=ConsoleLogger;},{"./Fable-Log-BaseLogger.js":
|
|
576
|
+
return tmpLogLine;}}]);}(libBaseLogger);module.exports=ConsoleLogger;},{"./Fable-Log-BaseLogger.js":51}],55:[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
|
|
644
577
|
_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....
|
|
645
578
|
this.activelyWriting=true;var tmpFlushComplete=typeof fFlushComplete=='function'?fFlushComplete:this.defaultBufferFlushCallback;// Get the current buffer arrays. These should always have matching number of elements.
|
|
646
579
|
var tmpLineStrings=this.logLineStrings;var tmpObjectStrings=this.logObjectStrings;// Reset these to be filled while we process this queue...
|
|
@@ -649,7 +582,7 @@ var tmpConstructedBufferOutputString='';for(var i=0;i<tmpLineStrings.length;i++)
|
|
|
649
582
|
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.
|
|
650
583
|
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
|
|
651
584
|
this.logLineStrings.push(tmpLogLine);// Write out the object on a separate line if it is passed in
|
|
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":
|
|
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":54,"fs":19,"path":135}],56:[function(require,module,exports){/**
|
|
653
586
|
* Fable Logging Service
|
|
654
587
|
*/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
|
|
655
588
|
// have multiple outputs, such as bunyan.
|
|
@@ -661,7 +594,7 @@ switch(pLevel){case'trace':this.logStreamsTrace.push(pLogger);case'debug':this.l
|
|
|
661
594
|
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.
|
|
662
595
|
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
|
|
663
596
|
},{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
|
|
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":
|
|
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":50,"./Fable-Log-BaseLogger.js":51,"./Fable-Log-DefaultProviders-Node.js":52,"./Fable-Log-DefaultStreams.json":53,"./Fable-Log-Logger-Console.js":54,"./Fable-Log-Logger-SimpleFlatFile.js":55,"fable-serviceproviderbase":58}],57:[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"}};},{}],58:[function(require,module,exports){/**
|
|
665
598
|
* Fable Service Base
|
|
666
599
|
* @author <steven@velozo.com>
|
|
667
600
|
*/var libPackage=require('../package.json');var FableServiceProviderBase=/*#__PURE__*/function(){// The constructor can be used in two ways:
|
|
@@ -675,7 +608,7 @@ if(this.fable){this.UUID=pFable.getUUID();this.options=_typeof(pOptions)==='obje
|
|
|
675
608
|
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
|
|
676
609
|
this.serviceType="Unknown-".concat(this.UUID);// The service hash is used to identify the specific instantiation of the service in the services map
|
|
677
610
|
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
|
|
678
|
-
module.exports.CoreServiceProviderBase=FableServiceProviderBase;},{"../package.json":
|
|
611
|
+
module.exports.CoreServiceProviderBase=FableServiceProviderBase;},{"../package.json":57}],59:[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"}};},{}],60:[function(require,module,exports){module.exports={"Product":"ApplicationNameHere","ProductVersion":"0.0.0","ConfigFile":false,"LogStreams":[{"level":"trace"}]};},{}],61:[function(require,module,exports){(function(process){(function(){/**
|
|
679
612
|
* Fable Settings Template Processor
|
|
680
613
|
*
|
|
681
614
|
* This class allows environment variables to come in via templated expressions, and defaults to be set.
|
|
@@ -685,23 +618,23 @@ module.exports.CoreServiceProviderBase=FableServiceProviderBase;},{"../package.j
|
|
|
685
618
|
* @module Fable Settings
|
|
686
619
|
*/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
|
|
687
620
|
this.templateProcessor=new libPrecedent();// TODO: Make the environment variable wrap expression demarcation characters configurable?
|
|
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":147,"precedent":144}],
|
|
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":147,"precedent":144}],62:[function(require,module,exports){/**
|
|
689
622
|
* Fable Settings Add-on
|
|
690
623
|
*
|
|
691
624
|
*
|
|
692
625
|
* @author Steven Velozo <steven@velozo.com>
|
|
693
626
|
* @module Fable Settings
|
|
694
|
-
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;var libFableSettingsTemplateProcessor=require('./Fable-Settings-TemplateProcessor.js');var FableSettings=/*#__PURE__*/function(_libFableServiceProvi4){function FableSettings(pSettings,pServiceHash){var
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
var tmpSettings=
|
|
698
|
-
|
|
699
|
-
tmpSettings=
|
|
627
|
+
*/var libFableServiceProviderBase=require('fable-serviceproviderbase').CoreServiceProviderBase;var libFableSettingsTemplateProcessor=require('./Fable-Settings-TemplateProcessor.js');var FableSettings=/*#__PURE__*/function(_libFableServiceProvi4){function FableSettings(pSettings,pServiceHash){var _this0;_classCallCheck2(this,FableSettings);_this0=_callSuper(this,FableSettings,[pSettings,pServiceHash]);_this0.serviceType='SettingsManager';_this0._Package=require('../package.json');// Initialize the settings value template processor
|
|
628
|
+
_this0.settingsTemplateProcessor=new libFableSettingsTemplateProcessor();// set straight away so anything that uses it respects the initial setting
|
|
629
|
+
_this0._configureEnvTemplating(pSettings);_this0["default"]=_this0.buildDefaultSettings();// Construct a new settings object
|
|
630
|
+
var tmpSettings=_this0.merge(pSettings,_this0.buildDefaultSettings());// The base settings object (what they were on initialization, before other actors have altered them)
|
|
631
|
+
_this0.base=JSON.parse(JSON.stringify(tmpSettings));if(tmpSettings.DefaultConfigFile){try{// If there is a DEFAULT configuration file, try to load and merge it.
|
|
632
|
+
tmpSettings=_this0.merge(require(tmpSettings.DefaultConfigFile),tmpSettings);}catch(pException){// Why this? Often for an app we want settings to work out of the box, but
|
|
700
633
|
// would potentially want to have a config file for complex settings.
|
|
701
634
|
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.
|
|
702
|
-
tmpSettings=
|
|
635
|
+
tmpSettings=_this0.merge(require(tmpSettings.ConfigFile),tmpSettings);}catch(pException){// Why this? Often for an app we want settings to work out of the box, but
|
|
703
636
|
// would potentially want to have a config file for complex settings.
|
|
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);}}
|
|
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);}}_this0.settings=tmpSettings;return _this0;}// Build a default settings object. Use the JSON jimmy to ensure it is always a new object.
|
|
705
638
|
_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
|
|
706
639
|
},{key:"_configureEnvTemplating",value:function _configureEnvTemplating(pSettings){// default environment variable templating to on
|
|
707
640
|
this._PerformEnvTemplating=!pSettings||pSettings.NoEnvReplacement!==true;}// Resolve (recursive) any environment variables found in settings object.
|
|
@@ -709,8 +642,8 @@ this._PerformEnvTemplating=!pSettings||pSettings.NoEnvReplacement!==true;}// Res
|
|
|
709
642
|
* Check to see if a value is an object (but not an array).
|
|
710
643
|
*/},{key:"_isObject",value:function _isObject(value){return _typeof(value)==='object'&&!Array.isArray(value);}/**
|
|
711
644
|
* Merge two plain objects. Keys that are objects in both will be merged property-wise.
|
|
712
|
-
*/},{key:"_deepMergeObjects",value:function _deepMergeObjects(toObject,fromObject){var
|
|
713
|
-
|
|
645
|
+
*/},{key:"_deepMergeObjects",value:function _deepMergeObjects(toObject,fromObject){var _this1=this;if(!fromObject||!this._isObject(fromObject)){return;}Object.keys(fromObject).forEach(function(key){var fromValue=fromObject[key];if(_this1._isObject(fromValue)){var toValue=toObject[key];if(toValue&&_this1._isObject(toValue)){// both are objects, so do a recursive merge
|
|
646
|
+
_this1._deepMergeObjects(toValue,fromValue);return;}}toObject[key]=fromValue;});return toObject;}// Merge some new object into the existing settings.
|
|
714
647
|
},{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
|
|
715
648
|
var tmpSettingsFrom=_typeof(pSettingsFrom)==='object'?pSettingsFrom:{};// Default to the settings object if none is passed in for the merge.
|
|
716
649
|
var tmpSettingsTo=_typeof(pSettingsTo)==='object'?pSettingsTo:this.settings;// do not mutate the From object property values
|
|
@@ -719,7 +652,7 @@ this._configureEnvTemplating(tmpSettingsTo);return tmpSettingsTo;}// Fill in set
|
|
|
719
652
|
},{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
|
|
720
653
|
var tmpSettingsFrom=_typeof(pSettingsFrom)==='object'?pSettingsFrom:{};// do not mutate the From object property values
|
|
721
654
|
var tmpSettingsFromCopy=JSON.parse(JSON.stringify(tmpSettingsFrom));this.settings=this._deepMergeObjects(tmpSettingsFromCopy,this.settings);return this.settings;}}]);}(libFableServiceProviderBase);;// This is for backwards compatibility
|
|
722
|
-
function autoConstruct(pSettings){return new FableSettings(pSettings);}module.exports=FableSettings;module.exports["new"]=autoConstruct;},{"../package.json":
|
|
655
|
+
function autoConstruct(pSettings){return new FableSettings(pSettings);}module.exports=FableSettings;module.exports["new"]=autoConstruct;},{"../package.json":59,"./Fable-Settings-Default":60,"./Fable-Settings-TemplateProcessor.js":61,"fable-serviceproviderbase":58}],63:[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"}};},{}],64:[function(require,module,exports){/**
|
|
723
656
|
* Random Byte Generator - Browser version
|
|
724
657
|
*
|
|
725
658
|
*
|
|
@@ -737,47 +670,113 @@ this.getRandomValues(tmpBuffer);return tmpBuffer;}// Math.random()-based (RNG)
|
|
|
737
670
|
},{key:"generateRandomBytes",value:function generateRandomBytes(){// If all else fails, use Math.random(). It's fast, but is of unspecified
|
|
738
671
|
// quality.
|
|
739
672
|
var tmpBuffer=new Uint8Array(16);// eslint-disable-line no-undef
|
|
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;},{}],
|
|
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;},{}],65:[function(require,module,exports){/**
|
|
741
674
|
* Fable UUID Generator
|
|
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
|
|
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 _this10;_classCallCheck2(this,FableUUID);_this10=_callSuper(this,FableUUID,[pSettings,pServiceHash]);_this10.serviceType='UUID';/** @type {Object} */_this10._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.
|
|
743
676
|
// Note this allows UUIDs of various lengths (including very short ones) although guaranteed uniqueness goes downhill fast.
|
|
744
|
-
|
|
677
|
+
_this10._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
|
|
745
678
|
// Length for "Random UUID Mode" is set -- if not set it to 8
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
679
|
+
_this10._UUIDLength=_typeof(pSettings)==='object'&&'UUIDLength'in pSettings?pSettings.UUIDLength+0:8;// Dictionary for "Random UUID Mode"
|
|
680
|
+
_this10._UUIDRandomDictionary=_typeof(pSettings)==='object'&&'UUIDDictionary'in pSettings?pSettings.UUIDDictionary+0:'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';_this10.randomByteGenerator=new libRandomByteGenerator();// Lookup table for hex codes
|
|
681
|
+
_this10._HexLookup=[];for(var i=0;i<256;++i){_this10._HexLookup[i]=(i+0x100).toString(16).substr(1);}return _this10;}// Adapted from node-uuid (https://github.com/kelektiv/node-uuid)
|
|
749
682
|
_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
|
|
750
683
|
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)
|
|
751
684
|
},{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`
|
|
752
685
|
tmpRandomBytes[6]=tmpRandomBytes[6]&0x0f|0x40;tmpRandomBytes[8]=tmpRandomBytes[8]&0x3f|0x80;return this.bytesToUUID(tmpRandomBytes);}// Simple random UUID generation
|
|
753
686
|
},{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)
|
|
754
687
|
},{key:"getUUID",value:function getUUID(){if(this._UUIDModeRandom){return this.generateRandom();}else{return this.generateUUIDv4();}}}]);}(libFableServiceProviderBase);// This is for backwards compatibility
|
|
755
|
-
function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports["new"]=autoConstruct;},{"../package.json":
|
|
688
|
+
function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports["new"]=autoConstruct;},{"../package.json":63,"./Fable-UUID-Random.js":64,"fable-serviceproviderbase":58}],66:[function(require,module,exports){/*!
|
|
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.8","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){/**
|
|
756
755
|
* Fable Application Services Support Library
|
|
757
756
|
* @author <steven@velozo.com>
|
|
758
757
|
*/// Pre-init services
|
|
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
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
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 _this11;_classCallCheck2(this,Fable);_this11=_callSuper(this,Fable,[pSettings]);// Initialization Phase 0: Set up the lowest level state (fable is a utility service manager at heart)
|
|
759
|
+
_this11.serviceType='ServiceManager';/** @type {Object} */_this11._Package=libPackage;// An array of the types of services available
|
|
760
|
+
_this11.serviceTypes=[];// A map of instantiated services
|
|
761
|
+
_this11.servicesMap={};// A map of the default instantiated service by type
|
|
762
|
+
_this11.services={};// A map of class constructors for services
|
|
763
|
+
_this11.serviceClasses={};// If we need extra service initialization capabilities
|
|
764
|
+
_this11.extraServiceInitialization=false;// Set how noisy the system is about signaling complexity
|
|
765
|
+
_this11.LogNoisiness=0;// Initialization Phase 1: Set up the core utility services
|
|
767
766
|
// These are things like power, water, and sewage. They are required for fable to run (e.g. logging, settings, etc)
|
|
768
767
|
// Instantiate the default Settings Manager
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
768
|
+
_this11.SettingsManager=new libFableSettings(pSettings);_this11.SettingsManager=_this11.SettingsManager;// Instantiate the UUID generator
|
|
769
|
+
_this11.UUID=new libFableUUID(_this11.SettingsManager.settings);// Instantiate the logging system
|
|
770
|
+
_this11.Logging=new libFableLog(_this11.SettingsManager.settings);_this11.Logging.initialize();// Initialization Phase 1.5: Instantiate the service manager
|
|
772
771
|
// This is the start actual bootstrapping point for fable.
|
|
773
772
|
// For consistency fable is treated as a service.
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
773
|
+
_this11.ServiceManager=_this11;// TODO: Remove this when Orator and meadow-endpoints are shifted to this new pattern
|
|
774
|
+
_this11.serviceManager=_this11;// END TODO
|
|
775
|
+
_this11.connectFable(_this11);// --> Bootstrapping of fable into the Service Manager is complete
|
|
777
776
|
// Initialization Phase 2: Map in the default services.
|
|
778
777
|
// They will then be available in the Default service provider set as well.
|
|
779
|
-
|
|
780
|
-
|
|
778
|
+
_this11.connectPreinitServiceProviderInstance(_this11.UUID);_this11.connectPreinitServiceProviderInstance(_this11.Logging);_this11.connectPreinitServiceProviderInstance(_this11.SettingsManager);// Initialize and instantiate the default baked-in Data Arithmatic service
|
|
779
|
+
_this11.addAndInstantiateServiceType('EnvironmentData',require('./services/Fable-Service-EnvironmentData.js'));_this11.addServiceType('Template',require('./services/Fable-Service-Template.js'));_this11.addServiceType('MetaTemplate',require('./services/Fable-Service-MetaTemplate.js'));_this11.addServiceType('Anticipate',require('./services/Fable-Service-Anticipate.js'));_this11.addAndInstantiateServiceType('Dates',require('./services/Fable-Service-DateManipulation.js'));_this11.addAndInstantiateServiceType('DataFormat',require('./services/Fable-Service-DataFormat.js'));_this11.addAndInstantiateServiceType('DataGeneration',require('./services/Fable-Service-DataGeneration.js'));_this11.addAndInstantiateServiceType('Utility',require('./services/Fable-Service-Utility.js'));_this11.addAndInstantiateServiceType('Math',require('./services/Fable-Service-Math.js'));_this11.addServiceType('ExpressionParser',require('./services/Fable-Service-ExpressionParser.js'));_this11.addServiceType('RestClient',require('./services/Fable-Service-RestClient.js'));_this11.addServiceType('Manifest',require('manyfest'));_this11.addServiceType('ObjectCache',require('cachetrax'));_this11.addAndInstantiateServiceType('ProgressTime',require('./services/Fable-Service-ProgressTime.js'));_this11.addServiceType('ProgressTrackerSet',require('./services/Fable-Service-ProgressTrackerSet.js'));_this11.addServiceType('Operation',require('./services/Fable-Service-Operation.js'));_this11.addServiceType('CSVParser',require('./services/Fable-Service-CSVParser.js'));_this11.addServiceType('FilePersistence',require('./services/Fable-Service-FilePersistence.js'));return _this11;}/* 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
|
|
781
780
|
},{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?
|
|
782
781
|
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
|
|
783
782
|
this.servicesMap[pServiceType]={};// Add the type to the list of types
|
|
@@ -810,8 +809,8 @@ if(pServiceHash in this.servicesMap[pServiceType]){if(!(pServiceType in this)||t
|
|
|
810
809
|
* @param {Date} pDate - An optional javascript Date object to generate a datestamp for.
|
|
811
810
|
* @returns {string} - A string formatted as YYYY-MM-DD-HH-MM-SS
|
|
812
811
|
*/}],[{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
|
|
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-Math.js":87,"./services/Fable-Service-MetaTemplate.js":88,"./services/Fable-Service-Operation.js":92,"./services/Fable-Service-ProgressTime.js":93,"./services/Fable-Service-ProgressTrackerSet.js":95,"./services/Fable-Service-RestClient.js":96,"./services/Fable-Service-Template.js":97,"./services/Fable-Service-Utility.js":98,"cachetrax":22,"fable-log":
|
|
814
|
-
|
|
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-Math.js":87,"./services/Fable-Service-MetaTemplate.js":88,"./services/Fable-Service-Operation.js":92,"./services/Fable-Service-ProgressTime.js":93,"./services/Fable-Service-ProgressTrackerSet.js":95,"./services/Fable-Service-RestClient.js":96,"./services/Fable-Service-Template.js":97,"./services/Fable-Service-Utility.js":98,"cachetrax":22,"fable-log":56,"fable-serviceproviderbase":58,"fable-settings":62,"fable-uuid":65,"manyfest":124}],69:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceAnticipate=/*#__PURE__*/function(_libFableServiceBase){function FableServiceAnticipate(pFable,pOptions,pServiceHash){var _this12;_classCallCheck2(this,FableServiceAnticipate);_this12=_callSuper(this,FableServiceAnticipate,[pFable,pOptions,pServiceHash]);_this12.serviceType='AsyncAnticipate';// The queue of operations waiting to run.
|
|
813
|
+
_this12.operationQueue=[];_this12.erroredOperations=[];_this12.executingOperationCount=0;_this12.completedOperationCount=0;_this12.callDepth=0;_this12.maxOperations=1;_this12.lastError=undefined;_this12.waitingFunctions=[];return _this12;}_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.
|
|
815
814
|
if(this.lastError){// If there are no operations left, and we have waiting functions, call them.
|
|
816
815
|
for(var i=0;i<this.waitingFunctions.length;i++){//this.log.trace('Calling waiting function.')
|
|
817
816
|
this.waitingFunctions[i](this.lastError);}// Reset our state
|
|
@@ -824,7 +823,7 @@ this.lastError=undefined;this.waitingFunctions=[];}}// Expects a function fAsync
|
|
|
824
823
|
this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}},{key:"buildAnticipatorCallback",value:function buildAnticipatorCallback(){// This uses closure-scoped state to track the callback state
|
|
825
824
|
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
|
|
826
825
|
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.
|
|
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":
|
|
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":58}],70:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
828
827
|
* Parsing CSVs. Why? Because it's a thing that needs to be done.
|
|
829
828
|
*
|
|
830
829
|
* 1. And the other node CSV parsers had issues with the really messy files we had.
|
|
@@ -836,8 +835,8 @@ if(tmpCallbackState.OperationSet.callDepth>400){tmpCallbackState.OperationSet.ca
|
|
|
836
835
|
* do anything; unfortunately some files have a sequence issue with that.
|
|
837
836
|
*
|
|
838
837
|
* @class CSVParser
|
|
839
|
-
*/var CSVParser=/*#__PURE__*/function(_libFableServiceProvi6){function CSVParser(pFable,pOptions,pServiceHash){var
|
|
840
|
-
|
|
838
|
+
*/var CSVParser=/*#__PURE__*/function(_libFableServiceProvi6){function CSVParser(pFable,pOptions,pServiceHash){var _this13;_classCallCheck2(this,CSVParser);_this13=_callSuper(this,CSVParser,[pFable,pOptions,pServiceHash]);_this13.serviceType='CSVParser';_this13.Header=[];_this13.HeaderFieldNames=[];_this13.Delimiter=',';_this13.QuoteCharacter='"';_this13.CleanCharacters=['\r'];_this13.HeaderLineIndex=0;_this13.HasHeader=true;_this13.HasSetHeader=false;_this13.EmitHeader=false;_this13.EmitJSON=true;_this13.EscapedQuoteString='"';// Current Line Parsing State
|
|
839
|
+
_this13.CurrentLine='';_this13.CurrentRecord=[];_this13.InQuote=false;_this13.InEscapedQuote=false;_this13.LinesParsed=0;_this13.RowsEmitted=0;return _this13;}_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.
|
|
841
840
|
},{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.
|
|
842
841
|
if(this.InEscapedQuote){this.InEscapedQuote=false;}// If we aren't in a quote, enter quote
|
|
843
842
|
else if(!this.InQuote){this.InQuote=true;}// We are in a quote, so peek forward to see if this is an "escaped" quote pair
|
|
@@ -847,30 +846,30 @@ if(!this.InQuote){// Push the last remaining column from the buffer to the curre
|
|
|
847
846
|
this.pushLine();// Check to see if there is a header -- and if so, if this is the header row
|
|
848
847
|
if(this.HasHeader&&!this.HasSetHeader&&this.RowsEmitted==this.HeaderLineIndex){this.HasSetHeader=true;// Override the format as json bit
|
|
849
848
|
this.setHeader(this.emitRow(false));// No matter what, formatting this as JSON is silly and we don't want to go there anyway.
|
|
850
|
-
if(this.EmitHeader){return this.Header;}else{return false;}}else{return this.emitRow();}}else{return false;}}}]);}(libFableServiceProviderBase);module.exports=CSVParser;},{"fable-serviceproviderbase":
|
|
849
|
+
if(this.EmitHeader){return this.Header;}else{return false;}}else{return this.emitRow();}}else{return false;}}}]);}(libFableServiceProviderBase);module.exports=CSVParser;},{"fable-serviceproviderbase":58}],71:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
851
850
|
* Data Formatting and Translation Functions
|
|
852
851
|
*
|
|
853
852
|
* @class DataFormat
|
|
854
|
-
*/var DataFormat=/*#__PURE__*/function(_libFableServiceProvi7){function DataFormat(pFable,pOptions,pServiceHash){var
|
|
853
|
+
*/var DataFormat=/*#__PURE__*/function(_libFableServiceProvi7){function DataFormat(pFable,pOptions,pServiceHash){var _this14;_classCallCheck2(this,DataFormat);_this14=_callSuper(this,DataFormat,[pFable,pOptions,pServiceHash]);/**
|
|
855
854
|
* Pad the start of a string.
|
|
856
855
|
*
|
|
857
856
|
* @param {*} pString
|
|
858
857
|
* @param {number} pTargetLength
|
|
859
858
|
* @returns {string} pPadString
|
|
860
|
-
*/_defineProperty2(
|
|
859
|
+
*/_defineProperty2(_this14,"stringPadStart",function(pString,pTargetLength,pPadString){var tmpString=pString.toString();return this.stringGeneratePaddingString(tmpString,pTargetLength,pPadString)+tmpString;});/**
|
|
861
860
|
* Pad the end of a string.
|
|
862
861
|
*
|
|
863
862
|
* @param {*} pString
|
|
864
863
|
* @param {number} pTargetLength
|
|
865
864
|
* @returns {string} pPadString
|
|
866
|
-
*/_defineProperty2(
|
|
865
|
+
*/_defineProperty2(_this14,"stringPadEnd",function(pString,pTargetLength,pPadString){var tmpString=pString.toString();return tmpString+this.stringGeneratePaddingString(tmpString,pTargetLength,pPadString);});_this14.serviceType='DataArithmatic';// Regular Expressions (so they don't have to be recompiled every time)
|
|
867
866
|
// These could be defined as static, but I'm not sure if that will work with browserify ... and specifically the QT browser.
|
|
868
|
-
|
|
867
|
+
_this14._Regex_formatterInsertCommas=/.{1,3}/g;// Match Function:
|
|
869
868
|
// function(pMatch, pSign, pZeros, pBefore, pDecimal, pAfter)
|
|
870
869
|
// Thoughts about below: /^([+-]?)(0*)(\d+)(\.(\d+))?$/;
|
|
871
|
-
|
|
870
|
+
_this14._Regex_formatterAddCommasToNumber=/^([-+]?)(0?)(\d+)(.?)(\d+)$/g;_this14._Regex_formatterDollarsRemoveCommas=/,/gi;_this14._Regex_formatterCleanNonAlphaChar=/[^a-zA-Z]/gi;_this14._Regex_formatterCapitalizeEachWord=/([a-zA-Z]+)/g;// TODO: Potentially pull these in from a configuration.
|
|
872
871
|
// TODO: Use locale data for this if it's defaults all the way down.
|
|
873
|
-
|
|
872
|
+
_this14._Value_MoneySign_Currency='$';_this14._Value_NaN_Currency='--';_this14._Value_GroupSeparator_Number=',';_this14._Value_Prefix_StringHash='HSH';_this14._Value_Clean_formatterCleanNonAlpha='';_this14._UseEngineStringStartsWith=typeof String.prototype.startsWith==='function';_this14._UseEngineStringEndsWith=typeof String.prototype.endsWith==='function';return _this14;}/*************************************************************************
|
|
874
873
|
* String Manipulation and Comparison Functions
|
|
875
874
|
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*//**
|
|
876
875
|
* Reverse a string
|
|
@@ -921,9 +920,9 @@ if(!(pEndIndex<this.length)){pEndIndex=this.length;}else{pEndIndex|=0;// round p
|
|
|
921
920
|
*/},{key:"concatenateStrings",value:function concatenateStrings(){for(var _len2=arguments.length,pStrings=new Array(_len2),_key2=0;_key2<_len2;_key2++){pStrings[_key2]=arguments[_key2];}return this.joinStrings.apply(this,[''].concat(pStrings));}/**
|
|
922
921
|
* Concatenate a list of strings together. Non-strings are excluded.
|
|
923
922
|
*
|
|
924
|
-
* @param {
|
|
923
|
+
* @param {...any} pParams - Any number of parameters
|
|
925
924
|
* @return {string}
|
|
926
|
-
*/},{key:"concatenateStringsInternal",value:function concatenateStringsInternal(
|
|
925
|
+
*/},{key:"concatenateStringsInternal",value:function concatenateStringsInternal(){var pParams=Array.prototype.slice.call(arguments);var _tmpArrayFlattener=function tmpArrayFlattener(p){if(Array.isArray(p)){return p.flatMap(_tmpArrayFlattener);}if(_typeof(p)==='object'){return Object.values(p);}return[p];};var tmpFlattenedArrays=pParams.flatMap(_tmpArrayFlattener);return this.concatenateStrings.apply(this,_toConsumableArray(tmpFlattenedArrays));}/**
|
|
927
926
|
* Join a list of strings together. Non-strings are excluded.
|
|
928
927
|
*
|
|
929
928
|
* @param {string} pJoin - The string to join with
|
|
@@ -933,9 +932,9 @@ if(!(pEndIndex<this.length)){pEndIndex=this.length;}else{pEndIndex|=0;// round p
|
|
|
933
932
|
* Joins a list of strings together. Non-strings are excluded.
|
|
934
933
|
*
|
|
935
934
|
* @param {string} pJoin - The string to join with
|
|
936
|
-
* @param {
|
|
935
|
+
* @param {...any} pParams - Any number of parameters
|
|
937
936
|
* @return {string}
|
|
938
|
-
*/},{key:"joinStringsInternal",value:function joinStringsInternal(
|
|
937
|
+
*/},{key:"joinStringsInternal",value:function joinStringsInternal(){var _arguments=Array.prototype.slice.call(arguments),pJoinOn=_arguments[0],pParams=_arguments.slice(1);var _tmpArrayFlattener2=function tmpArrayFlattener(p){if(Array.isArray(p)){return p.flatMap(_tmpArrayFlattener2);}if(_typeof(p)==='object'){return Object.values(p);}return[p];};var tmpFlattenedArrays=pParams.flatMap(_tmpArrayFlattener2);return this.joinStrings.apply(this,[pJoinOn].concat(_toConsumableArray(tmpFlattenedArrays)));}/**
|
|
939
938
|
* Concatenate a list of values together into a string.
|
|
940
939
|
*
|
|
941
940
|
* @param {...any} pValues - The strings to concatenate
|
|
@@ -943,9 +942,9 @@ if(!(pEndIndex<this.length)){pEndIndex=this.length;}else{pEndIndex|=0;// round p
|
|
|
943
942
|
*/},{key:"concatenateStringsRaw",value:function concatenateStringsRaw(){for(var _len4=arguments.length,pValues=new Array(_len4),_key4=0;_key4<_len4;_key4++){pValues[_key4]=arguments[_key4];}return this.joinStringsRaw.apply(this,[''].concat(pValues));}/**
|
|
944
943
|
* Concatenate a list of values together into a string.
|
|
945
944
|
*
|
|
946
|
-
* @param {
|
|
945
|
+
* @param {...any} pParams - Any number of parameters
|
|
947
946
|
* @return {string}
|
|
948
|
-
*/},{key:"concatenateStringsRawInternal",value:function concatenateStringsRawInternal(pValueObjectSetAddress){
|
|
947
|
+
*/},{key:"concatenateStringsRawInternal",value:function concatenateStringsRawInternal(pValueObjectSetAddress){var pParams=Array.prototype.slice.call(arguments);var _tmpArrayFlattener3=function tmpArrayFlattener(p){if(Array.isArray(p)){return p.flatMap(_tmpArrayFlattener3);}if(_typeof(p)==='object'){return Object.values(p);}return[p];};var tmpFlattenedArrays=pParams.flatMap(_tmpArrayFlattener3);return this.concatenateStringsRaw.apply(this,_toConsumableArray(tmpFlattenedArrays));}/**
|
|
949
948
|
* Join a list of values together into a string.
|
|
950
949
|
*
|
|
951
950
|
* @param {string} pJoin - The string to join with
|
|
@@ -955,9 +954,9 @@ if(!(pEndIndex<this.length)){pEndIndex=this.length;}else{pEndIndex|=0;// round p
|
|
|
955
954
|
* Joins a list of values together into a string.
|
|
956
955
|
*
|
|
957
956
|
* @param {string} pJoin - The string to join with
|
|
958
|
-
* @param {
|
|
957
|
+
* @param {...any} pParams - Any number of parameters
|
|
959
958
|
* @return {string}
|
|
960
|
-
*/},{key:"joinStringsRawInternal",value:function joinStringsRawInternal(
|
|
959
|
+
*/},{key:"joinStringsRawInternal",value:function joinStringsRawInternal(){var _arguments2=Array.prototype.slice.call(arguments),pJoinOn=_arguments2[0],pParams=_arguments2.slice(1);var _tmpArrayFlattener4=function tmpArrayFlattener(p){if(Array.isArray(p)){return p.flatMap(_tmpArrayFlattener4);}if(_typeof(p)==='object'){return Object.values(p);}return[p];};var tmpFlattenedArrays=pParams.flatMap(_tmpArrayFlattener4);return this.joinStringsRaw.apply(this,[pJoinOn].concat(_toConsumableArray(tmpFlattenedArrays)));}/**
|
|
961
960
|
* Clean wrapping characters if they exist consistently around the string. If they do not, the string is returned unchanged.
|
|
962
961
|
*
|
|
963
962
|
* @param {string} pWrapCharacter - The character expected as the wrapping character
|
|
@@ -1132,11 +1131,11 @@ return'';}if(tmpEnclosedValueEndIndex>0&&tmpEnclosedValueEndIndex>tmpEnclosedVal
|
|
|
1132
1131
|
* @param {number} pEnclosureEnd
|
|
1133
1132
|
* @returns {string}
|
|
1134
1133
|
*/},{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
|
|
1135
|
-
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":
|
|
1134
|
+
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":58}],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');/**
|
|
1136
1135
|
* FableServiceDataGeneration class provides various methods for generating random data.
|
|
1137
1136
|
*
|
|
1138
1137
|
* @extends libFableServiceBase
|
|
1139
|
-
*/var FableServiceDataGeneration=/*#__PURE__*/function(_libFableServiceBase2){function FableServiceDataGeneration(pFable,pOptions,pServiceHash){var
|
|
1138
|
+
*/var FableServiceDataGeneration=/*#__PURE__*/function(_libFableServiceBase2){function FableServiceDataGeneration(pFable,pOptions,pServiceHash){var _this15;_classCallCheck2(this,FableServiceDataGeneration);_this15=_callSuper(this,FableServiceDataGeneration,[pFable,pOptions,pServiceHash]);_this15.serviceType='DataGeneration';_this15.defaultData=require('./Fable-Service-DataGeneration-DefaultValues.json');return _this15;}/**
|
|
1140
1139
|
* Generates a random integer between the specified minimum and maximum values.
|
|
1141
1140
|
*
|
|
1142
1141
|
* @param {number} pMinimum - The minimum value (inclusive).
|
|
@@ -1192,22 +1191,22 @@ if(tmpString[i]==tmpEnclosureStart){tmpEnclosureDepth++;if(tmpEnclosureDepth==1)
|
|
|
1192
1191
|
* Generates a random surname from the default surname set.
|
|
1193
1192
|
*
|
|
1194
1193
|
* @returns {string} A random surname.
|
|
1195
|
-
*/},{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":
|
|
1194
|
+
*/},{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":58}],74:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
1196
1195
|
* Date management a la Moment using days.js
|
|
1197
1196
|
*
|
|
1198
1197
|
* @class DateManipulation
|
|
1199
|
-
*/var DateManipulation=/*#__PURE__*/function(_libFableServiceProvi8){function DateManipulation(pFable,pOptions,pServiceHash){var
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1198
|
+
*/var DateManipulation=/*#__PURE__*/function(_libFableServiceProvi8){function DateManipulation(pFable,pOptions,pServiceHash){var _this16;_classCallCheck2(this,DateManipulation);_this16=_callSuper(this,DateManipulation,[pFable,pOptions,pServiceHash]);_this16.serviceType='Dates';_this16.dayJS=require('dayjs');// Include the `weekOfYear` plugin
|
|
1199
|
+
_this16.plugin_weekOfYear=require('dayjs/plugin/weekOfYear');_this16.dayJS.extend(_this16.plugin_weekOfYear);// Include the `weekday` plugin
|
|
1200
|
+
_this16.plugin_weekday=require('dayjs/plugin/weekday');_this16.dayJS.extend(_this16.plugin_weekday);// Include the `isoWeek` plugin
|
|
1201
|
+
_this16.plugin_isoWeek=require('dayjs/plugin/isoWeek');_this16.dayJS.extend(_this16.plugin_isoWeek);// Include the `timezone` plugin
|
|
1202
|
+
_this16.plugin_timezone=require('dayjs/plugin/timezone');_this16.dayJS.extend(_this16.plugin_timezone);// Include the `relativetime` plugin
|
|
1203
|
+
_this16.plugin_relativetime=require('dayjs/plugin/relativeTime');_this16.dayJS.extend(_this16.plugin_relativetime);// Include the `utc` plugin
|
|
1204
|
+
_this16.plugin_utc=require('dayjs/plugin/utc');_this16.dayJS.extend(_this16.plugin_utc);// Include the `advancedFormat` plugin
|
|
1205
|
+
_this16.plugin_advancedFormat=require('dayjs/plugin/advancedFormat');_this16.dayJS.extend(_this16.plugin_advancedFormat);// A developer can include locales if they want
|
|
1207
1206
|
// You would do the following:
|
|
1208
1207
|
// const localeDE = require('dayjs/locale/de');
|
|
1209
1208
|
// _Fable.Dates.dayJS.locale('de');
|
|
1210
|
-
return
|
|
1209
|
+
return _this16;}/**
|
|
1211
1210
|
* Calculates the difference in days between two dates.
|
|
1212
1211
|
*
|
|
1213
1212
|
* @param {string|Date|number} pDateStart - The start date. Can be a string, Date object, or timestamp.
|
|
@@ -1243,7 +1242,7 @@ return tmpEndDate.diff(tmpStartDate,'month');}/**
|
|
|
1243
1242
|
*/},{key:"dateYearDifference",value:function dateYearDifference(pDateStart,pDateEnd){// If there is not a valid start date, return NaN
|
|
1244
1243
|
if(pDateStart===undefined||pDateStart===null||pDateStart===''){return NaN;}var tmpStartDate=this.dayJS(pDateStart);// Without a valid end date, dayJS defaults to the current date
|
|
1245
1244
|
var tmpEndDate=this.dayJS(pDateEnd);// Returns the difference in years between two dates
|
|
1246
|
-
return tmpEndDate.diff(tmpStartDate,'year');}}]);}(libFableServiceProviderBase);module.exports=DateManipulation;},{"dayjs":
|
|
1245
|
+
return tmpEndDate.diff(tmpStartDate,'year');}}]);}(libFableServiceProviderBase);module.exports=DateManipulation;},{"dayjs":31,"dayjs/plugin/advancedFormat":32,"dayjs/plugin/isoWeek":33,"dayjs/plugin/relativeTime":34,"dayjs/plugin/timezone":35,"dayjs/plugin/utc":36,"dayjs/plugin/weekOfYear":37,"dayjs/plugin/weekday":38,"fable-serviceproviderbase":58}],75:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceEnvironmentData=/*#__PURE__*/function(_libFableServiceBase3){function FableServiceEnvironmentData(pFable,pOptions,pServiceHash){var _this17;_classCallCheck2(this,FableServiceEnvironmentData);_this17=_callSuper(this,FableServiceEnvironmentData,[pFable,pOptions,pServiceHash]);_this17.serviceType='EnvironmentData';_this17.Environment="node.js";return _this17;}_inherits(FableServiceEnvironmentData,_libFableServiceBase3);return _createClass2(FableServiceEnvironmentData);}(libFableServiceBase);module.exports=FableServiceEnvironmentData;},{"fable-serviceproviderbase":58}],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 ...
|
|
1247
1246
|
*
|
|
1248
1247
|
* This service is a simple expression parser that can handle math expressions, with magic(tm) lookup of addresses with a manifest.
|
|
1249
1248
|
*
|
|
@@ -1270,17 +1269,17 @@ return tmpEndDate.diff(tmpStartDate,'year');}}]);}(libFableServiceProviderBase);
|
|
|
1270
1269
|
* @param {Object} pFable - The Fable object.
|
|
1271
1270
|
* @param {Object} pOptions - The options for the service.
|
|
1272
1271
|
* @param {string} pServiceHash - The hash of the service.
|
|
1273
|
-
*/function FableServiceExpressionParser(pFable,pOptions,pServiceHash){var
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1272
|
+
*/function FableServiceExpressionParser(pFable,pOptions,pServiceHash){var _this18;_classCallCheck2(this,FableServiceExpressionParser);_this18=_callSuper(this,FableServiceExpressionParser,[pFable,pOptions,pServiceHash]);// The configuration for tokens that the solver recognizes, with precedence and friendly names.
|
|
1273
|
+
_this18.tokenMap=require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-TokenMap.json');// Keep track of maximum token precedence
|
|
1274
|
+
_this18.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.
|
|
1275
|
+
_this18.tokenRadix={};var tmpTokenKeys=Object.keys(_this18.tokenMap);for(var i=0;i<tmpTokenKeys.length;i++){var tmpTokenKey=tmpTokenKeys[i];var tmpToken=_this18.tokenMap[tmpTokenKey];tmpToken.Token=tmpTokenKey;tmpToken.Length=tmpTokenKey.length;var tmpTokenStartCharacter=tmpToken.Token[0];if(!(tmpTokenStartCharacter in _this18.tokenRadix)){// With a token count of 1 and a literal of true, we can assume it being in the radix is the token.
|
|
1276
|
+
_this18.tokenRadix[tmpTokenStartCharacter]={TokenCount:0,Literal:false,TokenKeys:[],TokenMap:{}};}_this18.tokenRadix[tmpTokenStartCharacter].TokenCount++;if(tmpTokenKey==tmpTokenStartCharacter){_this18.tokenRadix[tmpTokenStartCharacter].Literal=true;}_this18.tokenRadix[tmpTokenStartCharacter].TokenMap[tmpToken.Token]=tmpToken;_this18.tokenRadix[tmpTokenStartCharacter].TokenKeys.push(tmpTokenKey);_this18.tokenRadix[tmpTokenStartCharacter].TokenKeys.sort(function(pLeft,pRight){return pRight.length-pLeft.length;});if(_this18.tokenMaxPrecedence<tmpToken.Precedence){_this18.tokenMaxPrecedence=tmpToken.Precedence;}}// The configuration for which functions are available to the solver.
|
|
1277
|
+
_this18.functionMap=require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json');_this18.serviceType='ExpressionParser';// These are sub-services for the tokenizer, linter, compiler, marshaler and solver.
|
|
1278
|
+
_this18.fable.addServiceTypeIfNotExists('ExpressionParser-Tokenizer',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ExpressionTokenizer.js'));_this18.fable.addServiceTypeIfNotExists('ExpressionParser-Linter',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Linter.js'));_this18.fable.addServiceTypeIfNotExists('ExpressionParser-Postfix',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-Postfix.js'));_this18.fable.addServiceTypeIfNotExists('ExpressionParser-ValueMarshal',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ValueMarshal.js'));_this18.fable.addServiceTypeIfNotExists('ExpressionParser-Solver',require('./Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-SolvePostfixedExpression.js'));// And the sub-service for the friendly user messaging
|
|
1279
|
+
_this18.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.
|
|
1280
|
+
_this18.Tokenizer=_this18.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Tokenizer');_this18.Linter=_this18.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Linter');_this18.Postfix=_this18.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Postfix');_this18.ValueMarshal=_this18.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-ValueMarshal');_this18.Solver=_this18.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Solver');_this18.Messaging=_this18.fable.instantiateServiceProviderWithoutRegistration('ExpressionParser-Messaging');// Wire each sub service into this instance of the solver.
|
|
1281
|
+
_this18.Tokenizer.connectExpressionParser(_this18);_this18.Linter.connectExpressionParser(_this18);_this18.Postfix.connectExpressionParser(_this18);_this18.ValueMarshal.connectExpressionParser(_this18);_this18.Solver.connectExpressionParser(_this18);_this18.Messaging.connectExpressionParser(_this18);_this18.GenericManifest=_this18.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.
|
|
1282
|
+
_this18.LogNoisiness='LogNoisiness'in _this18.fable?_this18.fable.LogNoisiness:0;return _this18;}/**
|
|
1284
1283
|
* Tokenizes the given mathematical expression string.
|
|
1285
1284
|
*
|
|
1286
1285
|
* @param {string} pExpression - The expression to tokenize.
|
|
@@ -1328,10 +1327,10 @@ _this20.LogNoisiness='LogNoisiness'in _this20.fable?_this20.fable.LogNoisiness:0
|
|
|
1328
1327
|
*/},{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.
|
|
1329
1328
|
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)
|
|
1330
1329
|
this.substituteValuesInTokenizedObjects(tmpResultsObject.PostfixTokenObjects,tmpDataSourceObject,tmpResultsObject,pManifest);// Finally this is the expr solving method, which returns a string and also marshals it into tmpDataDestinationObject
|
|
1331
|
-
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":
|
|
1330
|
+
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":58}],77:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');var ExpressionParserOperationBase=/*#__PURE__*/function(_libFableServiceProvi9){function ExpressionParserOperationBase(pFable,pOptions,pServiceHash){var _this19;_classCallCheck2(this,ExpressionParserOperationBase);_this19=_callSuper(this,ExpressionParserOperationBase,[pFable,pOptions,pServiceHash]);_this19.serviceType='ExpressionParserOperationBase';_this19.numberTest=/^-{0,1}\d*\.{0,1}\d+$/;_this19.ExpressionParser=false;return _this19;}_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:
|
|
1332
1331
|
// There is a fifth token type, VirtualSymbol
|
|
1333
1332
|
// This is a value that's added during solve and looked up by address in the VirtualSymbol object.
|
|
1334
|
-
}},{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":
|
|
1333
|
+
}},{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":58}],78:[function(require,module,exports){var libExpressionParserOperationBase=require('./Fable-Service-ExpressionParser-Base.js');var ExpressionTokenizer=/*#__PURE__*/function(_libExpressionParserO){function ExpressionTokenizer(pFable,pOptions,pServiceHash){var _this20;_classCallCheck2(this,ExpressionTokenizer);_this20=_callSuper(this,ExpressionTokenizer,[pFable,pOptions,pServiceHash]);_this20.serviceType='ExpressionParser-Tokenizer';return _this20;}_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
|
|
1335
1334
|
*
|
|
1336
1335
|
* Current token types:
|
|
1337
1336
|
* - Value
|
|
@@ -1384,7 +1383,7 @@ tmpCurrentTokenType='Value';tmpCurrentToken+=tmpCharacter;// continue;
|
|
|
1384
1383
|
// }
|
|
1385
1384
|
// tmpResults.ExpressionParserLog.push(`ExpressionParser.tokenize found an unknown character code ${tmpCharCode} character ${tmpCharacter} in the expression: ${pExpression} at index ${i}`);
|
|
1386
1385
|
// this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);
|
|
1387
|
-
}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"},"findfirstvaluebyexactmatch":{"Name":"find + map on array of objects?","Address":"fable.Utility.findFirstValueByExactMatchInternal"},"findfirstvaluebystringincludes":{"Name":"find + map on array of objects?","Address":"fable.Utility.findFirstValueByStringIncludesInternal"},"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"},"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
|
|
1386
|
+
}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"},"findfirstvaluebyexactmatch":{"Name":"find + map on array of objects?","Address":"fable.Utility.findFirstValueByExactMatchInternal"},"findfirstvaluebystringincludes":{"Name":"find + map on array of objects?","Address":"fable.Utility.findFirstValueByStringIncludesInternal"},"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"},"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 _this21;_classCallCheck2(this,ExpressionParserLinter);_this21=_callSuper(this,ExpressionParserLinter,[pFable,pOptions,pServiceHash]);_this21.serviceType='ExpressionParser-Linter';return _this21;}_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
|
|
1388
1387
|
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
|
|
1389
1388
|
var tmpParenthesisDepth=0;// If it is in a state address, we don't care about the parenthesis
|
|
1390
1389
|
// State addresses are between squiggly brackets
|
|
@@ -1407,11 +1406,11 @@ if(pTokenizedExpression[_i6]!=='+'&&pTokenizedExpression[_i6]!=='-'){tmpResults.
|
|
|
1407
1406
|
* Represents a user-friendly messaging service for the ExpressionParser compiler output.
|
|
1408
1407
|
* @class ExpressionParserMessaging
|
|
1409
1408
|
* @extends libExpressionParserOperationBase
|
|
1410
|
-
*/var ExpressionParserMessaging=/*#__PURE__*/function(_libExpressionParserO3){function ExpressionParserMessaging(pFable,pOptions,pServiceHash){var
|
|
1409
|
+
*/var ExpressionParserMessaging=/*#__PURE__*/function(_libExpressionParserO3){function ExpressionParserMessaging(pFable,pOptions,pServiceHash){var _this22;_classCallCheck2(this,ExpressionParserMessaging);_this22=_callSuper(this,ExpressionParserMessaging,[pFable,pOptions,pServiceHash]);_this22.serviceType='ExpressionParser-Messaging';return _this22;}_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.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
|
|
1411
1410
|
return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationLeftValue);}if(tmpVirtualSymbolPrefix==='VFE'){// Virtual Function Expression
|
|
1412
1411
|
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
|
|
1413
1412
|
return"".concat(tmpOperationVirtualSymbol," = ").concat(tmpOperationLeftValue);}if(tmpVirtualSymbolPrefix==='VFE'){// Virtual Function Expression
|
|
1414
|
-
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<tmpExpressionParseOutcome.PostfixSolveList.length;i++){var tmpToken=tmpExpressionParseOutcome.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
|
|
1413
|
+
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<tmpExpressionParseOutcome.PostfixSolveList.length;i++){var tmpToken=tmpExpressionParseOutcome.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 _this23;_classCallCheck2(this,ExpressionParserPostfix);_this23=_callSuper(this,ExpressionParserPostfix,[pFable,pOptions,pServiceHash]);_this23.serviceType='ExpressionParser-Postfix';return _this23;}_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
|
|
1415
1414
|
* way to deal with recursion that can be expressed to the user in
|
|
1416
1415
|
* a meaningful way.
|
|
1417
1416
|
*
|
|
@@ -1462,58 +1461,58 @@ if(tmpSolveLayerMap[pLeftLayer][0].Depth<tmpSolveLayerMap[pRightLayer][0].Depth)
|
|
|
1462
1461
|
tmpResults.PostfixLayerstackMap={};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)
|
|
1463
1462
|
for(var tmpPrecedence=0;tmpPrecedence<=this.ExpressionParser.tokenMaxPrecedence;tmpPrecedence++){// Enumerate all tokens in a layer's expression.
|
|
1464
1463
|
// There is a recursive way to do this, but given the short length of even the most complex equations we're favoring readability.
|
|
1465
|
-
for(var
|
|
1466
|
-
if(tmpSolveLayerTokens[
|
|
1467
|
-
if(tmpSolveLayerTokens.length===1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found a single operator in a solve layer expression at token index ".concat(
|
|
1468
|
-
else if(
|
|
1469
|
-
else if(
|
|
1470
|
-
else if(
|
|
1471
|
-
else if(
|
|
1464
|
+
for(var _i0=0;_i0<tmpSolveLayerTokens.length;_i0++){// If the token is an operator and at the current precedence, add it to the postfix solve list and mutate the array.
|
|
1465
|
+
if(tmpSolveLayerTokens[_i0].Type==='Token.Operator'&&tmpSolveLayerTokens[_i0].Descriptor.Precedence===tmpPrecedence){var tmpToken=tmpSolveLayerTokens[_i0];// If there is a token and nothing else in this layer, then it's an error.
|
|
1466
|
+
if(tmpSolveLayerTokens.length===1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found a single operator in a solve layer expression at token index ".concat(_i0));this.log.error(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);return tmpResults.PostfixSolveList;}// If the token is at the beginning of the expression and not a number line orientation modifier, it's an error.
|
|
1467
|
+
else if(_i0==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(_i0));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.
|
|
1468
|
+
else if(_i0==tmpSolveLayerTokens.length-1){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found an operator at the end of a solve layer expression at token index ".concat(_i0));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
|
|
1469
|
+
else if(_i0==0&&tmpToken.Token=='-'){tmpToken.VirtualSymbolName="VNLO_".concat(tmpVirtualSymbolIndex);tmpResults.PostfixLayerstackMap[tmpToken.SolveLayerStack]=tmpToken.VirtualSymbolName;tmpVirtualSymbolIndex++;}// The - after an operator or an open parenthesis is also a number line orientation modifier
|
|
1470
|
+
else if(_i0>0&&tmpToken.Token=='-'&&(tmpSolveLayerTokens[_i0-1].Type==='Token.Operator'||tmpSolveLayerTokens[_i0-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
|
|
1472
1471
|
tmpToken.VirtualSymbolName="VNLO_".concat(tmpVirtualSymbolIndex);tmpVirtualSymbolIndex++;}// The + at the beginning is also a number line orientation modifier ... THAT WE IGNORE
|
|
1473
|
-
else if(
|
|
1474
|
-
else if(
|
|
1475
|
-
else if(tmpSolveLayerTokens[
|
|
1476
|
-
else{tmpToken.VirtualSymbolName="V_".concat(tmpVirtualSymbolIndex);tmpResults.PostfixLayerstackMap[tmpToken.SolveLayerStack]=tmpToken.VirtualSymbolName;tmpVirtualSymbolIndex++;}}else if(tmpSolveLayerTokens[
|
|
1472
|
+
else if(_i0==0&&tmpToken.Token=='+'){continue;}// The + after an operator or a parenthesis is also a number line orientation modifier ... THAT WE IGNORE
|
|
1473
|
+
else if(_i0>0&&tmpToken.Token=='+'&&(tmpSolveLayerTokens[_i0-1].Type==='Token.Operator'||tmpSolveLayerTokens[_i0-1].Token==='(')){continue;}// If the token is next to another operator it's a parsing error
|
|
1474
|
+
else if(tmpSolveLayerTokens[_i0-1].Type==='Token.Operator'||tmpSolveLayerTokens[_i0+1].Type==='Token.Operator'){tmpResults.ExpressionParserLog.push("ERROR: ExpressionParser.buildPostfixedSolveList found an operator at token index ".concat(_i0," 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.
|
|
1475
|
+
else{tmpToken.VirtualSymbolName="V_".concat(tmpVirtualSymbolIndex);tmpResults.PostfixLayerstackMap[tmpToken.SolveLayerStack]=tmpToken.VirtualSymbolName;tmpVirtualSymbolIndex++;}}else if(tmpSolveLayerTokens[_i0].Type==='Token.Function'&&tmpPrecedence===0){var _tmpToken=tmpSolveLayerTokens[_i0];_tmpToken.VirtualSymbolName="VFE_".concat(tmpVirtualSymbolIndex);tmpVirtualSymbolIndex++;tmpResults.PostfixLayerstackMap[_tmpToken.SolveLayerStack]=_tmpToken.VirtualSymbolName;}}}}// 5.15 Generate Virtual Symbol Clusters for Functions and Parenthesis
|
|
1477
1476
|
// ... this gets funny because of precedence of operations surrounding them, parenthesis and functions.
|
|
1478
|
-
var tmpFunctionCacheLIFOStack=[];for(var
|
|
1477
|
+
var tmpFunctionCacheLIFOStack=[];for(var _i1=0;_i1<tmpResults.PostfixTokenObjects.length;_i1++){var tmpPostfixTokenObject=tmpResults.PostfixTokenObjects[_i1];if(tmpPostfixTokenObject.Type==='Token.Parenthesis'){// This is just to track the parenthesis stack level for User feedback
|
|
1479
1478
|
tmpPostfixTokenObject.ParenthesisStack=tmpPostfixTokenObject.VirtualSymbolName;// At the beginning of the expression, this must be an open parenthesis to be legal.
|
|
1480
|
-
if(
|
|
1479
|
+
if(_i1==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.
|
|
1481
1480
|
tmpVirtualSymbolName="VP_".concat(tmpVirtualSymbolIndex);tmpVirtualSymbolIndex++;}tmpPostfixTokenObject.VirtualSymbolName=tmpVirtualSymbolName;tmpFunctionCacheLIFOStack.push(tmpPostfixTokenObject);}// If it's an open parenthesis
|
|
1482
1481
|
else if(tmpPostfixTokenObject.Token==='('){// ... supporting a function
|
|
1483
|
-
if(tmpResults.PostfixTokenObjects[
|
|
1482
|
+
if(tmpResults.PostfixTokenObjects[_i1-1].Type==='Token.Function'){tmpPostfixTokenObject.IsFunction=true;tmpPostfixTokenObject.Function=tmpResults.PostfixTokenObjects[_i1-1];var _tmpVirtualSymbolName=tmpResults.PostfixLayerstackMap[tmpPostfixTokenObject.VirtualSymbolName];if(!_tmpVirtualSymbolName){// ... this parenthesis group has no operators in it; make a virtual symbol name.
|
|
1484
1483
|
_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.
|
|
1485
1484
|
_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
|
|
1486
|
-
for(var _tmpSolveLayerIndex=0;_tmpSolveLayerIndex<tmpSolveLayerKeys.length;_tmpSolveLayerIndex++){var tmpParenthesisStack=[];var tmpLastOperator=false;var _tmpSolveLayerTokens=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex]];for(var
|
|
1485
|
+
for(var _tmpSolveLayerIndex=0;_tmpSolveLayerIndex<tmpSolveLayerKeys.length;_tmpSolveLayerIndex++){var tmpParenthesisStack=[];var tmpLastOperator=false;var _tmpSolveLayerTokens=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex]];for(var _i10=0;_i10<_tmpSolveLayerTokens.length;_i10++){var _tmpPostfixTokenObject=_tmpSolveLayerTokens[_i10];// Keep track of the last operator
|
|
1487
1486
|
if(_tmpPostfixTokenObject.Type==='Token.Operator'){tmpLastOperator=_tmpPostfixTokenObject;}// This is only important to do at the close parenthesis.
|
|
1488
1487
|
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
|
|
1489
|
-
var _tmpOpenParenthesis=tmpParenthesisStack.pop();if(
|
|
1488
|
+
var _tmpOpenParenthesis=tmpParenthesisStack.pop();if(_i10<_tmpSolveLayerTokens.length-1){for(var j=_i10+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
|
|
1490
1489
|
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.
|
|
1491
1490
|
// Walk backwards and forwards, hoisting same value precedence backwards/forwards
|
|
1492
1491
|
// across each layer... the precedence change needs to be decreasing to matter
|
|
1493
|
-
for(var _tmpSolveLayerIndex2=0;_tmpSolveLayerIndex2<tmpSolveLayerKeys.length;_tmpSolveLayerIndex2++){var tmpLastPrecedence=false;var tmpFinalChainToken=false;var _tmpSolveLayerTokens2=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex2]];for(var
|
|
1492
|
+
for(var _tmpSolveLayerIndex2=0;_tmpSolveLayerIndex2<tmpSolveLayerKeys.length;_tmpSolveLayerIndex2++){var tmpLastPrecedence=false;var tmpFinalChainToken=false;var _tmpSolveLayerTokens2=tmpSolveLayerMap[tmpSolveLayerKeys[_tmpSolveLayerIndex2]];for(var _i11=_tmpSolveLayerTokens2.length-1;_i11>=0;_i11--){var _tmpToken2=_tmpSolveLayerTokens2[_i11];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
|
|
1494
1493
|
_tmpToken2.RightVirtualSymbolName=tmpFinalChainToken.VirtualSymbolName;//console.log(`Hoisting ${tmpToken.Token} back to ${tmpFinalChainToken.Token}`);
|
|
1495
|
-
tmpFinalChainToken=_tmpToken2;}else if(_tmpToken2.Descriptor.Precedence<tmpLastPrecedence){tmpFinalChainToken=_tmpToken2;}tmpLastPrecedence=_tmpToken2.Descriptor.Precedence;}}var tmpDecreasingPrecedenceStack=[];var tmpLastToken=false;for(var
|
|
1494
|
+
tmpFinalChainToken=_tmpToken2;}else if(_tmpToken2.Descriptor.Precedence<tmpLastPrecedence){tmpFinalChainToken=_tmpToken2;}tmpLastPrecedence=_tmpToken2.Descriptor.Precedence;}}var tmpDecreasingPrecedenceStack=[];var tmpLastToken=false;for(var _i12=_tmpSolveLayerTokens2.length-1;_i12>=0;_i12--){var _tmpToken3=_tmpSolveLayerTokens2[_i12];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
|
|
1496
1495
|
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}`);
|
|
1497
1496
|
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
|
|
1498
1497
|
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.
|
|
1499
1498
|
if(_tmpSolveLayerTokens3.length===1){// TODO: I think this is correct but with the addition of multiple assignment operators it's less clear.
|
|
1500
1499
|
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
|
|
1501
|
-
if(!_tmpAbstractAssignToken.VirtualSymbolName){for(var
|
|
1500
|
+
if(!_tmpAbstractAssignToken.VirtualSymbolName){for(var _i13=0;_i13<tmpResults.PostfixTokenObjects.length;_i13++){if(tmpResults.PostfixTokenObjects[_i13].ParenthesisStack===_tmpSolveLayerTokens3[0].SolveLayerStack){_tmpAbstractAssignToken.VirtualSymbolName=tmpResults.PostfixTokenObjects[_i13].VirtualSymbolName;break;}}}tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractAssignToken,_tmpSolveLayerTokens3[0],this.getTokenContainerObject('0.0')));continue;}// For each precedence level in the layer
|
|
1502
1501
|
for(var _tmpPrecedence=0;_tmpPrecedence<=this.ExpressionParser.tokenMaxPrecedence;_tmpPrecedence++){// Enumerate all tokens in a layer's expression.
|
|
1503
1502
|
// There is a recursive way to do this, but given the short length of even the most complex equations we're favoring readability.
|
|
1504
|
-
for(var
|
|
1505
|
-
if(_tmpSolveLayerTokens3[
|
|
1506
|
-
if(
|
|
1503
|
+
for(var _i14=0;_i14<_tmpSolveLayerTokens3.length;_i14++){// If the token is an operator and at the current precedence, add it to the postfix solve list and mutate the array.
|
|
1504
|
+
if(_tmpSolveLayerTokens3[_i14].Type==='Token.Operator'&&_tmpSolveLayerTokens3[_i14].Descriptor.Precedence===_tmpPrecedence){var _tmpToken4=_tmpSolveLayerTokens3[_i14];// The - at the beginning of an expression is a number line orientation modifier
|
|
1505
|
+
if(_i14==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
|
|
1507
1506
|
// This is an abstract operation that isn't in the expression.
|
|
1508
|
-
var tmpAbstractMultiplyToken=this.getTokenContainerObject('*');tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[
|
|
1509
|
-
else if(
|
|
1510
|
-
var _tmpAbstractMultiplyToken=this.getTokenContainerObject('*');_tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[
|
|
1511
|
-
else if(
|
|
1512
|
-
else if(
|
|
1513
|
-
else{tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken4,_tmpSolveLayerTokens3[
|
|
1507
|
+
var tmpAbstractMultiplyToken=this.getTokenContainerObject('*');tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[_i14+1]));}// The - after an operator or an open parenthesis is also a number line orientation modifier
|
|
1508
|
+
else if(_i14>0&&_tmpToken4.Token=='-'&&(_tmpSolveLayerTokens3[_i14-1].Type==='Token.Operator'||_tmpSolveLayerTokens3[_i14-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
|
|
1509
|
+
var _tmpAbstractMultiplyToken=this.getTokenContainerObject('*');_tmpAbstractMultiplyToken.VirtualSymbolName=_tmpToken4.VirtualSymbolName;tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpAbstractMultiplyToken,this.getTokenContainerObject('-1.0'),_tmpSolveLayerTokens3[_i14+1]));}// The + at the beginning is also a number line orientation modifier ... THAT WE IGNORE
|
|
1510
|
+
else if(_i14==0&&_tmpToken4.Token=='+'){continue;}// The + after an operator or a parenthesis is also a number line orientation modifier ... THAT WE IGNORE
|
|
1511
|
+
else if(_i14>0&&_tmpToken4.Token=='+'&&(_tmpSolveLayerTokens3[_i14-1].Type==='Token.Operator'||_tmpSolveLayerTokens3[_i14-1].Token==='(')){continue;}// Finally add the dang thing.
|
|
1512
|
+
else{tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken4,_tmpSolveLayerTokens3[_i14-1],_tmpSolveLayerTokens3[_i14+1],_tmpSolveLayerTokens3,_i14));}}else if(_tmpSolveLayerTokens3[_i14].Type==='Token.Function'&&_tmpPrecedence===0){var _tmpToken5=_tmpSolveLayerTokens3[_i14];tmpResults.PostfixSolveList.push(this.getPosfixSolveListOperation(_tmpToken5,_tmpSolveLayerTokens3[_i14+1],this.getTokenContainerObject('0.0')));}}}}// 7. Lastly set the assignment address.
|
|
1514
1513
|
var tmpAbstractAssignToken='PostfixedAssignmentOperator'in tmpResults?this.getTokenContainerObject(tmpResults.PostfixedAssignmentOperator.Token):this.getTokenContainerObject('=');// The address we are assigning to
|
|
1515
1514
|
tmpAbstractAssignToken.VirtualSymbolName=tmpResults.PostfixedAssignmentAddress;// The address it's coming from
|
|
1516
|
-
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 ExpressionParserSolver=/*#__PURE__*/function(_libExpressionParserO5){function ExpressionParserSolver(pFable,pOptions,pServiceHash){var
|
|
1515
|
+
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 ExpressionParserSolver=/*#__PURE__*/function(_libExpressionParserO5){function ExpressionParserSolver(pFable,pOptions,pServiceHash){var _this24;_classCallCheck2(this,ExpressionParserSolver);_this24=_callSuper(this,ExpressionParserSolver,[pFable,pOptions,pServiceHash]);_this24.serviceType='ExpressionParser-Solver';return _this24;}_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
|
|
1517
1516
|
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.
|
|
1518
1517
|
tmpResults.VirtualSymbols={};for(var i=0;i<pPostfixedExpression.length;i++){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
|
|
1519
1518
|
if(tmpStepResultObject.ExpressionStep.LeftValue.Type==='Token.Parenthesis'){tmpStepResultObject.ExpressionStep.LeftValue.Value=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.LeftValue.VirtualSymbolName);}if(tmpStepResultObject.ExpressionStep.RightValue.Type==='Token.Parenthesis'){tmpStepResultObject.ExpressionStep.RightValue.Value=tmpManifest.getValueAtAddress(tmpResults.VirtualSymbols,tmpStepResultObject.ExpressionStep.RightValue.VirtualSymbolName);}// Virtual Constants
|
|
@@ -1530,12 +1529,12 @@ tmpStepResultObject.ExpressionStep.LeftValue.Arguments=tmpStepResultObject.Expre
|
|
|
1530
1529
|
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]}`)
|
|
1531
1530
|
}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.
|
|
1532
1531
|
tmpResults.SolverFinalVirtualSymbol=tmpStepResultObject.ExpressionStep.VirtualSymbolName;}}var tmpSolverResultValue=tmpManifest.getValueAtAddress(tmpResults,"VirtualSymbols.".concat(tmpResults.SolverFinalVirtualSymbol));// Now deal with final assignment(s)
|
|
1533
|
-
for(var
|
|
1534
|
-
tmpManifest.setValueAtAddress(tmpResults.VirtualSymbols,pPostfixedExpression[
|
|
1535
|
-
if(pPostfixedExpression[
|
|
1536
|
-
if(this.fable.Utility.addressIsNullOrEmpty(tmpDataDestinationObject,pPostfixedExpression[
|
|
1537
|
-
tmpManifest.setValueByHash(tmpDataDestinationObject,pPostfixedExpression[
|
|
1538
|
-
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-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":1,"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
|
|
1532
|
+
for(var _i15=0;_i15<pPostfixedExpression.length;_i15++){if(pPostfixedExpression[_i15].RightValue.Type==='Token.SolverMarshal'){// Set the result in the virtual symbols
|
|
1533
|
+
tmpManifest.setValueAtAddress(tmpResults.VirtualSymbols,pPostfixedExpression[_i15].VirtualSymbolName,tmpSolverResultValue);// Set the value in the destination object
|
|
1534
|
+
if(pPostfixedExpression[_i15].Operation.Descriptor.OnlyEmpty){// If it is only on "empty" values, check if the value is empty before assigning
|
|
1535
|
+
if(this.fable.Utility.addressIsNullOrEmpty(tmpDataDestinationObject,pPostfixedExpression[_i15].VirtualSymbolName)){tmpManifest.setValueByHash(tmpDataDestinationObject,pPostfixedExpression[_i15].VirtualSymbolName,tmpSolverResultValue);}}else{// Otherwise, just assign it.
|
|
1536
|
+
tmpManifest.setValueByHash(tmpDataDestinationObject,pPostfixedExpression[_i15].VirtualSymbolName,tmpSolverResultValue);}}}tmpResults.RawResult=tmpSolverResultValue;// Clean up the fable reference if we added it to the object.
|
|
1537
|
+
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-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":1,"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 _this25;_classCallCheck2(this,ExpressionParserValueMarshal);_this25=_callSuper(this,ExpressionParserValueMarshal,[pFable,pOptions,pServiceHash]);_this25.serviceType='ExpressionParser-ValueMarshal';return _this25;}/**
|
|
1539
1538
|
* Substitutes values in tokenized objects based on the provided data source and manifest.
|
|
1540
1539
|
*
|
|
1541
1540
|
* TODO: Move this to its own file in the "Fable-Service-ExpressionParser" directory.
|
|
@@ -1552,14 +1551,14 @@ var tmpValue=tmpManifest.getValueByHash(tmpDataSource,tmpToken.Token);// if (!tm
|
|
|
1552
1551
|
// tmpValue = tmpManifest.getValueAtAddress(tmpToken.Token, tmpDataSource);
|
|
1553
1552
|
// }
|
|
1554
1553
|
if(!tmpValue){tmpResults.ExpressionParserLog.push("WARNING: ExpressionParser.substituteValuesInTokenizedObjects found no value for the symbol hash or 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 [".concat(tmpValue,"] for the state address ").concat(tmpToken.Token," at index ").concat(i));if(this.LogNoisiness>1)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){// TODO: Should we allow this to be a function? Good god the complexity and beauty of that...
|
|
1555
|
-
if(Array.isArray(tmpValue)||_typeof(tmpValue)==='object'){tmpToken.Resolved=true;tmpToken.Value=tmpValue;}else{tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric
|
|
1554
|
+
if(Array.isArray(tmpValue)||_typeof(tmpValue)==='object'){tmpToken.Resolved=true;tmpToken.Value=tmpValue;}else{tmpToken.Resolved=true;tmpToken.Value=tmpValue;tmpResults.ExpressionParserLog.push("INFO: ExpressionParser.substituteValuesInTokenizedObjects found a non-numeric value for the state address ".concat(tmpToken.Token," at index ").concat(i,"; using raw value."));this.log.warn(tmpResults.ExpressionParserLog[tmpResults.ExpressionParserLog.length-1]);}}}}if(pTokenizedObjects[i].Type==='Token.StateAddress'&&!tmpToken.Resolved){// Symbols are always hashes. This gracefully works for simple shallow objects because hashes default to the address in Manyfest.
|
|
1556
1555
|
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}`);
|
|
1557
1556
|
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
|
|
1558
1557
|
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.
|
|
1559
|
-
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
|
|
1558
|
+
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 _this26;_classCallCheck2(this,FableServiceFilePersistence);_this26=_callSuper(this,FableServiceFilePersistence,[pFable,pOptions,pServiceHash]);_this26.serviceType='FilePersistence';if(!('Mode'in _this26.options)){_this26.options.Mode=parseInt('0777',8)&~process.umask();}_this26.libFS=libFS;_this26.libPath=libPath;_this26.libReadline=libReadline;return _this26;}_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
|
|
1560
1559
|
// return libPath.join(...pPathArray);
|
|
1561
|
-
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
|
|
1562
|
-
},{key:"makeFolderRecursive",value:function makeFolderRecursive(pParameters,fCallback){var
|
|
1560
|
+
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 _this27=this;var tmpCSVParser=this.fable.instantiateServiceProviderWithoutRegistration('CSVParser',pOptions);var tmpRecordFunction=typeof fRecordFunction==='function'?fRecordFunction:function(pRecord){_this27.fable.log("CSV Reader received line ".concat(pRecord));};var tmpCompleteFunction=typeof fCompleteFunction==='function'?fCompleteFunction:function(){_this27.fable.log("CSV Read of ".concat(pFilePath," complete."));};var tmpErrorFunction=typeof fErrorFunction==='function'?fErrorFunction:function(pError){_this27.fable.log("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
|
|
1561
|
+
},{key:"makeFolderRecursive",value:function makeFolderRecursive(pParameters,fCallback){var _this28=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
|
|
1563
1562
|
if(typeof tmpParameters.CurrentPathIndex==='undefined'){// Build the tools to start recursing
|
|
1564
1563
|
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.
|
|
1565
1564
|
// Build the new base path
|
|
@@ -1567,8 +1566,8 @@ if(tmpParameters.CurrentPath==libPath.sep){tmpParameters.CurrentPath=tmpParamete
|
|
|
1567
1566
|
tmpParameters.CurrentPathIndex++;}// Check if the path is fully complete
|
|
1568
1567
|
if(tmpParameters.CurrentPathIndex>=tmpParameters.ActualPathParts.length){return fCallback(null);}// Check if the path exists (and is a folder)
|
|
1569
1568
|
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.
|
|
1570
|
-
return
|
|
1571
|
-
return
|
|
1569
|
+
return _this28.makeFolderRecursive(tmpParameters,fCallback);}else if(pCreateError.code=='EEXIST'){// The folder exists -- our dev might be running this in parallel/async/whatnot.
|
|
1570
|
+
return _this28.makeFolderRecursive(tmpParameters,fCallback);}else{console.log(pCreateError.code);return fCallback(pCreateError);}});}else{return _this28.makeFolderRecursive(tmpParameters,fCallback);}});}}]);}(libFableServiceBase);module.exports=FableServiceFilePersistence;}).call(this);}).call(this,require('_process'));},{"_process":147,"fable-serviceproviderbase":58,"fs":19,"path":135,"readline":19}],87:[function(require,module,exports){/**
|
|
1572
1571
|
* @file Fable-Service-Math.js
|
|
1573
1572
|
* @description This file contains the implementation of the FableServiceMath class, which provides simple functions for performing arbitrary precision math operations.
|
|
1574
1573
|
* @module FableServiceMath
|
|
@@ -1579,9 +1578,9 @@ return _this30.makeFolderRecursive(tmpParameters,fCallback);}else{console.log(pC
|
|
|
1579
1578
|
* @description Simple functions that perform arbitrary precision math operations and return string resultant values. Wraps big.js
|
|
1580
1579
|
* @class FableServiceMath
|
|
1581
1580
|
* @extends libFableServiceBase
|
|
1582
|
-
*/var FableServiceMath=/*#__PURE__*/function(_libFableServiceBase6){function FableServiceMath(pFable,pOptions,pServiceHash){var
|
|
1583
|
-
|
|
1584
|
-
return
|
|
1581
|
+
*/var FableServiceMath=/*#__PURE__*/function(_libFableServiceBase6){function FableServiceMath(pFable,pOptions,pServiceHash){var _this29;_classCallCheck2(this,FableServiceMath);_this29=_callSuper(this,FableServiceMath,[pFable,pOptions,pServiceHash]);_this29.serviceType='Math';_this29.pi='3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679';// From NASA: https://apod.nasa.gov/htmltest/gifcity/e.2mil
|
|
1582
|
+
_this29.euler='2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664';// this.manifest = this.fable.newManyfest();
|
|
1583
|
+
return _this29;}/*
|
|
1585
1584
|
Pass-through Rounding Method Constants
|
|
1586
1585
|
|
|
1587
1586
|
Property Value BigDecimal Equiv Description
|
|
@@ -1766,13 +1765,13 @@ return 1;}return 0;}/**
|
|
|
1766
1765
|
*
|
|
1767
1766
|
* @param {Array|Object} pValueSet - The value set to be sorted.
|
|
1768
1767
|
* @returns {Array} - The sorted value set.
|
|
1769
|
-
*/},{key:"sortSetPrecise",value:function sortSetPrecise(pValueSet){var
|
|
1768
|
+
*/},{key:"sortSetPrecise",value:function sortSetPrecise(pValueSet){var _this30=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 _i16=0;_i16<tmpKeys.length;_i16++){tmpSortedSet.push(this.parsePrecise(pValueSet[tmpKeys[_i16]],NaN));}}tmpSortedSet.sort(function(pLeft,pRight){return _this30.comparePrecise(pLeft,pRight);});return tmpSortedSet;}/**
|
|
1770
1769
|
* Bucketizes a set of values based on a specified bucket size.
|
|
1771
1770
|
*
|
|
1772
1771
|
* @param {Array|Object} pValueSet - The set of values to be bucketized.
|
|
1773
1772
|
* @param {number} pBucketSize - The size of each bucket. Optional - If NaN, the values will be bucketized by their value.
|
|
1774
1773
|
* @returns {Object} - The bucketized set of values.
|
|
1775
|
-
*/},{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
|
|
1774
|
+
*/},{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 _i17=0;_i17<tmpKeys.length;_i17++){var _tmpValue2=this.parsePrecise(pValueSet[tmpKeys[_i17]],NaN);var _tmpBucket=_tmpValue2.toString();if(!isNaN(tmpBucketSize)){_tmpBucket=this.dividePrecise(pValueSet[_i17],tmpBucketSize);}if(!(_tmpBucket in tmpBucketedSet)){tmpBucketedSet[_tmpBucket]=0;}tmpBucketedSet[_tmpBucket]=tmpBucketedSet[_tmpBucket]+1;}}return tmpBucketedSet;}/**
|
|
1776
1775
|
* Calculates the histogram using precise bucket set for the given pValueSet.
|
|
1777
1776
|
*
|
|
1778
1777
|
* @param {Array<number>} pValueSet - The array of p-values.
|
|
@@ -1803,7 +1802,7 @@ return 1;}return 0;}/**
|
|
|
1803
1802
|
* @param {Array} pValueObjectSet
|
|
1804
1803
|
* @param {string} pValueAddress
|
|
1805
1804
|
* @param {Object} pManifest
|
|
1806
|
-
*/},{key:"entryInSet",value:function entryInSet(pValueObjectSet,pValueAddress,pEntryIndex){var
|
|
1805
|
+
*/},{key:"entryInSet",value:function entryInSet(pValueObjectSet,pValueAddress,pEntryIndex){var _this31=this;if(!Array.isArray(pValueObjectSet)){return pValueObjectSet;}if(!pValueAddress){return false;}if(isNaN(pEntryIndex)||pEntryIndex>=pValueObjectSet.length){return false;}var tmpValueArray=pValueObjectSet.toSorted(function(pLeft,pRight){return _this31.comparePrecise(pLeft,pRight);});var tmpIndex=pEntryIndex===-1?tmpValueArray.length-1:pEntryIndex;return tmpValueArray[tmpIndex];}/**
|
|
1807
1806
|
* Finds the smallest value in a set of objects based on a specified value address.
|
|
1808
1807
|
*
|
|
1809
1808
|
* @param {Object[]} pValueObjectSet - An array of objects to search through.
|
|
@@ -1824,17 +1823,17 @@ return 1;}return 0;}/**
|
|
|
1824
1823
|
*
|
|
1825
1824
|
* @param {Array|Object} pValueSet - The set of values to find the maximum from.
|
|
1826
1825
|
* @returns {number} - The maximum value from the set.
|
|
1827
|
-
*/},{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
|
|
1826
|
+
*/},{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 _i18=0;_i18<tmpKeys.length;_i18++){if(!tmpMaxValue){tmpMaxValue=this.parsePrecise(pValueSet[tmpKeys[_i18]],NaN);}else{var _tmpComparisonValue=this.parsePrecise(pValueSet[tmpKeys[_i18]],NaN);if(this.gtPrecise(_tmpComparisonValue,tmpMaxValue)){tmpMaxValue=_tmpComparisonValue;}}}}return tmpMaxValue;}/**
|
|
1828
1827
|
* Finds the minimum value from a set of values.
|
|
1829
1828
|
*
|
|
1830
1829
|
* @param {Array|Object} pValueSet - The set of values to find the minimum from.
|
|
1831
1830
|
* @returns {number} The minimum value from the set.
|
|
1832
|
-
*/},{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
|
|
1831
|
+
*/},{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 _i19=0;_i19<tmpKeys.length;_i19++){if(!tmpMinValue){tmpMinValue=this.parsePrecise(pValueSet[tmpKeys[_i19]],NaN);}else{var _tmpComparisonValue2=this.parsePrecise(pValueSet[tmpKeys[_i19]],NaN);if(!isNaN(_tmpComparisonValue2)&&this.ltPrecise(_tmpComparisonValue2,tmpMinValue)){tmpMinValue=_tmpComparisonValue2;}}}}return tmpMinValue;}/**
|
|
1833
1832
|
* Calculates the precise sum of values in the given value set.
|
|
1834
1833
|
*
|
|
1835
1834
|
* @param {Array|Object} pValueSet - The value set to calculate the sum from.
|
|
1836
1835
|
* @returns {string} The precise sum value as a string.
|
|
1837
|
-
*/},{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
|
|
1836
|
+
*/},{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 _i20=0;_i20<tmpKeys.length;_i20++){var _tmpComparisonValue3=this.parsePrecise(pValueSet[tmpKeys[_i20]],NaN);if(!isNaN(_tmpComparisonValue3)){tmpSumValue=this.addPrecise(tmpSumValue,_tmpComparisonValue3);}}}return tmpSumValue;}/**
|
|
1838
1837
|
* Calculates the precise mean of a given value set.
|
|
1839
1838
|
*
|
|
1840
1839
|
* @param {Array<number>} pValueSet - The array of values to calculate the mean.
|
|
@@ -1858,11 +1857,11 @@ else{var tmpLeftMiddleValue=tmpSortedValueSet[tmpMiddleElement-1];var tmpRightMi
|
|
|
1858
1857
|
* @param {Array} pValueSet - The array of values to calculate the mode from.
|
|
1859
1858
|
* @returns {Array} - An array containing the mode value(s) from the given value set.
|
|
1860
1859
|
*/},{key:"modePrecise",value:function modePrecise(pValueSet){var tmpHistogram=this.bucketSetPrecise(pValueSet);var tmpMaxCount=0;// Philosophical question about whether the values should be returned sorted.
|
|
1861
|
-
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-serviceproviderbase":
|
|
1860
|
+
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-serviceproviderbase":58}],88:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');/**
|
|
1862
1861
|
* Precedent Meta-Templating
|
|
1863
1862
|
* @author Steven Velozo <steven@velozo.com>
|
|
1864
1863
|
* @description Process text stream trie and postfix tree, parsing out meta-template expression functions.
|
|
1865
|
-
*/var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase7){function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var
|
|
1864
|
+
*/var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase7){function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this32;_classCallCheck2(this,FableServiceMetaTemplate);_this32=_callSuper(this,FableServiceMetaTemplate,[pFable,pOptions,pServiceHash]);_this32.serviceType='MetaTemplate';_this32.WordTree=new libWordTree();_this32.StringParser=new libStringParser(_this32.fable);_this32.ParseTree=_this32.WordTree.ParseTree;return _this32;}_inherits(FableServiceMetaTemplate,_libFableServiceBase7);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);}/**
|
|
1866
1865
|
* Parse a string with the existing parse tree
|
|
1867
1866
|
* @method parseString
|
|
1868
1867
|
* @param {string} pString - The string to parse
|
|
@@ -1870,7 +1869,7 @@ var tmpHistogramValueSet=Object.keys(tmpHistogram);var tmpModeValueSet=[];for(va
|
|
|
1870
1869
|
* @param {function} fCallback - The callback function to call when a pattern is matched
|
|
1871
1870
|
* @param {array} pDataContext - The history of data objects already passed in
|
|
1872
1871
|
* @return {string} The result from the parser
|
|
1873
|
-
*/},{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":89,"./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js":90,"fable-serviceproviderbase":
|
|
1872
|
+
*/},{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":89,"./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js":90,"fable-serviceproviderbase":58}],89:[function(require,module,exports){/**
|
|
1874
1873
|
* String Parser
|
|
1875
1874
|
* @author Steven Velozo <steven@velozo.com>
|
|
1876
1875
|
* @description Parse a string, properly processing each matched token in the word tree.
|
|
@@ -1917,10 +1916,10 @@ var _tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Patt
|
|
|
1917
1916
|
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)....
|
|
1918
1917
|
if(!pParserState.PatternMatch){// This may be the start of a new pattern....
|
|
1919
1918
|
if(pCharacter in pParserState.ParseTree){// ... assign the root node as the matched node.
|
|
1920
|
-
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
|
|
1919
|
+
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 _this33=this;// ... this is the end of a pattern, cut off the end tag and parse it.
|
|
1921
1920
|
// Trim the start and end tags off the output buffer now
|
|
1922
1921
|
if(pParserState.Pattern.isAsync){// Run the function
|
|
1923
|
-
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){
|
|
1922
|
+
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){_this33.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this33.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){_this33.fable.log.info("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this33.resetOutputBuffer(pParserState);return fCallback();},pDataContext);}}else{// Run the t*mplate function
|
|
1924
1923
|
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();}}/**
|
|
1925
1924
|
* Parse a character in the buffer.
|
|
1926
1925
|
* @method parseCharacterAsync
|
|
@@ -1953,11 +1952,11 @@ return fCallback();}/**
|
|
|
1953
1952
|
* @param {Object} pData - The data to pass to the function as a second parameter
|
|
1954
1953
|
* @param {function} fCallback - The callback function to call when the parse is complete
|
|
1955
1954
|
* @param {array} pDataContext - The history of data objects/context already passed in
|
|
1956
|
-
*/},{key:"parseString",value:function parseString(pString,pParseTree,pData,fCallback,pDataContext){var
|
|
1955
|
+
*/},{key:"parseString",value:function parseString(pString,pParseTree,pData,fCallback,pDataContext){var _this34=this;// TODO: There is danger here if a template function attempts to functionally recurse and doesn't pass this in.
|
|
1957
1956
|
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.
|
|
1958
1957
|
this.parseCharacter(pString[i],tmpParserState,pData,tmpDataContext);}this.flushOutputBuffer(tmpParserState);return tmpParserState.Output;}else{// This is the async mode
|
|
1959
|
-
var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(
|
|
1960
|
-
|
|
1958
|
+
var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(_i21){tmpAnticipate.anticipate(function(fCallback){_this34.parseCharacterAsync(pString[_i21],_tmpParserState,pData,fCallback,tmpDataContext);});};for(var _i21=0;_i21<pString.length;_i21++){_loop(_i21);}tmpAnticipate.wait(function(pError){// Flush the remaining data
|
|
1959
|
+
_this34.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserState.Output);});}}}]);}();module.exports=StringParser;},{}],90:[function(require,module,exports){/**
|
|
1961
1960
|
* Word Tree
|
|
1962
1961
|
* @author Steven Velozo <steven@velozo.com>
|
|
1963
1962
|
* @description Create a tree (directed graph) of Javascript objects, one character per object.
|
|
@@ -1986,20 +1985,20 @@ _this36.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserSta
|
|
|
1986
1985
|
* @param {Object} pParserContext - The context to pass to the parser function
|
|
1987
1986
|
* @return {Object} The leaf parser from the tree
|
|
1988
1987
|
*/},{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
|
|
1989
|
-
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
|
|
1988
|
+
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 _i22=0;_i22<tmpPatternEnd.length;_i22++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i22],_i22);}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
|
|
1990
1989
|
if(pParserContext){tmpLeaf.ParserContext=pParserContext;}tmpLeaf.isAsync=true;return tmpLeaf;}/** Add a Pattern to the Parse Tree with both function parameter types
|
|
1991
1990
|
* @method addPatternAll
|
|
1992
1991
|
* @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
|
|
1993
1992
|
* @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")
|
|
1994
1993
|
* @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.
|
|
1995
1994
|
* @param {Object} pParserContext - The context to pass to the parser function
|
|
1996
|
-
*/},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}]);}();module.exports=WordTree;},{}],91:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":1},"Steps":[],"Errors":[],"Log":[]};},{}],92:[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(_libFableServiceBase8){function FableOperation(pFable,pOptions,pServiceHash){var
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
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(
|
|
2001
|
-
tmpAnticipate.anticipate(
|
|
2002
|
-
tmpAnticipate.wait(function(pError){if(pError){
|
|
1995
|
+
*/},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser,pParserContext){return this.addPatternBoth(pPatternStart,pPatternEnd,fParser,null,pParserContext);}}]);}();module.exports=WordTree;},{}],91:[function(require,module,exports){module.exports={"Metadata":{"UUID":false,"Hash":false,"Name":"","Summary":"","Version":0},"Status":{"Completed":false,"StepCount":1},"Steps":[],"Errors":[],"Log":[]};},{}],92:[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(_libFableServiceBase8){function FableOperation(pFable,pOptions,pServiceHash){var _this35;_classCallCheck2(this,FableOperation);_this35=_callSuper(this,FableOperation,[pFable,pOptions,pServiceHash]);// Timestamps will just be the long ints
|
|
1996
|
+
_this35.timeStamps={};_this35.serviceType='PhasedOperation';_this35.state=JSON.parse(_OperationStatePrototypeString);_this35.stepMap={};_this35.stepFunctions={};// Match the service instantiation to the operation.
|
|
1997
|
+
_this35.state.Metadata.Hash=_this35.Hash;_this35.state.Metadata.UUID=_this35.UUID;_this35.state.Metadata.Name=typeof _this35.options.Name=='string'?_this35.options.Name:"Unnamed Operation ".concat(_this35.state.Metadata.UUID);_this35.name=_this35.state.Metadata.Name;_this35.progressTrackerSet=_this35.fable.instantiateServiceProviderWithoutRegistration('ProgressTrackerSet');_this35.state.OverallProgressTracker=_this35.progressTrackerSet.createProgressTracker("Overall-".concat(_this35.state.Metadata.UUID));// This is here to use the pass-through logging functions in the operation itself.
|
|
1998
|
+
_this35.log=_this35;return _this35;}_inherits(FableOperation,_libFableServiceBase8);return _createClass2(FableOperation,[{key:"execute",value:function execute(fExecutionCompleteCallback){var _this36=this;// TODO: Should the same operation be allowed to execute more than one time?
|
|
1999
|
+
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(_this36));// Steps are executed in a custom context with
|
|
2000
|
+
tmpAnticipate.anticipate(_this36.stepFunctions[_this36.state.Steps[i].GUIDStep].bind({log:_this36,fable:_this36.fable,options:_this36.state.Steps[i].Metadata,metadata:_this36.state.Steps[i].Metadata,ProgressTracker:_this36.progressTrackerSet.getProgressTracker(_this36.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(_this36),OperationState:_this36.state,StepState:_this36.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(_this36));};for(var i=0;i<this.state.Steps.length;i++){_loop2(i);}// Wait for the anticipation to complete
|
|
2001
|
+
tmpAnticipate.wait(function(pError){if(pError){_this36.fable.log.error("Operation [".concat(_this36.state.Metadata.UUID,"] ").concat(_this36.state.Metadata.Name," had an error: ").concat(pError),pError);return fExecutionCompleteCallback(pError);}_this36.info("Operation [".concat(_this36.state.Metadata.UUID,"] ").concat(_this36.state.Metadata.Name," complete."));var tmpOperationTimingMessage=_this36.progressTrackerSet.getProgressTrackerStatusString(_this36.state.OverallProgressTracker.Hash);_this36.progressTrackerSet.endProgressTracker(_this36.state.OverallProgressTracker.Hash);_this36.fable.log.info("Operation [".concat(_this36.state.Metadata.UUID,"] ").concat(tmpOperationTimingMessage,"."));return fExecutionCompleteCallback();});}// There are three ways to add steps:
|
|
2003
2002
|
// 1. As a basic javascript function
|
|
2004
2003
|
// --
|
|
2005
2004
|
// This is the most basic, java"script" way to add a step. It will
|
|
@@ -2008,11 +2007,11 @@ tmpAnticipate.wait(function(pError){if(pError){_this38.fable.log.error("Operatio
|
|
|
2008
2007
|
},{key:"addStep",value:function addStep(fStepFunction,pStepMetadata,pStepName,pStepDescription,pGUIDStep){var tmpStep={};// GUID is optional
|
|
2009
2008
|
tmpStep.GUIDStep=typeof pGUIDStep!=='undefined'?pGUIDStep:"STEP-".concat(this.state.Steps.length,"-").concat(this.fable.DataGeneration.randomNumericString());// Name is optional
|
|
2010
2009
|
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
|
|
2011
|
-
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":91,"big.js":17,"fable-serviceproviderbase":
|
|
2010
|
+
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":91,"big.js":17,"fable-serviceproviderbase":58}],93:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceProgressTime=/*#__PURE__*/function(_libFableServiceBase9){function FableServiceProgressTime(pFable,pOptions,pServiceHash){var _this37;_classCallCheck2(this,FableServiceProgressTime);_this37=_callSuper(this,FableServiceProgressTime,[pFable,pOptions,pServiceHash]);_this37.serviceType='ProgressTime';_this37.timeStamps={};return _this37;}_inherits(FableServiceProgressTime,_libFableServiceBase9);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.
|
|
2012
2011
|
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.
|
|
2013
|
-
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":
|
|
2014
|
-
|
|
2015
|
-
|
|
2012
|
+
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":58}],94:[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;},{}],95:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var libProgressTrackerClass=require('./Fable-Service-ProgressTracker/ProgressTracker.js');var FableServiceProgressTrackerSet=/*#__PURE__*/function(_libFableServiceBase0){function FableServiceProgressTrackerSet(pFable,pOptions,pServiceHash){var _this38;_classCallCheck2(this,FableServiceProgressTrackerSet);_this38=_callSuper(this,FableServiceProgressTrackerSet,[pFable,pOptions,pServiceHash]);_this38.serviceType='ProgressTrackerSet';_this38.progressTrackers={};// Create an internal PorgressTime service to track timestamps
|
|
2013
|
+
_this38.progressTimes=_this38.fable.instantiateServiceProviderWithoutRegistration('ProgressTime');// This timestamp is used and updated by *all* progress trackers.
|
|
2014
|
+
_this38.progressTimes.createTimeStamp('CurrentTime');return _this38;}_inherits(FableServiceProgressTrackerSet,_libFableServiceBase0);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%
|
|
2016
2015
|
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
|
|
2017
2016
|
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.
|
|
2018
2017
|
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
|
|
@@ -2033,20 +2032,20 @@ this.solveProgressTrackerStatus(tmpProgressTrackerHash);if(!(tmpProgressTrackerH
|
|
|
2033
2032
|
if(tmpProgressTracker.StartTimeStamp<1){return"ProgressTracker ".concat(tmpProgressTracker.Hash," has not been started yet.");}// 2. Started, but no operations completed
|
|
2034
2033
|
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
|
|
2035
2034
|
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
|
|
2036
|
-
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":94,"fable-serviceproviderbase":
|
|
2035
|
+
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":94,"fable-serviceproviderbase":58}],96:[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(_libFableServiceBase1){function FableServiceRestClient(pFable,pOptions,pServiceHash){var _this39;_classCallCheck2(this,FableServiceRestClient);_this39=_callSuper(this,FableServiceRestClient,[pFable,pOptions,pServiceHash]);_this39.TraceLog=false;if(_this39.options.TraceLog||_this39.fable.TraceLog){_this39.TraceLog=true;}_this39.dataFormat=_this39.fable.services.DataFormat;_this39.serviceType='RestClient';_this39.cookie=false;// This is a function that can be overridden, to allow the management
|
|
2037
2036
|
// of the request options before they are passed to the request library.
|
|
2038
|
-
|
|
2037
|
+
_this39.prepareRequestOptions=function(pOptions){return pOptions;};return _this39;}_inherits(FableServiceRestClient,_libFableServiceBase1);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.
|
|
2039
2038
|
pRequestOptions.headers.cookie=libCookie.serialize(tmpCookieKeys[0],tmpCookieObject[tmpCookieKeys[0]]);}}return pRequestOptions;}},{key:"preRequest",value:function preRequest(pOptions){// Validate the options object
|
|
2040
2039
|
var tmpOptions=this.prepareCookies(pOptions);// Prepend a string to the URL if it exists in the Fable Config
|
|
2041
|
-
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
|
|
2042
|
-
if(
|
|
2043
|
-
if(
|
|
2044
|
-
if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.concat([tmpDataBuffer,pChunk]);}});pResponse.on('end',function(){if(
|
|
2040
|
+
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 _this40=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(_this40.TraceLog){var tmpConnectTime=_this40.fable.log.getTimeStamp();_this40.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this40.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.
|
|
2041
|
+
if(_this40.TraceLog){var tmpChunkTime=_this40.fable.log.getTimeStamp();_this40.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this40.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpData+=pChunk;});pResponse.on('end',function(){if(_this40.TraceLog){var tmpCompletionTime=_this40.fable.log.getTimeStamp();_this40.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpData.length,"b received in ").concat(_this40.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpData);});});}},{key:"executeChunkedRequestBinary",value:function executeChunkedRequestBinary(pOptions,fCallback){var _this41=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(_this41.TraceLog){var tmpConnectTime=_this41.fable.log.getTimeStamp();_this41.fable.log.debug("--> ".concat(tmpOptions.method," connected in ").concat(_this41.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.
|
|
2042
|
+
if(_this41.TraceLog){var tmpChunkTime=_this41.fable.log.getTimeStamp();_this41.fable.log.debug("--> ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this41.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.
|
|
2043
|
+
if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.concat([tmpDataBuffer,pChunk]);}});pResponse.on('end',function(){if(_this41.TraceLog){var tmpCompletionTime=_this41.fable.log.getTimeStamp();_this41.fable.log.debug("==> ".concat(tmpOptions.method," completed data size ").concat(tmpDataBuffer.length,"b received in ").concat(_this41.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpDataBuffer);});});}},{key:"executeJSONRequest",value:function executeJSONRequest(pOptions,fCallback){var _this42=this;pOptions.json=true;var tmpOptions=this.preRequest(pOptions);if(!('headers'in tmpOptions)){tmpOptions.headers={};}/* Automated headers break some APIs
|
|
2045
2044
|
if (!('Content-Type' in tmpOptions.headers))
|
|
2046
2045
|
{
|
|
2047
2046
|
tmpOptions.headers['Content-Type'] = 'application/json';
|
|
2048
2047
|
}
|
|
2049
|
-
*/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(
|
|
2048
|
+
*/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(_this42.TraceLog){var tmpConnectTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("--> JSON ".concat(tmpOptions.method," connected in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpJSONData='';pResponse.on('data',function(pChunk){if(_this42.TraceLog){var tmpChunkTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("--> JSON ".concat(tmpOptions.method," data chunk size ").concat(pChunk.length,"b received in ").concat(_this42.dataFormat.formatTimeDelta(tmpOptions.RequestStartTime,tmpChunkTime),"ms"));}tmpJSONData+=pChunk;});pResponse.on('end',function(){if(_this42.TraceLog){var tmpCompletionTime=_this42.fable.log.getTimeStamp();_this42.fable.log.debug("==> JSON ".concat(tmpOptions.method," completed - received in ").concat(_this42.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":66,"fable-serviceproviderbase":58,"simple-get":163}],97:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceTemplate=/*#__PURE__*/function(_libFableServiceBase10){// Underscore and lodash have a behavior, _.template, which compiles a
|
|
2050
2049
|
// string-based template with code snippets into simple executable pieces,
|
|
2051
2050
|
// with the added twist of returning a precompiled function ready to go.
|
|
2052
2051
|
//
|
|
@@ -2055,19 +2054,19 @@ if(!tmpDataBuffer){tmpDataBuffer=Buffer.from(pChunk);}else{tmpDataBuffer=Buffer.
|
|
|
2055
2054
|
//
|
|
2056
2055
|
// This is an implementation of that.
|
|
2057
2056
|
// TODO: Make this use precedent, add configuration, add debugging.
|
|
2058
|
-
function FableServiceTemplate(pFable,pOptions,pServiceHash){var
|
|
2057
|
+
function FableServiceTemplate(pFable,pOptions,pServiceHash){var _this43;_classCallCheck2(this,FableServiceTemplate);_this43=_callSuper(this,FableServiceTemplate,[pFable,pOptions,pServiceHash]);_this43.serviceType='Template';// These are the exact regex's used in lodash/underscore
|
|
2059
2058
|
// TODO: Switch this to precedent
|
|
2060
|
-
|
|
2059
|
+
_this43.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.
|
|
2061
2060
|
GuaranteedNonMatch:/.^/};// This is a helper for the escaper and unescaper functions.
|
|
2062
2061
|
// Right now we are going to keep what underscore is doing, but, not forever.
|
|
2063
|
-
|
|
2062
|
+
_this43.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
|
|
2064
2063
|
// function on this class.
|
|
2065
|
-
|
|
2064
|
+
_this43.renderFunction=false;_this43.templateString=false;return _this43;}_inherits(FableServiceTemplate,_libFableServiceBase10);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 _this44=this;// For now this is being kept in a weird form ... this is to mimic the old
|
|
2066
2065
|
// underscore code until this is rewritten using precedent.
|
|
2067
|
-
this.TemplateSource="__p+='"+pTemplateText.replace(this.Matchers.Escaper,function(pMatch){return"\\".concat(
|
|
2066
|
+
this.TemplateSource="__p+='"+pTemplateText.replace(this.Matchers.Escaper,function(pMatch){return"\\".concat(_this44.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
|
|
2068
2067
|
// precompilation.
|
|
2069
|
-
this.TemplateSourceCompiled='function(obj){\n'+this.TemplateSource+'}';return this.templateFunction();}}]);}(libFableServiceBase);module.exports=FableServiceTemplate;},{"fable-serviceproviderbase":
|
|
2070
|
-
var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('async.eachlimit');var libBigNumber=require('big.js');var FableServiceUtility=/*#__PURE__*/function(
|
|
2068
|
+
this.TemplateSourceCompiled='function(obj){\n'+this.TemplateSource+'}';return this.templateFunction();}}]);}(libFableServiceBase);module.exports=FableServiceTemplate;},{"fable-serviceproviderbase":58}],98:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');// TODO: These are still pretty big -- consider the smaller polyfills
|
|
2069
|
+
var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('async.eachlimit');var libBigNumber=require('big.js');var FableServiceUtility=/*#__PURE__*/function(_libFableServiceBase11){// Underscore and lodash have a behavior, _.template, which compiles a
|
|
2071
2070
|
// string-based template with code snippets into simple executable pieces,
|
|
2072
2071
|
// with the added twist of returning a precompiled function ready to go.
|
|
2073
2072
|
//
|
|
@@ -2076,12 +2075,12 @@ var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('
|
|
|
2076
2075
|
//
|
|
2077
2076
|
// This is an implementation of that.
|
|
2078
2077
|
// TODO: Make this use precedent, add configuration, add debugging.
|
|
2079
|
-
function FableServiceUtility(pFable,pOptions,pServiceHash){var
|
|
2080
|
-
|
|
2078
|
+
function FableServiceUtility(pFable,pOptions,pServiceHash){var _this45;_classCallCheck2(this,FableServiceUtility);_this45=_callSuper(this,FableServiceUtility,[pFable,pOptions,pServiceHash]);_this45.templates={};// These two functions are used extensively throughout
|
|
2079
|
+
_this45.waterfall=libAsyncWaterfall;_this45.eachLimit=libAsyncEachLimit;_this45.bigNumber=libBigNumber;return _this45;}// Underscore and lodash have a behavior, _.extend, which merges objects.
|
|
2081
2080
|
// Now that es6 gives us this, use the native thingy.
|
|
2082
2081
|
// Nevermind, the native thing is not stable enough across environments
|
|
2083
2082
|
// Basic shallow copy
|
|
2084
|
-
_inherits(FableServiceUtility,
|
|
2083
|
+
_inherits(FableServiceUtility,_libFableServiceBase11);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
|
|
2085
2084
|
// string-based template with code snippets into simple executable pieces,
|
|
2086
2085
|
// with the added twist of returning a precompiled function ready to go.
|
|
2087
2086
|
},{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
|
|
@@ -2191,12 +2190,12 @@ if(!this.manifest){this.manifest=this.fable.newManyfest();}if(!Array.isArray(pOb
|
|
|
2191
2190
|
* @param {string} pValueAddress - The manyfest hash/address of the value to return
|
|
2192
2191
|
* @returns {any} - The value from the object
|
|
2193
2192
|
*/},{key:"findFirstValueByExactMatchInternal",value:function findFirstValueByExactMatchInternal(pFableAddress,pValueToMatchAddress,pValueToMatch,pValueAddress){// Lazily create a manifest if it doesn't exist
|
|
2194
|
-
if(!this.manifest){this.manifest=this.fable.newManyfest();}if(typeof pFableAddress!='string'){return undefined;}var tmpObjectArray=this.manifest.getValueByHash(this.fable,pFableAddress);return this.findFirstValueByExactMatch(tmpObjectArray,pValueToMatchAddress,pValueToMatch,pValueAddress);}}]);}(libFableServiceBase);module.exports=FableServiceUtility;},{"async.eachlimit":1,"async.waterfall":15,"big.js":17,"fable-serviceproviderbase":
|
|
2193
|
+
if(!this.manifest){this.manifest=this.fable.newManyfest();}if(typeof pFableAddress!='string'){return undefined;}var tmpObjectArray=this.manifest.getValueByHash(this.fable,pFableAddress);return this.findFirstValueByExactMatch(tmpObjectArray,pValueToMatchAddress,pValueToMatch,pValueAddress);}}]);}(libFableServiceBase);module.exports=FableServiceUtility;},{"async.eachlimit":1,"async.waterfall":15,"big.js":17,"fable-serviceproviderbase":58}],99:[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;};},{}],100:[function(require,module,exports){'use strict';var implementation=require('./implementation');module.exports=Function.prototype.bind||implementation;},{"./implementation":99}],101:[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
|
|
2195
2194
|
var getEvalledConstructor=function getEvalledConstructor(expressionSyntax){try{return $Function('"use strict"; return ('+expressionSyntax+').constructor;')();}catch(e){}};var $gOPD=require('gopd');var $defineProperty=require('es-define-property');var throwTypeError=function throwTypeError(){throw new $TypeError();};var ThrowTypeError=$gOPD?function(){try{// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
|
2196
2195
|
arguments.callee;// IE 8 does not throw here
|
|
2197
2196
|
return throwTypeError;}catch(calleeThrows){try{// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
2198
2197
|
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
|
|
2199
|
-
'%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
|
|
2198
|
+
'%EvalError%':$EvalError,'%Float16Array%':typeof Float16Array==='undefined'?undefined:Float16Array,'%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
|
|
2200
2199
|
}catch(e){// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
2201
2200
|
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
|
|
2202
2201
|
// property to emulate a data property that does not suffer from
|
|
@@ -2205,10 +2204,10 @@ var errorProto=getProto(getProto(e));INTRINSICS['%Error.prototype%']=errorProto;
|
|
|
2205
2204
|
// uphold the illusion by pretending to see that original data
|
|
2206
2205
|
// property, i.e., returning the value rather than the getter
|
|
2207
2206
|
// itself.
|
|
2208
|
-
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":
|
|
2207
|
+
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":40,"es-errors":42,"es-errors/eval":41,"es-errors/range":43,"es-errors/ref":44,"es-errors/syntax":45,"es-errors/type":46,"es-errors/uri":47,"es-object-atoms":48,"function-bind":100,"get-proto":104,"get-proto/Object.getPrototypeOf":102,"get-proto/Reflect.getPrototypeOf":103,"gopd":106,"has-symbols":107,"hasown":109,"math-intrinsics/abs":125,"math-intrinsics/floor":126,"math-intrinsics/max":128,"math-intrinsics/min":129,"math-intrinsics/pow":130,"math-intrinsics/round":131,"math-intrinsics/sign":132}],102:[function(require,module,exports){'use strict';var $Object=require('es-object-atoms');/** @type {import('./Object.getPrototypeOf')} */module.exports=$Object.getPrototypeOf||null;},{"es-object-atoms":48}],103:[function(require,module,exports){'use strict';/** @type {import('./Reflect.getPrototypeOf')} */module.exports=typeof Reflect!=='undefined'&&Reflect.getPrototypeOf||null;},{}],104:[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
|
|
2209
2208
|
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
|
|
2210
2209
|
return originalGetProto(O);}:getDunderProto?function getProto(O){// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
2211
|
-
return getDunderProto(O);}:null;},{"./Object.getPrototypeOf":102,"./Reflect.getPrototypeOf":103,"dunder-proto/get":
|
|
2210
|
+
return getDunderProto(O);}:null;},{"./Object.getPrototypeOf":102,"./Reflect.getPrototypeOf":103,"dunder-proto/get":39}],105:[function(require,module,exports){'use strict';/** @type {import('./gOPD')} */module.exports=Object.getOwnPropertyDescriptor;},{}],106:[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
|
|
2212
2211
|
$gOPD=null;}}module.exports=$gOPD;},{"./gOPD":105}],107:[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":108}],108:[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
|
|
2213
2212
|
// if (sym instanceof Symbol) { return false; }
|
|
2214
2213
|
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
|
@@ -2251,12 +2250,12 @@ var cleanWrapCharacters=function cleanWrapCharacters(pCharacter,pString){if(pStr
|
|
|
2251
2250
|
*
|
|
2252
2251
|
* @class ManyfestHashTranslation
|
|
2253
2252
|
*/var ManyfestHashTranslation=/*#__PURE__*/function(){function ManyfestHashTranslation(pInfoLog,pErrorLog){_classCallCheck2(this,ManyfestHashTranslation);// Wire in logging
|
|
2254
|
-
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
|
|
2253
|
+
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 _this46=this;// This adds a translation in the form of:
|
|
2255
2254
|
// { "SourceHash": "DestinationHash", "SecondSourceHash":"SecondDestinationHash" }
|
|
2256
|
-
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'){
|
|
2255
|
+
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'){_this46.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{_this46.translationTable[pTranslationSource]=pTranslation[pTranslationSource];}});}},{key:"removeTranslationHash",value:function removeTranslationHash(pTranslationHash){if(pTranslationHash in this.translationTable){delete this.translationTable[pTranslationHash];}}// This removes translations.
|
|
2257
2256
|
// If passed a string, just removes the single one.
|
|
2258
2257
|
// If passed an object, it does all the source keys.
|
|
2259
|
-
},{key:"removeTranslation",value:function removeTranslation(pTranslation){var
|
|
2258
|
+
},{key:"removeTranslation",value:function removeTranslation(pTranslation){var _this47=this;if(typeof pTranslation=='string'){this.removeTranslationHash(pTranslation);return true;}else if(_typeof(pTranslation)=='object'){var tmpTranslationSources=Object.keys(pTranslation);tmpTranslationSources.forEach(function(pTranslationSource){_this47.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":115}],115:[function(require,module,exports){/**
|
|
2260
2259
|
* @author <steven@velozo.com>
|
|
2261
2260
|
*//**
|
|
2262
2261
|
* Manyfest simple logging shim (for browser and dependency-free running)
|
|
@@ -2518,13 +2517,13 @@ else if(_tmpBracketStartIndex2>0// 2) The end bracket is after the start brac
|
|
|
2518
2517
|
return false;}// We need to enumerate the array and grab the addresses from there.
|
|
2519
2518
|
var tmpArrayProperty=pObject[_tmpBoxedPropertyName4];// Managing the parent address is a bit more complex here -- the box will be added for each element.
|
|
2520
2519
|
tmpParentAddress="".concat(tmpParentAddress).concat(tmpParentAddress.length>0?'.':'').concat(_tmpBoxedPropertyName4);// The container object is where we have the "Address":SOMEVALUE pairs
|
|
2521
|
-
var tmpContainerObject={};for(var
|
|
2520
|
+
var tmpContainerObject={};for(var _i23=0;_i23<tmpArrayProperty.length;_i23++){var tmpPropertyParentAddress="".concat(tmpParentAddress,"[").concat(_i23,"]");var tmpValue=this.deleteValueAtAddress(pObject[_tmpBoxedPropertyName4][_i23],tmpNewAddress,tmpPropertyParentAddress);tmpContainerObject["".concat(tmpPropertyParentAddress,".").concat(tmpNewAddress)]=tmpValue;}return tmpContainerObject;}// OBJECT SET
|
|
2522
2521
|
// Note this will not work with a bracket in the same address box set
|
|
2523
2522
|
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.
|
|
2524
2523
|
return false;}// We need to enumerate the Object and grab the addresses from there.
|
|
2525
2524
|
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.
|
|
2526
2525
|
tmpParentAddress="".concat(tmpParentAddress).concat(tmpParentAddress.length>0?'.':'').concat(_tmpObjectPropertyName);// The container object is where we have the "Address":SOMEVALUE pairs
|
|
2527
|
-
var _tmpContainerObject={};for(var
|
|
2526
|
+
var _tmpContainerObject={};for(var _i24=0;_i24<tmpObjectPropertyKeys.length;_i24++){var _tmpPropertyParentAddress="".concat(tmpParentAddress,".").concat(tmpObjectPropertyKeys[_i24]);var _tmpValue3=this.deleteValueAtAddress(pObject[_tmpObjectPropertyName][tmpObjectPropertyKeys[_i24]],tmpNewAddress,_tmpPropertyParentAddress);// The filtering is complex but allows config-based metaprogramming directly from schema
|
|
2528
2527
|
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
|
|
2529
2528
|
// then the system can't set the value in there. Error and abort!
|
|
2530
2529
|
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
|
|
@@ -2595,11 +2594,11 @@ var tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.Data
|
|
|
2595
2594
|
if(tmpFunctionAddress in pObject){try{return pObject[tmpFunctionAddress].apply(pObject);}catch(pError){// The function call failed, so the address doesn't exist
|
|
2596
2595
|
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
|
|
2597
2596
|
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
|
|
2598
|
-
for(var
|
|
2597
|
+
for(var _i25=0;_i25<tmpFunctionArguments.length;_i25++){// Resolve the values for each subsequent entry
|
|
2599
2598
|
// Check if the argument value is a string literal or a reference to an address
|
|
2600
|
-
if(tmpFunctionArguments[
|
|
2601
|
-
tmpArgumentValues.push(tmpFunctionArguments[
|
|
2602
|
-
tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject2,tmpFunctionArguments[
|
|
2599
|
+
if(tmpFunctionArguments[_i25].length>=2&&(tmpFunctionArguments[_i25].charAt(0)=='"'||tmpFunctionArguments[_i25].charAt(0)=="'"||tmpFunctionArguments[_i25].charAt(0)=="`")&&(tmpFunctionArguments[_i25].charAt(tmpFunctionArguments[_i25].length-1)=='"'||tmpFunctionArguments[_i25].charAt(tmpFunctionArguments[_i25].length-1)=="'"||tmpFunctionArguments[_i25].charAt(tmpFunctionArguments[_i25].length-1)=="`")){// This is a string literal
|
|
2600
|
+
tmpArgumentValues.push(tmpFunctionArguments[_i25].substring(1,tmpFunctionArguments[_i25].length-1));}else{// This is a hash address
|
|
2601
|
+
tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject2,tmpFunctionArguments[_i25]));}}if(tmpFunctionAddress in pObject){try{return pObject[tmpFunctionAddress].apply(pObject,tmpArgumentValues);}catch(pError){// The function call failed, so the address doesn't exist
|
|
2603
2602
|
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
|
|
2604
2603
|
console.log("Function ".concat(tmpFunctionAddress," does not exist (address [").concat(pAddress,"])"));return false;}}}// Boxed elements look like this:
|
|
2605
2604
|
// MyValues[10]
|
|
@@ -2632,8 +2631,8 @@ return pObject[tmpBoxedPropertyName][tmpBoxedPropertyReference];}else{return pOb
|
|
|
2632
2631
|
else if(tmpBracketStartIndex>0// 2) The end bracket is after the start bracket
|
|
2633
2632
|
&&tmpBracketStopIndex>tmpBracketStartIndex// 3) There is nothing in the brackets
|
|
2634
2633
|
&&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.
|
|
2635
|
-
return false;}var tmpInputArray=pObject[_tmpBoxedPropertyName5];var tmpOutputArray=[];for(var
|
|
2636
|
-
var tmpKeepRecord=this.checkRecordFilters(pAddress,tmpInputArray[
|
|
2634
|
+
return false;}var tmpInputArray=pObject[_tmpBoxedPropertyName5];var tmpOutputArray=[];for(var _i26=0;_i26<tmpInputArray.length;_i26++){// The filtering is complex but allows config-based metaprogramming directly from schema
|
|
2635
|
+
var tmpKeepRecord=this.checkRecordFilters(pAddress,tmpInputArray[_i26]);if(tmpKeepRecord){tmpOutputArray.push(tmpInputArray[_i26]);}}return tmpOutputArray;}// The object has been flagged as an object set, so treat it as such
|
|
2637
2636
|
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.
|
|
2638
2637
|
return false;}return pObject[tmpObjectPropertyName];}else{// Now is the point in recursion to return the value in the address
|
|
2639
2638
|
if(_typeof(pObject[pAddress])!=null){return pObject[pAddress];}else{return null;}}}else{//let tmpSubObjectName = pAddress.substring(0, tmpSeparatorIndex);
|
|
@@ -2662,11 +2661,11 @@ var _tmpFunctionArguments=_MockFable.DataFormat.stringGetSegments(_MockFable.Dat
|
|
|
2662
2661
|
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
|
|
2663
2662
|
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
|
|
2664
2663
|
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
|
|
2665
|
-
for(var
|
|
2664
|
+
for(var _i27=0;_i27<_tmpFunctionArguments.length;_i27++){// Resolve the values for each subsequent entry
|
|
2666
2665
|
// Check if the argument value is a string literal or a reference to an address
|
|
2667
|
-
if(_tmpFunctionArguments[
|
|
2668
|
-
_tmpArgumentValues.push(_tmpFunctionArguments[
|
|
2669
|
-
_tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject3,_tmpFunctionArguments[
|
|
2666
|
+
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
|
|
2667
|
+
_tmpArgumentValues.push(_tmpFunctionArguments[_i27].substring(1,_tmpFunctionArguments[_i27].length-1));}else{// This is a hash address
|
|
2668
|
+
_tmpArgumentValues.push(this.getValueAtAddress(_tmpRootObject3,_tmpFunctionArguments[_i27]));}}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
|
|
2670
2669
|
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
|
|
2671
2670
|
console.log("Function ".concat(_tmpFunctionAddress2," does not exist (address [").concat(pAddress,"])"));return false;}}}// Boxed elements look like this:
|
|
2672
2671
|
// MyValues[42]
|
|
@@ -2710,13 +2709,13 @@ else if(_tmpBracketStartIndex3>0// 2) The end bracket is after the start brac
|
|
|
2710
2709
|
return false;}// We need to enumerate the array and grab the addresses from there.
|
|
2711
2710
|
var tmpArrayProperty=pObject[_tmpBoxedPropertyName7];// Managing the parent address is a bit more complex here -- the box will be added for each element.
|
|
2712
2711
|
tmpParentAddress="".concat(tmpParentAddress).concat(tmpParentAddress.length>0?'.':'').concat(_tmpBoxedPropertyName7);// The container object is where we have the "Address":SOMEVALUE pairs
|
|
2713
|
-
var tmpContainerObject={};for(var
|
|
2712
|
+
var tmpContainerObject={};for(var _i28=0;_i28<tmpArrayProperty.length;_i28++){var tmpPropertyParentAddress="".concat(tmpParentAddress,"[").concat(_i28,"]");var tmpValue=this.getValueAtAddress(pObject[_tmpBoxedPropertyName7][_i28],tmpNewAddress,tmpPropertyParentAddress,tmpRootObject);tmpContainerObject["".concat(tmpPropertyParentAddress,".").concat(tmpNewAddress)]=tmpValue;}return tmpContainerObject;}// OBJECT SET
|
|
2714
2713
|
// Note this will not work with a bracket in the same address box set
|
|
2715
2714
|
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.
|
|
2716
2715
|
return false;}// We need to enumerate the Object and grab the addresses from there.
|
|
2717
2716
|
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.
|
|
2718
2717
|
tmpParentAddress="".concat(tmpParentAddress).concat(tmpParentAddress.length>0?'.':'').concat(_tmpObjectPropertyName2);// The container object is where we have the "Address":SOMEVALUE pairs
|
|
2719
|
-
var _tmpContainerObject2={};for(var
|
|
2718
|
+
var _tmpContainerObject2={};for(var _i29=0;_i29<tmpObjectPropertyKeys.length;_i29++){var _tmpPropertyParentAddress2="".concat(tmpParentAddress,".").concat(tmpObjectPropertyKeys[_i29]);var _tmpValue4=this.getValueAtAddress(pObject[_tmpObjectPropertyName2][tmpObjectPropertyKeys[_i29]],tmpNewAddress,_tmpPropertyParentAddress2,tmpRootObject);// The filtering is complex but allows config-based metaprogramming directly from schema
|
|
2720
2719
|
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
|
|
2721
2720
|
// then the system can't set the value in there. Error and abort!
|
|
2722
2721
|
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
|
|
@@ -2926,7 +2925,7 @@ this.logInfo=typeof pInfoLog=='function'?pInfoLog:libSimpleLog;this.logError=typ
|
|
|
2926
2925
|
// This will return a mega set of key:value pairs with all possible schema
|
|
2927
2926
|
// permutations and default values (when not an object) and everything else.
|
|
2928
2927
|
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.
|
|
2929
|
-
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
|
|
2928
|
+
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 _i30=0;_i30<tmpObjectProperties.length;_i30++){this.generateAddressses(pObject[tmpObjectProperties[_i30]],"".concat(tmpBaseAddress).concat(tmpObjectProperties[_i30]),tmpSchema);}}break;case'symbol':case'function':// Symbols and functions neither recurse nor get added to the schema
|
|
2930
2929
|
break;}return tmpSchema;}}]);}();;module.exports=ManyfestObjectAddressGeneration;},{"./Manyfest-LogToConsole.js":115}],122:[function(require,module,exports){// Given a string, parse out any conditional expressions and set whether or not to keep the record.
|
|
2931
2930
|
//
|
|
2932
2931
|
// For instance:
|
|
@@ -3000,17 +2999,17 @@ var tmpDescriptorAddresses=Object.keys(tmpSource);tmpDescriptorAddresses.forEach
|
|
|
3000
2999
|
* Manyfest object address-based descriptions and manipulations.
|
|
3001
3000
|
*
|
|
3002
3001
|
* @class Manyfest
|
|
3003
|
-
*/var Manyfest=/*#__PURE__*/function(
|
|
3004
|
-
|
|
3005
|
-
|
|
3002
|
+
*/var Manyfest=/*#__PURE__*/function(_libFableServiceProvi0){function Manyfest(pFable,pManifest,pServiceHash){var _this48;_classCallCheck2(this,Manyfest);if(pFable===undefined){_this48=_callSuper(this,Manyfest,[{}]);}else{_this48=_callSuper(this,Manyfest,[pFable,pManifest,pServiceHash]);}_this48.serviceType='Manifest';// Wire in logging
|
|
3003
|
+
_this48.logInfo=libSimpleLog;_this48.logError=libSimpleLog;// Create an object address resolver and map in the functions
|
|
3004
|
+
_this48.objectAddressCheckAddressExists=new libObjectAddressCheckAddressExists(_this48.logInfo,_this48.logError);_this48.objectAddressGetValue=new libObjectAddressGetValue(_this48.logInfo,_this48.logError);_this48.objectAddressSetValue=new libObjectAddressSetValue(_this48.logInfo,_this48.logError);_this48.objectAddressDeleteValue=new libObjectAddressDeleteValue(_this48.logInfo,_this48.logError);if(!('defaultValues'in _this48.options)){_this48.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 _this48.options)){_this48.options.strict=false;}_this48.scope=undefined;_this48.elementAddresses=undefined;_this48.elementHashes=undefined;_this48.elementDescriptors=undefined;_this48.reset();if(_typeof(_this48.options)==='object'){_this48.loadManifest(_this48.options);}_this48.schemaManipulations=new libSchemaManipulation(_this48.logInfo,_this48.logError);_this48.objectAddressGeneration=new libObjectAddressGeneration(_this48.logInfo,_this48.logError);_this48.hashTranslations=new libHashTranslation(_this48.logInfo,_this48.logError);_this48.numberRegex=/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;return _assertThisInitialized(_this48);}/*************************************************************************
|
|
3006
3005
|
* Schema Manifest Loading, Reading, Manipulation and Serialization Functions
|
|
3007
3006
|
*/// Reset critical manifest properties
|
|
3008
|
-
_inherits(Manyfest,
|
|
3007
|
+
_inherits(Manyfest,_libFableServiceProvi0);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
|
|
3009
3008
|
var tmpNewOptions=JSON.parse(JSON.stringify(this.options));var tmpNewManyfest=new Manyfest(this.getManifest(),this.logInfo,this.logError,tmpNewOptions);// Import the hash translations
|
|
3010
3009
|
tmpNewManyfest.hashTranslations.addTranslation(this.hashTranslations.translationTable);return tmpNewManyfest;}// Deserialize a Manifest from a string
|
|
3011
3010
|
},{key:"deserialize",value:function deserialize(pManifestString){// TODO: Add guards for bad manifest string
|
|
3012
3011
|
return this.loadManifest(JSON.parse(pManifestString));}// Load a manifest from an object
|
|
3013
|
-
},{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
|
|
3012
|
+
},{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 _i31=0;_i31<tmpDescriptionAddresses.length;_i31++){this.addDescriptor(tmpDescriptionAddresses[_i31],tmpManifest.Descriptors[tmpDescriptionAddresses[_i31]]);}}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 _i32=0;_i32<tmpManifest.HashTranslations.length;_i32++){// Each translation is
|
|
3014
3013
|
}}}}// Serialize the Manifest to a string
|
|
3015
3014
|
},{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
|
|
3016
3015
|
},{key:"addDescriptor",value:function addDescriptor(pAddress,pDescriptor){if(_typeof(pDescriptor)==='object'){// Add the Address into the Descriptor if it doesn't exist:
|
|
@@ -3053,19 +3052,19 @@ return null;}}}// Enumerate through the schema and populate default values if th
|
|
|
3053
3052
|
},{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.
|
|
3054
3053
|
function(pDescriptor){return'Default'in pDescriptor;});}// Forcefully populate all values even if they don't have defaults.
|
|
3055
3054
|
// Based on type, this can do unexpected things.
|
|
3056
|
-
},{key:"populateObject",value:function populateObject(pObject,pOverwriteProperties,fFilter){var
|
|
3055
|
+
},{key:"populateObject",value:function populateObject(pObject,pOverwriteProperties,fFilter){var _this49=this;// Automatically create an object if one isn't passed in.
|
|
3057
3056
|
var tmpObject=_typeof(pObject)==='object'?pObject:{};// Default to *NOT OVERWRITING* properties
|
|
3058
3057
|
var tmpOverwriteProperties=typeof pOverwriteProperties=='undefined'?false:pOverwriteProperties;// This is a filter function, which is passed the schema and allows complex filtering of population
|
|
3059
3058
|
// The default filter function just returns true, populating everything.
|
|
3060
|
-
var tmpFilterFunction=typeof fFilter=='function'?fFilter:function(pDescriptor){return true;};this.elementAddresses.forEach(function(pAddress){var tmpDescriptor=
|
|
3059
|
+
var tmpFilterFunction=typeof fFilter=='function'?fFilter:function(pDescriptor){return true;};this.elementAddresses.forEach(function(pAddress){var tmpDescriptor=_this49.getDescriptor(pAddress);// Check the filter function to see if this is an address we want to set the value for.
|
|
3061
3060
|
if(tmpFilterFunction(tmpDescriptor)){// If we are overwriting properties OR the property does not exist
|
|
3062
|
-
if(tmpOverwriteProperties||!
|
|
3061
|
+
if(tmpOverwriteProperties||!_this49.checkAddressExists(tmpObject,pAddress)){_this49.setValueAtAddress(tmpObject,pAddress,_this49.getDefaultValue(tmpDescriptor));}}});return tmpObject;}}]);}(libFableServiceProviderBase);;module.exports=Manyfest;},{"./Manyfest-HashTranslation.js":114,"./Manyfest-LogToConsole.js":115,"./Manyfest-ObjectAddress-CheckAddressExists.js":116,"./Manyfest-ObjectAddress-DeleteValue.js":117,"./Manyfest-ObjectAddress-GetValue.js":118,"./Manyfest-ObjectAddress-SetValue.js":120,"./Manyfest-ObjectAddressGeneration.js":121,"./Manyfest-SchemaManipulation.js":123,"fable-serviceproviderbase":58}],125:[function(require,module,exports){'use strict';/** @type {import('./abs')} */module.exports=Math.abs;},{}],126:[function(require,module,exports){'use strict';/** @type {import('./floor')} */module.exports=Math.floor;},{}],127:[function(require,module,exports){'use strict';/** @type {import('./isNaN')} */module.exports=Number.isNaN||function isNaN(a){return a!==a;};},{}],128:[function(require,module,exports){'use strict';/** @type {import('./max')} */module.exports=Math.max;},{}],129:[function(require,module,exports){'use strict';/** @type {import('./min')} */module.exports=Math.min;},{}],130:[function(require,module,exports){'use strict';/** @type {import('./pow')} */module.exports=Math.pow;},{}],131:[function(require,module,exports){'use strict';/** @type {import('./round')} */module.exports=Math.round;},{}],132:[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":127}],133:[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
|
|
3063
3062
|
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
|
|
3064
3063
|
?function(O){return O.__proto__;// eslint-disable-line no-proto
|
|
3065
3064
|
}: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)
|
|
3066
3065
|
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
|
|
3067
3066
|
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
|
|
3068
|
-
/* 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
|
|
3067
|
+
/* 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 canTrustToString(obj){return!toStringTag||!(_typeof(obj)==='object'&&(toStringTag in obj||typeof obj[toStringTag]!=='undefined'));}function isArray(obj){return toStr(obj)==='[object Array]'&&canTrustToString(obj);}function isDate(obj){return toStr(obj)==='[object Date]'&&canTrustToString(obj);}function isRegExp(obj){return toStr(obj)==='[object RegExp]'&&canTrustToString(obj);}function isError(obj){return toStr(obj)==='[object Error]'&&canTrustToString(obj);}function isString(obj){return toStr(obj)==='[object String]'&&canTrustToString(obj);}function isNumber(obj){return toStr(obj)==='[object Number]'&&canTrustToString(obj);}function isBoolean(obj){return toStr(obj)==='[object Boolean]'&&canTrustToString(obj);}// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
3069
3068
|
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
|
|
3070
3069
|
}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
|
|
3071
3070
|
}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
|
|
@@ -3163,19 +3162,19 @@ MainViewportViewIdentifier:'Default-View',MainViewportRenderableHash:false,MainV
|
|
|
3163
3162
|
AutoSolveAfterInitialize:true,AutoRenderMainViewportViewAfterInitialize:true,AutoRenderViewsAfterInitialize:false,ConfigurationOnlyViews:[],Manifests:{},// The prefix to prepend on all template destination hashes
|
|
3164
3163
|
IdentifierAddressPrefix:'PICT-'};/**
|
|
3165
3164
|
* Base class for pict applications.
|
|
3166
|
-
*/var PictApplication=/*#__PURE__*/function(
|
|
3165
|
+
*/var PictApplication=/*#__PURE__*/function(_libFableServiceBase12){/**
|
|
3167
3166
|
* @param {import('fable')} pFable
|
|
3168
3167
|
* @param {any} [pOptions]
|
|
3169
3168
|
* @param {string} [pServiceHash]
|
|
3170
|
-
*/function PictApplication(pFable,pOptions,pServiceHash){var
|
|
3169
|
+
*/function PictApplication(pFable,pOptions,pServiceHash){var _this50;_classCallCheck2(this,PictApplication);var tmpCarryOverConfiguration=_typeof(pFable.settings.PictApplicationConfiguration)==='object'?pFable.settings.PictApplicationConfiguration:{};var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictSettings)),tmpCarryOverConfiguration,pOptions);_this50=_callSuper(this,PictApplication,[pFable,tmpOptions,pServiceHash]);/** @type {any} */_this50.options;/** @type {any} */_this50.log;/** @type {import('pict') & import('fable')} */_this50.fable;/** @type {string} */_this50.UUID;/** @type {string} */_this50.Hash;/**
|
|
3171
3170
|
* @type {{ [key: string]: any }}
|
|
3172
|
-
*/
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
var tmpManifestKeys=Object.keys(
|
|
3176
|
-
var tmpManifestKey=tmpManifestKeys[i];
|
|
3171
|
+
*/_this50.servicesMap;_this50.serviceType='PictApplication';/** @type {Object} */_this50._Package=libPackage;// Convenience and consistency naming
|
|
3172
|
+
_this50.pict=_this50.fable;// Wire in the essential Pict state
|
|
3173
|
+
_this50.AppData=_this50.fable.AppData;/** @type {number} */_this50.initializeTimestamp;/** @type {number} */_this50.lastSolvedTimestamp;/** @type {number} */_this50.lastMarshalFromViewsTimestamp;/** @type {number} */_this50.lastMarshalToViewsTimestamp;/** @type {number} */_this50.lastAutoRenderTimestamp;// Load all the manifests for the application
|
|
3174
|
+
var tmpManifestKeys=Object.keys(_this50.options.Manifests);if(tmpManifestKeys.length>0){for(var i=0;i<tmpManifestKeys.length;i++){// Load each manifest
|
|
3175
|
+
var tmpManifestKey=tmpManifestKeys[i];_this50.fable.instantiateServiceProvider('Manifest',_this50.options.Manifests[tmpManifestKey],tmpManifestKey);}}return _this50;}/* -------------------------------------------------------------------------- *//* Code Section: Solve All Views *//* -------------------------------------------------------------------------- *//**
|
|
3177
3176
|
* @return {boolean}
|
|
3178
|
-
*/_inherits(PictApplication,
|
|
3177
|
+
*/_inherits(PictApplication,_libFableServiceBase12);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;}/**
|
|
3179
3178
|
* @param {(error?: Error) => void} fCallback
|
|
3180
3179
|
*/},{key:"onPreSolveAsync",value:function onPreSolveAsync(fCallback){this.onPreSolve();return fCallback();}/**
|
|
3181
3180
|
* @return {boolean}
|
|
@@ -3189,16 +3188,16 @@ var tmpManifestKey=tmpManifestKeys[i];_this52.fable.instantiateServiceProvider('
|
|
|
3189
3188
|
* @return {boolean}
|
|
3190
3189
|
*/},{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.
|
|
3191
3190
|
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)
|
|
3192
|
-
tmpProvidersToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var
|
|
3193
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToSolve=[];for(var
|
|
3194
|
-
tmpViewsToSolve.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3191
|
+
tmpProvidersToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var _i33=0;_i33<tmpProvidersToSolve.length;_i33++){tmpProvidersToSolve[_i33].solve(tmpProvidersToSolve[_i33]);}this.onBeforeSolve();// Now walk through any loaded views and initialize them as well.
|
|
3192
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToSolve=[];for(var _i34=0;_i34<tmpLoadedViews.length;_i34++){var tmpView=this.pict.views[tmpLoadedViews[_i34]];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)
|
|
3193
|
+
tmpViewsToSolve.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i35=0;_i35<tmpViewsToSolve.length;_i35++){tmpViewsToSolve[_i35].solve();}this.onSolve();this.onAfterSolve();this.lastSolvedTimestamp=this.fable.log.getTimeStamp();return true;}/**
|
|
3195
3194
|
* @param {(error?: Error) => void} fCallback
|
|
3196
|
-
*/},{key:"solveAsync",value:function solveAsync(fCallback){var
|
|
3197
|
-
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){
|
|
3195
|
+
*/},{key:"solveAsync",value:function solveAsync(fCallback){var _this51=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
|
|
3196
|
+
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){_this51.log.error("PictApp [".concat(_this51.UUID,"]::[").concat(_this51.Hash,"] ").concat(_this51.options.Name," solveAsync Auto Callback Error: ").concat(pError),pError);}};}// Walk through any loaded providers and solve them as well.
|
|
3198
3197
|
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)
|
|
3199
|
-
tmpProvidersToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var
|
|
3200
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToSolve=[];for(var
|
|
3201
|
-
tmpViewsToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var
|
|
3198
|
+
tmpProvidersToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var _i36=0;_i36<tmpProvidersToSolve.length;_i36++){tmpAnticipate.anticipate(tmpProvidersToSolve[_i36].solveAsync.bind(tmpProvidersToSolve[_i36]));}// Walk through any loaded views and solve them as well.
|
|
3199
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToSolve=[];for(var _i37=0;_i37<tmpLoadedViews.length;_i37++){var tmpView=this.pict.views[tmpLoadedViews[_i37]];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)
|
|
3200
|
+
tmpViewsToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.AutoSolveOrdinal;});for(var _i38=0;_i38<tmpViewsToSolve.length;_i38++){tmpAnticipate.anticipate(tmpViewsToSolve[_i38].solveAsync.bind(tmpViewsToSolve[_i38]));}tmpAnticipate.anticipate(this.onSolveAsync.bind(this));tmpAnticipate.anticipate(this.onAfterSolveAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this51.pict.LogNoisiness>2){_this51.log.trace("PictApp [".concat(_this51.UUID,"]::[").concat(_this51.Hash,"] ").concat(_this51.options.Name," solveAsync() complete."));}_this51.lastSolvedTimestamp=_this51.fable.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3202
3201
|
* @return {boolean}
|
|
3203
3202
|
*/},{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;}/**
|
|
3204
3203
|
* @param {(error?: Error) => void} fCallback
|
|
@@ -3214,23 +3213,23 @@ tmpViewsToSolve.sort(function(a,b){return a.options.AutoSolveOrdinal-b.options.A
|
|
|
3214
3213
|
* @return {boolean}
|
|
3215
3214
|
*/},{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
|
|
3216
3215
|
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.
|
|
3217
|
-
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToInitialize=[];for(var
|
|
3218
|
-
tmpProvidersToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3219
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToInitialize=[];for(var
|
|
3220
|
-
tmpViewsToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3216
|
+
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToInitialize=[];for(var _i39=0;_i39<tmpLoadedProviders.length;_i39++){var tmpProvider=this.pict.providers[tmpLoadedProviders[_i39]];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)
|
|
3217
|
+
tmpProvidersToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i40=0;_i40<tmpProvidersToInitialize.length;_i40++){tmpProvidersToInitialize[_i40].initialize();}// Now walk through any loaded views and initialize them as well.
|
|
3218
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToInitialize=[];for(var _i41=0;_i41<tmpLoadedViews.length;_i41++){var tmpView=this.pict.views[tmpLoadedViews[_i41]];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)
|
|
3219
|
+
tmpViewsToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i42=0;_i42<tmpViewsToInitialize.length;_i42++){tmpViewsToInitialize[_i42].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
|
|
3221
3220
|
this.solve();}// Now check and see if we should automatically render as well
|
|
3222
3221
|
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
|
|
3223
3222
|
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;}}/**
|
|
3224
3223
|
* @param {(error?: Error) => void} fCallback
|
|
3225
|
-
*/},{key:"initializeAsync",value:function initializeAsync(fCallback){var
|
|
3226
|
-
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){
|
|
3224
|
+
*/},{key:"initializeAsync",value:function initializeAsync(fCallback){var _this52=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
|
|
3225
|
+
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){_this52.log.error("PictApp [".concat(_this52.UUID,"]::[").concat(_this52.Hash,"] ").concat(_this52.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
|
|
3227
3226
|
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.
|
|
3228
|
-
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToInitialize=[];for(var
|
|
3229
|
-
tmpProvidersToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3227
|
+
var tmpLoadedProviders=Object.keys(this.pict.providers);var tmpProvidersToInitialize=[];for(var _i43=0;_i43<tmpLoadedProviders.length;_i43++){var tmpProvider=this.pict.providers[tmpLoadedProviders[_i43]];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)
|
|
3228
|
+
tmpProvidersToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i44=0;_i44<tmpProvidersToInitialize.length;_i44++){tmpAnticipate.anticipate(tmpProvidersToInitialize[_i44].initializeAsync.bind(tmpProvidersToInitialize[_i44]));}// Now walk through any loaded views and initialize them as well.
|
|
3230
3229
|
// TODO: Some optimization cleverness could be gained by grouping them into a parallelized async operation, by ordinal.
|
|
3231
|
-
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToInitialize=[];for(var
|
|
3230
|
+
var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToInitialize=[];for(var _i45=0;_i45<tmpLoadedViews.length;_i45++){var tmpView=this.pict.views[tmpLoadedViews[_i45]];if(tmpView.options.AutoInitialize){tmpViewsToInitialize.push(tmpView);}}// Sort the views by their priority
|
|
3232
3231
|
// If they are all the default priority 0, it will end up being add order due to JSON Object Property Key order stuff
|
|
3233
|
-
tmpViewsToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var
|
|
3232
|
+
tmpViewsToInitialize.sort(function(a,b){return a.options.AutoInitializeOrdinal-b.options.AutoInitializeOrdinal;});for(var _i46=0;_i46<tmpViewsToInitialize.length;_i46++){var _tmpView=tmpViewsToInitialize[_i46];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){_this52.log.error("PictApp [".concat(_this52.UUID,"]::[").concat(_this52.Hash,"] ").concat(_this52.options.Name," initializeAsync Error: ").concat(pError.message||pError),{stack:pError.stack});}_this52.initializeTimestamp=_this52.fable.log.getTimeStamp();if(_this52.pict.LogNoisiness>2){_this52.log.trace("PictApp [".concat(_this52.UUID,"]::[").concat(_this52.Hash,"] ").concat(_this52.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?
|
|
3234
3233
|
return tmpCallback();}}/**
|
|
3235
3234
|
* @return {boolean}
|
|
3236
3235
|
*/},{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;}/**
|
|
@@ -3246,11 +3245,11 @@ return tmpCallback();}}/**
|
|
|
3246
3245
|
*/},{key:"onMarshalFromViewsAsync",value:function onMarshalFromViewsAsync(fCallback){this.onMarshalFromViews();return fCallback();}/**
|
|
3247
3246
|
* @return {boolean}
|
|
3248
3247
|
*/},{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.
|
|
3249
|
-
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
|
|
3248
|
+
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 _i47=0;_i47<tmpViewsToMarshalFromViews.length;_i47++){tmpViewsToMarshalFromViews[_i47].marshalFromView();}this.onMarshalFromViews();this.onAfterMarshalFromViews();this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp();return true;}/**
|
|
3250
3249
|
* @param {(error?: Error) => void} fCallback
|
|
3251
|
-
*/},{key:"marshalFromViewsAsync",value:function marshalFromViewsAsync(fCallback){var
|
|
3252
|
-
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){
|
|
3253
|
-
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
|
|
3250
|
+
*/},{key:"marshalFromViewsAsync",value:function marshalFromViewsAsync(fCallback){var _this53=this;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');// Allow the callback to be passed in as the last parameter no matter what
|
|
3251
|
+
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){_this53.log.error("PictApp [".concat(_this53.UUID,"]::[").concat(_this53.Hash,"] ").concat(_this53.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.
|
|
3252
|
+
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 _i48=0;_i48<tmpViewsToMarshalFromViews.length;_i48++){tmpAnticipate.anticipate(tmpViewsToMarshalFromViews[_i48].marshalFromViewAsync.bind(tmpViewsToMarshalFromViews[_i48]));}tmpAnticipate.anticipate(this.onMarshalFromViewsAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalFromViewsAsync.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," marshalFromViewsAsync() complete."));}_this53.lastMarshalFromViewsTimestamp=_this53.fable.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3254
3253
|
* @return {boolean}
|
|
3255
3254
|
*/},{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;}/**
|
|
3256
3255
|
* @param {(error?: Error) => void} fCallback
|
|
@@ -3265,11 +3264,11 @@ var tmpLoadedViews=Object.keys(this.pict.views);var tmpViewsToMarshalFromViews=[
|
|
|
3265
3264
|
*/},{key:"onMarshalToViewsAsync",value:function onMarshalToViewsAsync(fCallback){this.onMarshalToViews();return fCallback();}/**
|
|
3266
3265
|
* @return {boolean}
|
|
3267
3266
|
*/},{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.
|
|
3268
|
-
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
|
|
3267
|
+
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 _i49=0;_i49<tmpViewsToMarshalToViews.length;_i49++){tmpViewsToMarshalToViews[_i49].marshalToView();}this.onMarshalToViews();this.onAfterMarshalToViews();this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp();return true;}/**
|
|
3269
3268
|
* @param {(error?: Error) => void} fCallback
|
|
3270
|
-
*/},{key:"marshalToViewsAsync",value:function marshalToViewsAsync(fCallback){var
|
|
3271
|
-
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){
|
|
3272
|
-
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
|
|
3269
|
+
*/},{key:"marshalToViewsAsync",value:function marshalToViewsAsync(fCallback){var _this54=this;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');// Allow the callback to be passed in as the last parameter no matter what
|
|
3270
|
+
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){_this54.log.error("PictApp [".concat(_this54.UUID,"]::[").concat(_this54.Hash,"] ").concat(_this54.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.
|
|
3271
|
+
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 _i50=0;_i50<tmpViewsToMarshalToViews.length;_i50++){tmpAnticipate.anticipate(tmpViewsToMarshalToViews[_i50].marshalToViewAsync.bind(tmpViewsToMarshalToViews[_i50]));}tmpAnticipate.anticipate(this.onMarshalToViewsAsync.bind(this));tmpAnticipate.anticipate(this.onAfterMarshalToViewsAsync.bind(this));tmpAnticipate.wait(function(pError){if(_this54.pict.LogNoisiness>2){_this54.log.trace("PictApp [".concat(_this54.UUID,"]::[").concat(_this54.Hash,"] ").concat(_this54.options.Name," marshalToViewsAsync() complete."));}_this54.lastMarshalToViewsTimestamp=_this54.fable.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3273
3272
|
* @return {boolean}
|
|
3274
3273
|
*/},{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;}/**
|
|
3275
3274
|
* @param {(error?: Error) => void} fCallback
|
|
@@ -3297,8 +3296,8 @@ var tmpView=typeof tmpViewIdentifier==='string'?this.servicesMap.PictView[tmpVie
|
|
|
3297
3296
|
* @param {(error?: Error) => void} [fCallback] - The callback, if all other parameters are provided.
|
|
3298
3297
|
*
|
|
3299
3298
|
* TODO: Should we support objects for pTemplateDataAddress for parity with pict-view?
|
|
3300
|
-
*/},{key:"renderAsync",value:function renderAsync(pViewIdentifier,pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress,fCallback){var
|
|
3301
|
-
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){
|
|
3299
|
+
*/},{key:"renderAsync",value:function renderAsync(pViewIdentifier,pRenderableHash,pRenderDestinationAddress,pTemplateDataAddress,fCallback){var _this55=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
|
|
3300
|
+
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){_this55.log.error("PictApp [".concat(_this55.UUID,"]::[").concat(_this55.Hash,"] ").concat(_this55.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);}/**
|
|
3302
3301
|
* @return {boolean}
|
|
3303
3302
|
*/},{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;}/**
|
|
3304
3303
|
* @param {(error?: Error) => void} fCallback
|
|
@@ -3308,34 +3307,34 @@ var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateDataAddr
|
|
|
3308
3307
|
* @param {(error?: Error) => void} fCallback
|
|
3309
3308
|
*/},{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);}/**
|
|
3310
3309
|
* @return {void}
|
|
3311
|
-
*/},{key:"renderAutoViews",value:function renderAutoViews(){var
|
|
3310
|
+
*/},{key:"renderAutoViews",value:function renderAutoViews(){var _this56=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
|
|
3312
3311
|
var tmpLoadedViews=Object.keys(this.pict.views);// Sort the views by their priority
|
|
3313
3312
|
// If they are all the default priority 0, it will end up being add order due to JSON Object Property Key order stuff
|
|
3314
|
-
tmpLoadedViews.sort(function(a,b){return
|
|
3313
|
+
tmpLoadedViews.sort(function(a,b){return _this56.pict.views[a].options.AutoRenderOrdinal-_this56.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."));}}/**
|
|
3315
3314
|
* @param {(error?: Error) => void} fCallback
|
|
3316
|
-
*/},{key:"renderAutoViewsAsync",value:function renderAutoViewsAsync(fCallback){var
|
|
3317
|
-
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){
|
|
3315
|
+
*/},{key:"renderAutoViewsAsync",value:function renderAutoViewsAsync(fCallback){var _this57=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," 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){_this57.log.error("PictApp [".concat(_this57.UUID,"]::[").concat(_this57.Hash,"] ").concat(_this57.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
|
|
3318
3317
|
// TODO: Some optimization cleverness could be gained by grouping them into a parallelized async operation, by ordinal.
|
|
3319
3318
|
var tmpLoadedViews=Object.keys(this.pict.views);// Sort the views by their priority
|
|
3320
3319
|
// If they are all the default priority 0, it will end up being add order due to JSON Object Property Key order stuff
|
|
3321
|
-
tmpLoadedViews.sort(function(a,b){return
|
|
3320
|
+
tmpLoadedViews.sort(function(a,b){return _this57.pict.views[a].options.AutoRenderOrdinal-_this57.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){_this57.lastAutoRenderTimestamp=_this57.fable.log.getTimeStamp();if(_this57.pict.LogNoisiness>0){_this57.log.trace("PictApp [".concat(_this57.UUID,"]::[").concat(_this57.Hash,"] ").concat(_this57.options.Name," renderAutoViewsAsync complete."));}return tmpCallback(pError);});}/**
|
|
3322
3321
|
* @return {boolean}
|
|
3323
|
-
*/},{key:"isPictApplication",get:function get(){return true;}}]);}(libFableServiceBase);module.exports=PictApplication;},{"../package.json":136,"fable-serviceproviderbase":
|
|
3322
|
+
*/},{key:"isPictApplication",get:function get(){return true;}}]);}(libFableServiceBase);module.exports=PictApplication;},{"../package.json":136,"fable-serviceproviderbase":58}],138:[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"]}};},{}],139:[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.
|
|
3324
3323
|
// After the App initializes, initialize will be called as soon as it's added.
|
|
3325
|
-
AutoInitialize:true,AutoInitializeOrdinal:0,AutoSolveWithApp:true,AutoSolveOrdinal:0,Manifests:{},Templates:[]};var PictProvider=/*#__PURE__*/function(
|
|
3326
|
-
var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictProviderSettings)),pOptions);
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
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":138,"fable-serviceproviderbase":
|
|
3324
|
+
AutoInitialize:true,AutoInitializeOrdinal:0,AutoSolveWithApp:true,AutoSolveOrdinal:0,Manifests:{},Templates:[]};var PictProvider=/*#__PURE__*/function(_libFableServiceBase13){function PictProvider(pFable,pOptions,pServiceHash){var _this58;_classCallCheck2(this,PictProvider);// Intersect default options, parent constructor, service information
|
|
3325
|
+
var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictProviderSettings)),pOptions);_this58=_callSuper(this,PictProvider,[pFable,tmpOptions,pServiceHash]);if(!_this58.options.ProviderIdentifier){_this58.options.ProviderIdentifier="AutoProviderID-".concat(_this58.fable.getUUID());}_this58.serviceType='PictProvider';/** @type {Object} */_this58._Package=libPackage;// Convenience and consistency naming
|
|
3326
|
+
_this58.pict=_this58.fable;// Wire in the essential Pict application state
|
|
3327
|
+
_this58.AppData=_this58.pict.AppData;_this58.initializeTimestamp=false;_this58.lastSolvedTimestamp=false;for(var i=0;i<_this58.options.Templates.length;i++){var tmpDefaultTemplate=_this58.options.Templates[i];if(!tmpDefaultTemplate.hasOwnProperty('Postfix')||!tmpDefaultTemplate.hasOwnProperty('Template')){_this58.log.error("PictProvider [".concat(_this58.UUID,"]::[").concat(_this58.Hash,"] ").concat(_this58.options.ProviderIdentifier," could not load Default Template ").concat(i," in the options array."),tmpDefaultTemplate);}else{if(!tmpDefaultTemplate.Source){tmpDefaultTemplate.Source="PictProvider [".concat(_this58.UUID,"]::[").concat(_this58.Hash,"] ").concat(_this58.options.ProviderIdentifier," options object.");}_this58.pict.TemplateProvider.addDefaultTemplate(tmpDefaultTemplate.Prefix,tmpDefaultTemplate.Postfix,tmpDefaultTemplate.Template,tmpDefaultTemplate.Source);}}return _this58;}/* -------------------------------------------------------------------------- *//* Code Section: Initialization *//* -------------------------------------------------------------------------- */_inherits(PictProvider,_libFableServiceBase13);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 _this59=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){_this59.initializeTimestamp=_this59.pict.log.getTimeStamp();if(_this59.pict.LogNoisiness>0){_this59.log.info("PictProvider [".concat(_this59.UUID,"]::[").concat(_this59.Hash,"] ").concat(_this59.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?
|
|
3328
|
+
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":138,"fable-serviceproviderbase":58}],140:[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"}};},{}],141:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var libPackage=require('../package.json');/** @typedef {import('pict') & {
|
|
3330
3329
|
* [key: string]: any, // represent services for now as a workaround
|
|
3331
3330
|
* }} Pict *//**
|
|
3332
3331
|
* @class PictTemplateExpression
|
|
3333
3332
|
* @classdesc The PictTemplateExpression class is a service provider for the pict anti-framework that provides template rendering services.
|
|
3334
|
-
*/var PictTemplateExpression=/*#__PURE__*/function(
|
|
3333
|
+
*/var PictTemplateExpression=/*#__PURE__*/function(_libFableServiceBase14){/**
|
|
3335
3334
|
* @param {Pict} pFable - The Fable Framework instance
|
|
3336
3335
|
* @param {any} [pOptions] - The options for the service
|
|
3337
3336
|
* @param {String} [pServiceHash] - The hash of the service
|
|
3338
|
-
*/function PictTemplateExpression(pFable,pOptions,pServiceHash){var
|
|
3337
|
+
*/function PictTemplateExpression(pFable,pOptions,pServiceHash){var _this60;_classCallCheck2(this,PictTemplateExpression);_this60=_callSuper(this,PictTemplateExpression,[pFable,pOptions,pServiceHash]);/** @type {Pict} */_this60.fable;/** @type {Pict} */_this60.pict=_this60.fable;_this60.serviceType='PictTemplate';/** @type {Object} */_this60._Package=libPackage;return _this60;}/**
|
|
3339
3338
|
* Render a template expression, returning a string with the resulting content.
|
|
3340
3339
|
*
|
|
3341
3340
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -3343,7 +3342,7 @@ return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize
|
|
|
3343
3342
|
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
3344
3343
|
*
|
|
3345
3344
|
* @return {string} The rendered template
|
|
3346
|
-
*/_inherits(PictTemplateExpression,
|
|
3345
|
+
*/_inherits(PictTemplateExpression,_libFableServiceBase14);return _createClass2(PictTemplateExpression,[{key:"render",value:function render(pTemplateHash,pRecord,pContextArray){return'';}/**
|
|
3347
3346
|
* Render a template expression, deliver a string with the resulting content to a callback function.
|
|
3348
3347
|
*
|
|
3349
3348
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -3368,7 +3367,7 @@ return fCallback();}}},{key:"onAfterInitialize",value:function onAfterInitialize
|
|
|
3368
3367
|
* @param {any} pRootDataObject - The root data object to resolve (optional)
|
|
3369
3368
|
*
|
|
3370
3369
|
* @return {any} The value at the given address, or undefined
|
|
3371
|
-
*/},{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":140,"fable-serviceproviderbase":
|
|
3370
|
+
*/},{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":140,"fable-serviceproviderbase":58}],142:[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"}};},{}],143:[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.
|
|
3372
3371
|
// After the App initializes, initialize will be called as soon as it's added.
|
|
3373
3372
|
AutoInitialize:true,AutoInitializeOrdinal:0,// If this is set to true, when the App autorenders (on load) this will.
|
|
3374
3373
|
// After the App initializes, render will be called as soon as it's added.
|
|
@@ -3385,25 +3384,25 @@ AutoRender:true,AutoRenderOrdinal:0,AutoSolveWithApp:true,AutoSolveOrdinal:0,CSS
|
|
|
3385
3384
|
* @property {string} [TestAddress] - The address to use for testing the renderable.
|
|
3386
3385
|
*//**
|
|
3387
3386
|
* Represents a view in the Pict ecosystem.
|
|
3388
|
-
*/var PictView=/*#__PURE__*/function(
|
|
3387
|
+
*/var PictView=/*#__PURE__*/function(_libFableServiceBase15){/**
|
|
3389
3388
|
* @param {any} pFable - The Fable object that this service is attached to.
|
|
3390
3389
|
* @param {any} [pOptions] - (optional) The options for this service.
|
|
3391
3390
|
* @param {string} [pServiceHash] - (optional) The hash of the service.
|
|
3392
|
-
*/function PictView(pFable,pOptions,pServiceHash){var
|
|
3393
|
-
var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictViewSettings)),pOptions);
|
|
3394
|
-
/** @type {any} */
|
|
3395
|
-
/** @type {import('pict') & { log: any, instantiateServiceProviderWithoutRegistration: (hash: String) => any }} */
|
|
3396
|
-
|
|
3391
|
+
*/function PictView(pFable,pOptions,pServiceHash){var _this61;_classCallCheck2(this,PictView);// Intersect default options, parent constructor, service information
|
|
3392
|
+
var tmpOptions=Object.assign({},JSON.parse(JSON.stringify(defaultPictViewSettings)),pOptions);_this61=_callSuper(this,PictView,[pFable,tmpOptions,pServiceHash]);//FIXME: add types to fable and ancillaries
|
|
3393
|
+
/** @type {any} */_this61.fable;/** @type {any} */_this61.options;/** @type {String} */_this61.UUID;/** @type {String} */_this61.Hash;/** @type {any} */_this61.log;if(!_this61.options.ViewIdentifier){_this61.options.ViewIdentifier="AutoViewID-".concat(_this61.fable.getUUID());}_this61.serviceType='PictView';/** @type {Object} */_this61._Package=libPackage;// Convenience and consistency naming
|
|
3394
|
+
/** @type {import('pict') & { log: any, instantiateServiceProviderWithoutRegistration: (hash: String) => any }} */_this61.pict=_this61.fable;// Wire in the essential Pict application state
|
|
3395
|
+
_this61.AppData=_this61.pict.AppData;/** @type {PictTimestamp} */_this61.initializeTimestamp=false;/** @type {PictTimestamp} */_this61.lastSolvedTimestamp=false;/** @type {PictTimestamp} */_this61.lastRenderedTimestamp=false;/** @type {PictTimestamp} */_this61.lastMarshalFromViewTimestamp=false;/** @type {PictTimestamp} */_this61.lastMarshalToViewTimestamp=false;// Load all templates from the array in the options
|
|
3397
3396
|
// Templates are in the form of {Hash:'Some-Template-Hash',Template:'Template content',Source:'TemplateSource'}
|
|
3398
|
-
for(var i=0;i<
|
|
3397
|
+
for(var i=0;i<_this61.options.Templates.length;i++){var tmpTemplate=_this61.options.Templates[i];if(!('Hash'in tmpTemplate)||!('Template'in tmpTemplate)){_this61.log.error("PictView [".concat(_this61.UUID,"]::[").concat(_this61.Hash,"] ").concat(_this61.options.ViewIdentifier," could not load Template ").concat(i," in the options array."),tmpTemplate);}else{if(!tmpTemplate.Source){tmpTemplate.Source="PictView [".concat(_this61.UUID,"]::[").concat(_this61.Hash,"] ").concat(_this61.options.ViewIdentifier," options object.");}_this61.pict.TemplateProvider.addTemplate(tmpTemplate.Hash,tmpTemplate.Template,tmpTemplate.Source);}}// Load all default templates from the array in the options
|
|
3399
3398
|
// Templates are in the form of {Prefix:'',Postfix:'-List-Row',Template:'Template content',Source:'TemplateSourceString'}
|
|
3400
|
-
for(var
|
|
3401
|
-
if(
|
|
3399
|
+
for(var _i51=0;_i51<_this61.options.DefaultTemplates.length;_i51++){var tmpDefaultTemplate=_this61.options.DefaultTemplates[_i51];if(!('Postfix'in tmpDefaultTemplate)||!('Template'in tmpDefaultTemplate)){_this61.log.error("PictView [".concat(_this61.UUID,"]::[").concat(_this61.Hash,"] ").concat(_this61.options.ViewIdentifier," could not load Default Template ").concat(_i51," in the options array."),tmpDefaultTemplate);}else{if(!tmpDefaultTemplate.Source){tmpDefaultTemplate.Source="PictView [".concat(_this61.UUID,"]::[").concat(_this61.Hash,"] ").concat(_this61.options.ViewIdentifier," options object.");}_this61.pict.TemplateProvider.addDefaultTemplate(tmpDefaultTemplate.Prefix,tmpDefaultTemplate.Postfix,tmpDefaultTemplate.Template,tmpDefaultTemplate.Source);}}// Load the CSS if it's available
|
|
3400
|
+
if(_this61.options.CSS){var tmpCSSHash=_this61.options.CSSHash?_this61.options.CSSHash:"View-".concat(_this61.options.ViewIdentifier);var tmpCSSProvider=_this61.options.CSSProvider?_this61.options.CSSProvider:tmpCSSHash;_this61.pict.CSSMap.addCSS(tmpCSSHash,_this61.options.CSS,tmpCSSProvider,_this61.options.CSSPriority);}// Load all renderables
|
|
3402
3401
|
// Renderables are launchable renderable instructions with templates
|
|
3403
3402
|
// They look as such: {Identifier:'ContentEntry', TemplateHash:'Content-Entry-Section-Main', ContentDestinationAddress:'#ContentSection', RecordAddress:'AppData.Content.DefaultText', ManifestTransformation:'ManyfestHash', ManifestDestinationAddress:'AppData.Content.DataToTransformContent'}
|
|
3404
3403
|
// The only parts that are necessary are Identifier and Template
|
|
3405
3404
|
// A developer can then do render('ContentEntry') and it just kinda works. Or they can override the ContentDestinationAddress
|
|
3406
|
-
/** @type {Object<String, Renderable>} */
|
|
3405
|
+
/** @type {Object<String, Renderable>} */_this61.renderables={};for(var _i52=0;_i52<_this61.options.Renderables.length;_i52++){/** @type {Renderable} */var tmpRenderable=_this61.options.Renderables[_i52];_this61.addRenderable(tmpRenderable);}return _this61;}/**
|
|
3407
3406
|
* Adds a renderable to the view.
|
|
3408
3407
|
*
|
|
3409
3408
|
* @param {string | Renderable} pRenderableHash - The hash of the renderable, or a renderable object.
|
|
@@ -3411,7 +3410,7 @@ if(_this63.options.CSS){var tmpCSSHash=_this63.options.CSSHash?_this63.options.C
|
|
|
3411
3410
|
* @param {string} [pDefaultTemplateRecordAddress] - (optional) The default data address for the template.
|
|
3412
3411
|
* @param {string} [pDefaultDestinationAddress] - (optional) The default destination address for the renderable.
|
|
3413
3412
|
* @param {RenderMethod} [pRenderMethod=replace] - (optional) The method to use when rendering the renderable (ex. 'replace').
|
|
3414
|
-
*/_inherits(PictView,
|
|
3413
|
+
*/_inherits(PictView,_libFableServiceBase15);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.
|
|
3415
3414
|
// Use theirs instead!
|
|
3416
3415
|
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 *//* -------------------------------------------------------------------------- *//**
|
|
3417
3416
|
* Lifecycle hook that triggers before the view is initialized.
|
|
@@ -3431,7 +3430,7 @@ tmpRenderable=pRenderableHash;}else{/** @type {RenderMethod} */var tmpRenderMeth
|
|
|
3431
3430
|
* Performs view initialization (async flow).
|
|
3432
3431
|
*
|
|
3433
3432
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3434
|
-
*/},{key:"initializeAsync",value:function initializeAsync(fCallback){var
|
|
3433
|
+
*/},{key:"initializeAsync",value:function initializeAsync(fCallback){var _this62=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){_this62.log.error("PictView [".concat(_this62.UUID,"]::[").concat(_this62.Hash,"] ").concat(_this62.options.ViewIdentifier," initialization failed: ").concat(pError.message||pError),{stack:pError.stack});}_this62.initializeTimestamp=_this62.pict.log.getTimeStamp();if(_this62.pict.LogNoisiness>0){_this62.log.info("PictView [".concat(_this62.UUID,"]::[").concat(_this62.Hash,"] ").concat(_this62.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?
|
|
3435
3434
|
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;}/**
|
|
3436
3435
|
* Lifecycle hook that triggers after the view is initialized (async flow).
|
|
3437
3436
|
*
|
|
@@ -3485,10 +3484,10 @@ this.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord,tmpConten
|
|
|
3485
3484
|
* @param {ErrorCallback} [fCallback] - The callback to call when the async operation is complete.
|
|
3486
3485
|
*
|
|
3487
3486
|
* @return {void}
|
|
3488
|
-
*/},{key:"renderAsync",value:function renderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var
|
|
3489
|
-
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){
|
|
3490
|
-
|
|
3491
|
-
|
|
3487
|
+
*/},{key:"renderAsync",value:function renderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var _this63=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
|
|
3488
|
+
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){_this63.log.error("PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.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){_this63.onBeforeRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord);_this63.onBeforeRenderAsync(fOnBeforeRenderCallback);});var tmpContent;tmpAnticipate.anticipate(function(fAsyncTemplateCallback){// Render the template (asynchronously)
|
|
3489
|
+
_this63.pict.parseTemplateByHash(tmpRenderable.TemplateHash,tmpRecord,function(pError,pContent){if(pError){_this63.log.error("PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.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(_this63.pict.LogNoisiness>0){_this63.log.trace("PictView [".concat(_this63.UUID,"]::[").concat(_this63.Hash,"] ").concat(_this63.options.ViewIdentifier," Assigning Renderable[").concat(tmpRenderableHash,"] content length ").concat(pContent.length," to Destination [").concat(tmpRenderDestinationAddress,"] using Async render method ").concat(tmpRenderable.RenderMethod,"."));}_this63.pict.ContentAssignment.projectContent(tmpRenderable.RenderMethod,tmpRenderDestinationAddress,pContent,tmpRenderable.TestAddress);// Execute the developer-overridable asynchronous post-render behavior
|
|
3490
|
+
_this63.lastRenderedTimestamp=_this63.pict.log.getTimeStamp();return fAsyncTemplateCallback();},[_this63]);});tmpAnticipate.anticipate(function(fOnAfterRenderCallback){_this63.onAfterRender(tmpRenderable,tmpRenderDestinationAddress,tmpRecord,tmpContent);_this63.onAfterRenderAsync(fOnAfterRenderCallback);});tmpAnticipate.wait(tmpCallback);}/**
|
|
3492
3491
|
* Renders the default renderable.
|
|
3493
3492
|
*
|
|
3494
3493
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
@@ -3502,8 +3501,8 @@ this.renderAsync(fCallback);}/**
|
|
|
3502
3501
|
* @param {string|ErrorCallback} [pRenderDestinationAddress] - The address where the renderable will be rendered.
|
|
3503
3502
|
* @param {string|object|ErrorCallback} [pTemplateRecordAddress] - The address of (or actual obejct) where the data for the template is stored.
|
|
3504
3503
|
* @param {ErrorCallback} [fCallback] - The callback to call when the async operation is complete.
|
|
3505
|
-
*/},{key:"basicRenderAsync",value:function basicRenderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var
|
|
3506
|
-
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){
|
|
3504
|
+
*/},{key:"basicRenderAsync",value:function basicRenderAsync(pRenderableHash,pRenderDestinationAddress,pTemplateRecordAddress,fCallback){var _this64=this;// Allow the callback to be passed in as the last parameter no matter what
|
|
3505
|
+
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){_this64.log.error("PictView [".concat(_this64.UUID,"]::[").concat(_this64.Hash,"] ").concat(_this64.options.ViewIdentifier," could not render (asynchronously) ").concat(tmpRenderOptions.RenderableHash," because it did not parse the template."),pError);return tmpCallback(pError);}_this64.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);}}/**
|
|
3507
3506
|
* Lifecycle hook that triggers after the view is rendered.
|
|
3508
3507
|
*
|
|
3509
3508
|
* @param {Renderable} pRenderable - The renderable that was rendered.
|
|
@@ -3534,7 +3533,7 @@ var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAd
|
|
|
3534
3533
|
* Performs view solving and triggers lifecycle hooks (async flow).
|
|
3535
3534
|
*
|
|
3536
3535
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3537
|
-
*/},{key:"solveAsync",value:function solveAsync(fCallback){var
|
|
3536
|
+
*/},{key:"solveAsync",value:function solveAsync(fCallback){var _this65=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){_this65.log.error("PictView [".concat(_this65.UUID,"]::[").concat(_this65.Hash,"] ").concat(_this65.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(_this65.pict.LogNoisiness>2){_this65.log.trace("PictView [".concat(_this65.UUID,"]::[").concat(_this65.Hash,"] ").concat(_this65.options.ViewIdentifier," solveAsync() complete."));}_this65.lastSolvedTimestamp=_this65.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3538
3537
|
* Lifecycle hook that triggers after the view is solved.
|
|
3539
3538
|
*/},{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;}/**
|
|
3540
3539
|
* Lifecycle hook that triggers after the view is solved (async flow).
|
|
@@ -3562,7 +3561,7 @@ var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAd
|
|
|
3562
3561
|
* Marshals data from the view (async flow).
|
|
3563
3562
|
*
|
|
3564
3563
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3565
|
-
*/},{key:"marshalFromViewAsync",value:function marshalFromViewAsync(fCallback){var
|
|
3564
|
+
*/},{key:"marshalFromViewAsync",value:function marshalFromViewAsync(fCallback){var _this66=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){_this66.log.error("PictView [".concat(_this66.UUID,"]::[").concat(_this66.Hash,"] ").concat(_this66.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(_this66.pict.LogNoisiness>2){_this66.log.trace("PictView [".concat(_this66.UUID,"]::[").concat(_this66.Hash,"] ").concat(_this66.options.ViewIdentifier," marshalFromViewAsync() complete."));}_this66.lastMarshalFromViewTimestamp=_this66.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3566
3565
|
* Lifecycle hook that triggers after data is marshaled from the view.
|
|
3567
3566
|
*/},{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;}/**
|
|
3568
3567
|
* Lifecycle hook that triggers after data is marshaled from the view (async flow).
|
|
@@ -3588,13 +3587,13 @@ var tmpCallback=typeof fCallback==='function'?fCallback:typeof pTemplateRecordAd
|
|
|
3588
3587
|
* Marshals data into the view (async flow).
|
|
3589
3588
|
*
|
|
3590
3589
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3591
|
-
*/},{key:"marshalToViewAsync",value:function marshalToViewAsync(fCallback){var
|
|
3590
|
+
*/},{key:"marshalToViewAsync",value:function marshalToViewAsync(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," 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){_this67.log.error("PictView [".concat(_this67.UUID,"]::[").concat(_this67.Hash,"] ").concat(_this67.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(_this67.pict.LogNoisiness>2){_this67.log.trace("PictView [".concat(_this67.UUID,"]::[").concat(_this67.Hash,"] ").concat(_this67.options.ViewIdentifier," marshalToViewAsync() complete."));}_this67.lastMarshalToViewTimestamp=_this67.pict.log.getTimeStamp();return tmpCallback(pError);});}/**
|
|
3592
3591
|
* Lifecycle hook that triggers after data is marshaled into the view.
|
|
3593
3592
|
*/},{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;}/**
|
|
3594
3593
|
* Lifecycle hook that triggers after data is marshaled into the view (async flow).
|
|
3595
3594
|
*
|
|
3596
3595
|
* @param {ErrorCallback} fCallback - The callback to call when the async operation is complete.
|
|
3597
|
-
*/},{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":142,"fable-serviceproviderbase":
|
|
3596
|
+
*/},{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":142,"fable-serviceproviderbase":58}],144:[function(require,module,exports){/**
|
|
3598
3597
|
* Precedent Meta-Templating
|
|
3599
3598
|
*
|
|
3600
3599
|
* @license MIT
|
|
@@ -3697,7 +3696,7 @@ this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserS
|
|
|
3697
3696
|
* @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.
|
|
3698
3697
|
* @return {bool} True if adding the pattern was successful
|
|
3699
3698
|
*/},{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
|
|
3700
|
-
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
|
|
3699
|
+
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 _i53=0;_i53<tmpPatternEnd.length;_i53++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i53],_i53);}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;},{}],147:[function(require,module,exports){// shim for using process in browser
|
|
3701
3700
|
var process=module.exports={};// cached from whatever global is present so that test runners that stub it
|
|
3702
3701
|
// don't break things. But we need to wrap it in a try catch in case it is
|
|
3703
3702
|
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
@@ -3969,13 +3968,13 @@ key:key,next:objects.next,value:value};}};/** @type {import('./list.d.ts').listH
|
|
|
3969
3968
|
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
|
|
3970
3969
|
$o={next:void undefined};}// eslint-disable-next-line no-extra-parens
|
|
3971
3970
|
listSet(/** @type {NonNullable<typeof $o>} */$o,key,value);}};// @ts-expect-error TODO: figure out why this is erroring
|
|
3972
|
-
return channel;};},{"es-errors/type":
|
|
3971
|
+
return channel;};},{"es-errors/type":46,"object-inspect":133}],159:[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
|
|
3973
3972
|
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
|
|
3974
3973
|
$m=new $Map();}$mapSet($m,key,value);}};// @ts-expect-error TODO: figure out why TS is erroring here
|
|
3975
|
-
return channel;};},{"call-bound":30,"es-errors/type":
|
|
3974
|
+
return channel;};},{"call-bound":30,"es-errors/type":46,"get-intrinsic":101,"object-inspect":133}],160:[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
|
|
3976
3975
|
/** @type {NonNullable<typeof $m>} */$m.set(key,value);}}};// @ts-expect-error TODO: figure out why this is erroring
|
|
3977
|
-
return channel;}:getSideChannelMap;},{"call-bound":30,"es-errors/type":
|
|
3978
|
-
return channel;};},{"es-errors/type":
|
|
3976
|
+
return channel;}:getSideChannelMap;},{"call-bound":30,"es-errors/type":46,"get-intrinsic":101,"object-inspect":133,"side-channel-map":159}],161:[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
|
|
3977
|
+
return channel;};},{"es-errors/type":46,"object-inspect":133,"side-channel-list":158,"side-channel-map":159,"side-channel-weakmap":160}],162:[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}],163:[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
|
|
3979
3978
|
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
|
|
3980
3979
|
delete opts.url;if(!hostname&&!port&&!_protocol&&!auth)opts.path=path;// Relative redirect
|
|
3981
3980
|
else Object.assign(opts,{hostname:hostname,port:port,protocol:_protocol,auth:auth,path:path});// Absolute redirect
|
|
@@ -4359,7 +4358,7 @@ if(state.decoder)ret=state.buffer.join('');else if(state.buffer.length===1)ret=s
|
|
|
4359
4358
|
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.
|
|
4360
4359
|
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
|
|
4361
4360
|
// if the writable side is ready for autoDestroy as well
|
|
4362
|
-
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":168,"./_stream_duplex":169,"./internal/streams/async_iterator":174,"./internal/streams/buffer_list":175,"./internal/streams/destroy":176,"./internal/streams/from":178,"./internal/streams/state":180,"./internal/streams/stream":181,"_process":147,"buffer":20,"events":
|
|
4361
|
+
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":168,"./_stream_duplex":169,"./internal/streams/async_iterator":174,"./internal/streams/buffer_list":175,"./internal/streams/destroy":176,"./internal/streams/from":178,"./internal/streams/state":180,"./internal/streams/stream":181,"_process":147,"buffer":20,"events":49,"inherits":112,"string_decoder/":183,"util":18}],172:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
4363
4362
|
//
|
|
4364
4363
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
4365
4364
|
// copy of this software and associated documentation files (the
|
|
@@ -4628,7 +4627,7 @@ stream.on('end',onlegacyfinish);stream.on('close',onlegacyfinish);}stream.on('en
|
|
|
4628
4627
|
'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
|
|
4629
4628
|
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
|
|
4630
4629
|
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":168,"./end-of-stream":177}],180:[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
|
|
4631
|
-
return state.objectMode?16:16*1024;}module.exports={getHighWaterMark:getHighWaterMark};},{"../../../errors":168}],181:[function(require,module,exports){module.exports=require('events').EventEmitter;},{"events":
|
|
4630
|
+
return state.objectMode?16:16*1024;}module.exports={getHighWaterMark:getHighWaterMark};},{"../../../errors":168}],181:[function(require,module,exports){module.exports=require('events').EventEmitter;},{"events":49}],182:[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":169,"./lib/_stream_passthrough.js":170,"./lib/_stream_readable.js":171,"./lib/_stream_transform.js":172,"./lib/_stream_writable.js":173,"./lib/internal/streams/end-of-stream.js":177,"./lib/internal/streams/pipeline.js":179}],183:[function(require,module,exports){// Copyright Joyent, Inc. and other Node contributors.
|
|
4632
4631
|
//
|
|
4633
4632
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
4634
4633
|
// copy of this software and associated documentation files (the
|
|
@@ -4896,7 +4895,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
4896
4895
|
// presumably different callback function.
|
|
4897
4896
|
// This makes sure that own properties are retained, so that
|
|
4898
4897
|
// decorations and such are not lost along the way.
|
|
4899
|
-
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;}}},{}],188:[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;}},{}],189:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.
|
|
4898
|
+
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;}}},{}],188:[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;}},{}],189:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.249","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.26.0","@types/jquery":"^3.5.32","eslint":"^9.26.0","globals":"^16.1.0","quackage":"^1.0.41"},"dependencies":{"cachetrax":"^1.0.4","fable":"^3.1.8","pict-application":"^1.0.25","pict-provider":"^1.0.3","pict-template":"^1.0.10","pict-view":"^1.0.60","typescript":"^5.8.3"}};},{}],190:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
|
|
4900
4899
|
/* global Pict, _Pict: writeable *//**
|
|
4901
4900
|
* Simple function to load a pict Application
|
|
4902
4901
|
*
|
|
@@ -4911,64 +4910,64 @@ if(pPictApplication&&_typeof(pPictApplication['default_configuration'])==='objec
|
|
|
4911
4910
|
if(document.readyState!='loading')fCallback();// Modern browsers have event listener capabilities
|
|
4912
4911
|
else if(document.addEventListener)document.addEventListener('DOMContentLoaded',function(){fCallback();});//@ts-ignore IE <= 8 and ... other abominations
|
|
4913
4912
|
else document.attachEvent('onreadystatechange',function(){if(document.readyState=='complete')fCallback();});};},{}],192:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var defaultConfiguration={// This is the address for the <script /> tag that contains the CSS.
|
|
4914
|
-
CSSElementAddress:'#PICT-CSS'};var PictCSS=/*#__PURE__*/function(
|
|
4915
|
-
if(typeof
|
|
4913
|
+
CSSElementAddress:'#PICT-CSS'};var PictCSS=/*#__PURE__*/function(_libFableServiceBase16){function PictCSS(pFable,pOptions,pServiceHash){var _this68;_classCallCheck2(this,PictCSS);_this68=_callSuper(this,PictCSS,[pFable,pOptions,pServiceHash]);/** @type {any} */_this68.options;/** @type {{ ContentAssignment: import('./Pict-Content-Assignment') }} */_this68.services;// No merging of options necessary
|
|
4914
|
+
if(typeof _this68.options.CSSElementAddress==='undefined'){_this68.options.CSSElementAddress=defaultConfiguration.CSSElementAddress;}_this68.inlineCSSMap={};return _this68;}// Add a CSS fragment to the CSS map (each view can have its own CSS fragment)
|
|
4916
4915
|
// Hash is shared across all views, so if 10 views all load the "My-Table-View" fragment, it will only be loaded once.
|
|
4917
|
-
_inherits(PictCSS,
|
|
4918
|
-
tmpCSSHashes.sort(function(a,b){return
|
|
4916
|
+
_inherits(PictCSS,_libFableServiceBase16);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 _this69=this;var tmpCSS='';var tmpCSSHashes=Object.keys(this.inlineCSSMap);// Sort the hashes by Priority
|
|
4917
|
+
tmpCSSHashes.sort(function(a,b){return _this69.inlineCSSMap[a].Priority-_this69.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
|
|
4919
4918
|
},{key:"injectCSS",value:function injectCSS(){this.services.ContentAssignment.assignContent(this.options.CSSElementAddress,this.generateCSS());}}]);}(libFableServiceBase);module.exports=PictCSS;},{"fable":68}],193:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;/**
|
|
4920
4919
|
* Class for moving content around in the DOM.
|
|
4921
|
-
*/var PictContentAssignment=/*#__PURE__*/function(
|
|
4920
|
+
*/var PictContentAssignment=/*#__PURE__*/function(_libFableServiceBase17){/**
|
|
4922
4921
|
* @param {import('fable')} pFable - The Fable library instance.
|
|
4923
4922
|
* @param {any} [pOptions] - The options for the service.
|
|
4924
4923
|
* @param {string} [pServiceHash] - The hash of services.
|
|
4925
|
-
*/function PictContentAssignment(pFable,pOptions,pServiceHash){var
|
|
4926
|
-
|
|
4927
|
-
if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){
|
|
4928
|
-
|
|
4924
|
+
*/function PictContentAssignment(pFable,pOptions,pServiceHash){var _this70;_classCallCheck2(this,PictContentAssignment);_this70=_callSuper(this,PictContentAssignment,[pFable,pOptions,pServiceHash]);/** @type {any} */_this70.log;/** @type {any} */_this70.fable;_this70.serviceType='PictContentAssignment';_this70.manifest=pFable.newManyfest();// Check to see if we are running in a browser
|
|
4925
|
+
_this70.inBrowser=false;_this70.hasDocument=false;if((typeof window==="undefined"?"undefined":_typeof(window))=='object'){_this70.inBrowser=true;// Now check that the browser has a document object
|
|
4926
|
+
if(typeof window.document!='undefined'&&typeof window.document.querySelectorAll=='function'){_this70.hasDocument=true;}}// If we're in a browser, check to see if jQuery is available.
|
|
4927
|
+
_this70.hasJquery=false;_this70.jQuery=false;if(_this70.inBrowser&&typeof window.jQuery!=='undefined'){_this70.hasJquery=true;}/**
|
|
4929
4928
|
* Set this to override the default mechanism for setting the content of a DOM element.
|
|
4930
4929
|
*
|
|
4931
4930
|
* @type {Function}
|
|
4932
4931
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4933
4932
|
* @param {string} pContent - The content to set.
|
|
4934
|
-
*/
|
|
4933
|
+
*/_this70.customAssignFunction=null;/**
|
|
4935
4934
|
* Set this to override the default mechanism for prepend content to a DOM element.
|
|
4936
4935
|
*
|
|
4937
4936
|
* @type {Function}
|
|
4938
4937
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4939
4938
|
* @param {string} pContent - The content to prepend.
|
|
4940
|
-
*/
|
|
4939
|
+
*/_this70.customPrependFunction=null;/**
|
|
4941
4940
|
* Set this to override the default mechanism for appending content to a DOM element.
|
|
4942
4941
|
*
|
|
4943
4942
|
* @type {Function}
|
|
4944
4943
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4945
4944
|
* @param {string} pContent - The content to append.
|
|
4946
|
-
*/
|
|
4945
|
+
*/_this70.customAppendFunction=null;/**
|
|
4947
4946
|
* Set this to override the default mechanism for reading content from the DOM.
|
|
4948
4947
|
*
|
|
4949
4948
|
* @type {Function}
|
|
4950
4949
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4951
4950
|
* @return {string} - The content of the element.
|
|
4952
|
-
*/
|
|
4951
|
+
*/_this70.customReadFunction=null;/**
|
|
4953
4952
|
* Set this to override the default mechanism for getting elements.
|
|
4954
4953
|
*
|
|
4955
4954
|
* @type {Function}
|
|
4956
4955
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4957
4956
|
* @return {Array<any>} - The matched elements.
|
|
4958
|
-
*/
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4957
|
+
*/_this70.customGetElementFunction=null;// API Consumers can also craft their own attribute read function
|
|
4958
|
+
_this70.customReadAttributeFunction=null;// API Consumers can also craft their own attribute set function
|
|
4959
|
+
_this70.customSetAttributeFunction=null;// API Consumers can also craft their own attribute remove function
|
|
4960
|
+
_this70.customRemoveAttributeFunction=null;// API Consumers can also craft their own class read function
|
|
4961
|
+
_this70.customReadClassFunction=null;// API Consumers can also craft their own class set function
|
|
4962
|
+
_this70.customSetClassFunction=null;// API Consumers can also craft their own class remove function
|
|
4963
|
+
_this70.customRemoveClassFunction=null;return _this70;}/**
|
|
4965
4964
|
* Get an element from the DOM.
|
|
4966
4965
|
*
|
|
4967
4966
|
* @param {string} pAddress - The address of the element.
|
|
4968
4967
|
* @return {Array<any>} - The matched elements.
|
|
4969
|
-
*/_inherits(PictContentAssignment,
|
|
4968
|
+
*/_inherits(PictContentAssignment,_libFableServiceBase17);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.
|
|
4970
4969
|
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
|
|
4971
|
-
var _tmpElements=window.document.querySelectorAll(pAddress);var _tmpElementSet=[];for(var
|
|
4970
|
+
var _tmpElements=window.document.querySelectorAll(pAddress);var _tmpElementSet=[];for(var _i54=0;_i54<_tmpElements.length;_i54++){_tmpElementSet.push(_tmpElements[_i54]);}return _tmpElementSet;}else{// Just log it out for now
|
|
4972
4971
|
this.log.trace("PICT Content GET ELEMENT for [".concat(pAddress,"] will return empty because none of the browser methods are available"));return[];}}/**
|
|
4973
4972
|
* @param {string|HTMLElement} pAddress - The address of the element (a CSS selector), or the element itself.
|
|
4974
4973
|
* @param {string|boolean} pContent - The content to assign.
|
|
@@ -4976,7 +4975,7 @@ this.log.trace("PICT Content GET ELEMENT for [".concat(pAddress,"] will return e
|
|
|
4976
4975
|
*/},{key:"assignContent",value:function assignContent(pAddress,pContent){if(this.customAssignFunction){return this.customAssignFunction(pAddress,pContent);}else if(this.hasJquery){// Get the element(s)
|
|
4977
4976
|
//FIXME: this is silly, but it makes the type system happy - it picks a different overload for each case
|
|
4978
4977
|
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)
|
|
4979
|
-
var _tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var
|
|
4978
|
+
var _tmpTargetElementSet=typeof pAddress==='string'?window.document.querySelectorAll(pAddress):[pAddress];for(var _i55=0;_i55<_tmpTargetElementSet.length;_i55++){var _tmpElement=_tmpTargetElementSet[_i55];switch(_tmpTargetElementSet[_i55].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
|
|
4980
4979
|
this.log.trace("PICT Content ASSIGN to [".concat(pAddress,"]:"),pContent);}}/**
|
|
4981
4980
|
* Append content to an element.
|
|
4982
4981
|
*
|
|
@@ -5057,49 +5056,49 @@ var tmpTargetElement=typeof pAddress==='string'?window.jQuery(pAddress):window.j
|
|
|
5057
5056
|
*
|
|
5058
5057
|
* @return {boolean} - Whether the element has the class. If multiple elements are matched, returns true if any have the class.
|
|
5059
5058
|
*/},{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
|
|
5060
|
-
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}],194:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(
|
|
5059
|
+
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}],194:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictDataProvider=/*#__PURE__*/function(_libFableServiceBase18){function PictDataProvider(pFable,pOptions,pServiceHash){var _this71;_classCallCheck2(this,PictDataProvider);_this71=_callSuper(this,PictDataProvider,[pFable,pOptions,pServiceHash]);/** @type {import('fable') & import('pict')} */_this71.fable;_this71.serviceType='PictDataProvider';return _this71;}/**
|
|
5061
5060
|
* @param {string} pAddress - The address of the data to retrieve
|
|
5062
5061
|
* @param {object} [pData] - (optional) The record to provide to the address resolver
|
|
5063
|
-
*/_inherits(PictDataProvider,
|
|
5064
|
-
|
|
5062
|
+
*/_inherits(PictDataProvider,_libFableServiceBase18);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}],195:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictMeadowEntityProvider=/*#__PURE__*/function(_libFableServiceBase19){function PictMeadowEntityProvider(pFable,pOptions,pServiceHash){var _this72$fable$RestCli;var _this72;_classCallCheck2(this,PictMeadowEntityProvider);_this72=_callSuper(this,PictMeadowEntityProvider,[pFable,pOptions,pServiceHash]);/** @type {any} */_this72.options;/** @type {import('pict') & { settings: any } & { newAnticipate: any }} */_this72.fable;/** @type {any} */_this72.log;_this72.serviceType='PictMeadowProvider';if(_this72.fable.settings.PictDefaultURLPrefix){_this72.options.urlPrefix=_this72.fable.settings.PictDefaultURLPrefix;}else if(!_this72.options.urlPrefix){_this72.options.urlPrefix='/1.0/';}if(_this72.fable.settings.PictDefaultDownloadBatchSize){_this72.options.downloadBatchSize=_this72.fable.settings.PictDefaultDownloadBatchSize;}else if(!_this72.options.downloadBatchSize){_this72.options.downloadBatchSize=100;}//@ts-ignore - FIXME - remove once we have fable types
|
|
5063
|
+
_this72.restClient=(_this72$fable$RestCli=_this72.fable.RestClient)!==null&&_this72$fable$RestCli!==void 0?_this72$fable$RestCli:_this72.fable.instantiateServiceProviderWithoutRegistration('RestClient');_this72.cache={};_this72.prepareRequestOptions=function(pOptions){return pOptions;};return _this72;}_inherits(PictMeadowEntityProvider,_libFableServiceBase19);return _createClass2(PictMeadowEntityProvider,[{key:"initializeCache",value:function initializeCache(pEntity){// This should not be happening as often as it's happening.
|
|
5065
5064
|
if(!(pEntity in this.cache)){//@ts-ignore - FIXME - remove once we have fable types
|
|
5066
5065
|
this.cache[pEntity]=this.fable.instantiateServiceProviderWithoutRegistration('ObjectCache');// TODO: Make this a configuration?
|
|
5067
5066
|
// For now cache for 30 seconds.
|
|
5068
|
-
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
|
|
5067
|
+
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 _this73=this;// First sanity check the pEntityInformation
|
|
5069
5068
|
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
|
|
5070
5069
|
var tmpFilterString=this.fable.parseTemplate(pEntityInformation.Filter,pEntityInformation.FilterData);// Create a callback function to handle receiving the record set
|
|
5071
|
-
var fRecordFetchComplete=function fRecordFetchComplete(pError,pRecordSet){if(pError){
|
|
5072
|
-
if(pEntityInformation.SingleRecord){if(pRecordSet.length>1){
|
|
5070
|
+
var fRecordFetchComplete=function fRecordFetchComplete(pError,pRecordSet){if(pError){_this73.log.error("EntityBundleRequest request Error getting entity set for [".concat(pEntityInformation.Entity,"] with filter [").concat(tmpFilterString,"]: ").concat(pError),pError);return fCallback(pError,'');}_this73.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).
|
|
5071
|
+
if(pEntityInformation.SingleRecord){if(pRecordSet.length>1){_this73.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){_this73.fable.manifest.setValueByHash(_this73.fable,pEntityInformation.Destination,false);}_this73.fable.manifest.setValueByHash(_this73.fable,pEntityInformation.Destination,pRecordSet[0]);}else{_this73.fable.manifest.setValueByHash(_this73.fable,pEntityInformation.Destination,pRecordSet);}return fCallback();};if(tmpRecordCount){this.getEntitySetPage(pEntityInformation.Entity,tmpFilterString,tmpRecordStartCursor,tmpRecordCount,fRecordFetchComplete);}else{this.getEntitySet(pEntityInformation.Entity,tmpFilterString,fRecordFetchComplete);}}/**
|
|
5073
5072
|
* Gather data from the server returning a promise when it is complete.
|
|
5074
5073
|
*
|
|
5075
5074
|
* @param {Object} pEntitiesBundleDescription - The entity bundle description object.
|
|
5076
5075
|
*
|
|
5077
5076
|
* @return {Promise<any>} - Returns a promise that resolves when the data has been gathered.
|
|
5078
|
-
*/},{key:"gatherDataFromServer",value:function gatherDataFromServer(pEntitiesBundleDescription,fCallback){var
|
|
5079
|
-
if(pError){
|
|
5080
|
-
this.cache[pEntity].prune(function(){var
|
|
5077
|
+
*/},{key:"gatherDataFromServer",value:function gatherDataFromServer(pEntitiesBundleDescription,fCallback){var _this74=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{return _this74.gatherEntitySet(tmpEntityBundleEntry,fNext);}catch(pError){_this74.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
|
|
5078
|
+
if(pError){_this74.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.
|
|
5079
|
+
this.cache[pEntity].prune(function(){var _this75=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){_this75.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?
|
|
5081
5080
|
// FBL~ID${pDestinationEntity}~INN~${tmpIDRecordsCommaSeparated}
|
|
5082
5081
|
// If the list is mega-long we can parse it and break it into chunks.
|
|
5083
5082
|
this.initializeCache(pEntity);// Discard anything from the cache that has expired or is over size.
|
|
5084
|
-
this.cache[pEntity].prune(function(){var
|
|
5085
|
-
tmpDownloadURIFragments.push("".concat(
|
|
5086
|
-
|
|
5087
|
-
return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){return fCallback(pFullDownloadError,tmpEntitySet);});});}.bind(this));}}]);}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":68}],196:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(
|
|
5083
|
+
this.cache[pEntity].prune(function(){var _this76=this;return this.getEntitySetRecordCount(pEntity,pMeadowFilterExpression,function(pRecordCountError,pRecordCount){if(pRecordCountError){return fCallback(pRecordCountError);}var tmpRecordCount=pRecordCount;if(isNaN(pRecordCount)){_this76.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=_this76.options.downloadBatchSize;for(var i=0;i<tmpRecordCount/tmpDownloadBatchSize;i++){// Generate each of the URI fragments to download
|
|
5084
|
+
tmpDownloadURIFragments.push("".concat(_this76.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)
|
|
5085
|
+
_this76.fable.Utility.eachLimit(tmpDownloadURIFragments,1,function(pURIFragment,fDownloadCallback){_this76.restClient.getJSON(pURIFragment,function(pDownloadError,pDownloadResponse,pDownloadBody){tmpEntitySet=tmpEntitySet.concat(pDownloadBody);// Should we be caching each record?
|
|
5086
|
+
return fDownloadCallback(pDownloadError);});},function(pFullDownloadError){return fCallback(pFullDownloadError,tmpEntitySet);});});}.bind(this));}}]);}(libFableServiceBase);module.exports=PictMeadowEntityProvider;},{"fable":68}],196:[function(require,module,exports){var libFableServiceBase=require('fable').ServiceProviderBase;var PictTemplateProvider=/*#__PURE__*/function(_libFableServiceBase20){/**
|
|
5088
5087
|
* @param {Object} pFable - The Fable Framework instance
|
|
5089
5088
|
* @param {Object} pOptions - The options for the service
|
|
5090
5089
|
* @param {String} pServiceHash - The hash of the service
|
|
5091
|
-
*/function PictTemplateProvider(pFable,pOptions,pServiceHash){var
|
|
5090
|
+
*/function PictTemplateProvider(pFable,pOptions,pServiceHash){var _this77;_classCallCheck2(this,PictTemplateProvider);_this77=_callSuper(this,PictTemplateProvider,[pFable,pOptions,pServiceHash]);/** @type {any} */_this77.log;/** @type {string} */_this77.UUID;/** @type {string} */_this77.Hash;_this77.serviceType='PictTemplateProvider';_this77.templates={};_this77.templateSources={};// Default templates are stored by prefix.
|
|
5092
5091
|
// The longest prefix match is used.
|
|
5093
5092
|
// Case sensitive.
|
|
5094
|
-
|
|
5093
|
+
_this77.defaultTemplates=[];/**
|
|
5095
5094
|
* @type {(hash?: string) => { template: string, source: string }?} loadTemplateFunction - The function to load a template
|
|
5096
|
-
*/
|
|
5095
|
+
*/_this77.loadTemplateFunction=function(){return null;};return _this77;}/**
|
|
5097
5096
|
* Add a template to the provider.
|
|
5098
5097
|
*
|
|
5099
5098
|
* @param {String} pTemplateHash - The hash of the template
|
|
5100
5099
|
* @param {String} pTemplate - The template
|
|
5101
5100
|
* @param {String} [pTemplateSource] - (optional) The source of the template
|
|
5102
|
-
*/_inherits(PictTemplateProvider,
|
|
5101
|
+
*/_inherits(PictTemplateProvider,_libFableServiceBase20);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,"]");}}/**
|
|
5103
5102
|
* Add a default template to the provider.
|
|
5104
5103
|
*
|
|
5105
5104
|
* @param {String} pPrefix - The prefix of the template identifier.
|
|
@@ -5156,35 +5155,35 @@ if(!(pTemplateHash in this.templates)){this.checkDefaultTemplateHash(pTemplateHa
|
|
|
5156
5155
|
* Pict management object.
|
|
5157
5156
|
*/var Pict=/*#__PURE__*/function(_libFable){/**
|
|
5158
5157
|
* @param {Object<String, any>} pSettings - The settings for the Pict instance.
|
|
5159
|
-
*/function Pict(pSettings){var
|
|
5160
|
-
/** @type {any} */
|
|
5161
|
-
|
|
5158
|
+
*/function Pict(pSettings){var _this78;_classCallCheck2(this,Pict);_this78=_callSuper(this,Pict,[pSettings]);/** @type {any} */_this78.settings;_this78.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");/** @type {Object} */_this78._PackageFable=_this78._Package;_this78._Package=libPackage;_this78.browserAddress="window._Pict";if("BrowserAddress"in _this78.settings){_this78.browserAddress=_this78.settings.BrowserAddress;}_this78.children=[];/** @type {import('pict-application')} */_this78.PictApplication=null;// shim types from fable until we export types properly
|
|
5159
|
+
/** @type {any} */_this78.log;//NOTE: This needs to come before any other providers which may instantiate a rest client so we don't proliferate them
|
|
5160
|
+
_this78.instantiateServiceProvider("RestClient");/**
|
|
5162
5161
|
* The templateProvider provides a basic key->template mapping with default fallback capabilities
|
|
5163
5162
|
*
|
|
5164
5163
|
* @type {PictTemplateProvider}
|
|
5165
|
-
*/
|
|
5164
|
+
*/_this78.TemplateProvider=null;_this78.addAndInstantiateServiceType("TemplateProvider",PictTemplateProvider);/**
|
|
5166
5165
|
* The meadow entity provider.
|
|
5167
5166
|
*
|
|
5168
5167
|
* @type {PictMeadowEntityProvider}
|
|
5169
|
-
*/
|
|
5168
|
+
*/_this78.EntityProvider=null;_this78.addAndInstantiateServiceType("EntityProvider",PictMeadowEntityProvider);/**
|
|
5170
5169
|
* The data provider.
|
|
5171
5170
|
*
|
|
5172
5171
|
* @type {PictDataProvider}
|
|
5173
|
-
*/
|
|
5172
|
+
*/_this78.DataProvider=null;_this78.addAndInstantiateServiceType("DataProvider",PictDataProvider);/**
|
|
5174
5173
|
* The content assignment module.
|
|
5175
5174
|
*
|
|
5176
5175
|
* @type {PictContentAssignment}
|
|
5177
|
-
*/
|
|
5176
|
+
*/_this78.ContentAssignment=null;_this78.addAndInstantiateServiceType("ContentAssignment",PictContentAssignment);/**
|
|
5178
5177
|
* The CSS module.
|
|
5179
5178
|
*
|
|
5180
5179
|
* @type {PictCSS}
|
|
5181
5180
|
* @public
|
|
5182
|
-
*/
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
if(
|
|
5187
|
-
|
|
5181
|
+
*/_this78.CSSMap=null;_this78.addAndInstantiateServiceType("CSSMap",PictCSS);_this78.addServiceType("PictTemplate",require("pict-template"));_this78.instantiateServiceProvider("MetaTemplate");_this78.instantiateServiceProvider("DataGeneration");_this78.manifest=_this78.instantiateServiceProvider("Manifest");_this78.AppData={};if("DefaultAppData"in _this78.fable.settings){_this78.AppData=_this78.fable.settings.DefaultAppData;}_this78.Bundle={};// Log noisness goes from 0 - 5, where 5 is show me everything.
|
|
5182
|
+
_this78.LogNoisiness=0;// Although we have log noisiness, sometimes we need control flow without all the other noise for hard to diagnose interpreters.
|
|
5183
|
+
_this78.LogControlFlow=false;// And an easy way to be introspective about data at various locations
|
|
5184
|
+
_this78.LogControlFlowWatchAddressList=[];// Load manifest sets
|
|
5185
|
+
if(_this78.settings.Manifests){_this78.loadManifestSet(_this78.settings.Manifests);}_this78._DefaultPictTemplatesInitialized=false;_this78.initializePictTemplateEngine();_this78.addServiceType("PictView",require("pict-view"));_this78.addServiceType("PictProvider",require("pict-provider"));_this78.addServiceType("PictApplication",require("pict-application"));// Expose the named views directly, through a convenience accessor
|
|
5186
|
+
_this78.providers=_this78.servicesMap.PictProvider;_this78.views=_this78.servicesMap.PictView;return _this78;}/**
|
|
5188
5187
|
* Load manifests in as Hashed services
|
|
5189
5188
|
*
|
|
5190
5189
|
* @param {Object<String, String>} pManifestSet - The manifest set to load.
|
|
@@ -5296,7 +5295,7 @@ this.addTemplate(require("./templates/debugging/Pict-Template-Breakpoint.js"));t
|
|
|
5296
5295
|
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5297
5296
|
*
|
|
5298
5297
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5299
|
-
*/},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback,pContextArray){var
|
|
5298
|
+
*/},{key:"parseTemplate",value:function parseTemplate(pTemplateString,pData,fCallback,pContextArray){var _this79=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(_this79.LogControlFlow&&_this79.LogNoisiness>1){_this79.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;}}/**
|
|
5300
5299
|
* Parse a template by hash.
|
|
5301
5300
|
*
|
|
5302
5301
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
@@ -5315,8 +5314,8 @@ if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplate(tmpTempla
|
|
|
5315
5314
|
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5316
5315
|
*
|
|
5317
5316
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5318
|
-
*/},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback,pContextArray){var
|
|
5319
|
-
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return
|
|
5317
|
+
*/},{key:"parseTemplateSet",value:function parseTemplateSet(pTemplateString,pDataSet,fCallback,pContextArray){var _this80=this;// TODO: This will need streaming -- for now janky old string append does the trick
|
|
5318
|
+
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this80.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 _i56=0;_i56<tmpKeys.length;_i56++){tmpValue+=this.parseTemplate(pTemplateString,pDataSet[tmpKeys[_i56]],null,pContextArray);}}return tmpValue;}else{return"";}}}/**
|
|
5320
5319
|
* Parse a template set by hash.
|
|
5321
5320
|
*
|
|
5322
5321
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
@@ -5335,8 +5334,8 @@ if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplateSet(tmpTem
|
|
|
5335
5334
|
* @param {Array<any>} [pContextArray] - The context array to use in the template
|
|
5336
5335
|
*
|
|
5337
5336
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
5338
|
-
*/},{key:"parseTemplateSetWithPayload",value:function parseTemplateSetWithPayload(pTemplateString,pDataSet,pPayload,fCallback,pContextArray){var
|
|
5339
|
-
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return
|
|
5337
|
+
*/},{key:"parseTemplateSetWithPayload",value:function parseTemplateSetWithPayload(pTemplateString,pDataSet,pPayload,fCallback,pContextArray){var _this81=this;// TODO: This will need streaming -- for now janky old string append does the trick
|
|
5338
|
+
var tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||_typeof(pDataSet)=="object"){this.Utility.eachLimit(pDataSet,1,function(pRecord,fRecordTemplateCallback){return _this81.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 _i57=0;_i57<tmpKeys.length;_i57++){tmpValue+=this.parseTemplate(pTemplateString,{Data:pDataSet[tmpKeys[_i57]],Payload:pPayload},null,pContextArray);}}return tmpValue;}else{return"";}}}/**
|
|
5340
5339
|
* Parse a template set by hash.
|
|
5341
5340
|
*
|
|
5342
5341
|
* @param {String} pTemplateHash - The hash of the template to parse
|
|
@@ -5450,15 +5449,15 @@ return this.contentMap[pAddress];}this.pict.log.warn("Mock read from Address ".c
|
|
|
5450
5449
|
* @param {Object} pFable - The Fable Framework instance
|
|
5451
5450
|
* @param {Object} pOptions - The options for the service
|
|
5452
5451
|
* @param {String} pServiceHash - The hash of the service
|
|
5453
|
-
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var
|
|
5452
|
+
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this82;_classCallCheck2(this,PictTemplateProviderData);_this82=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);/** @type {any} */_this82.log;_this82.addPattern('{~Data:','~}');_this82.addPattern('{~D:','~}');return _this82;}_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":141}],201:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDataValueByKey=/*#__PURE__*/function(_libPictTemplate2){/**
|
|
5454
5453
|
* @param {Object} pFable - The Fable Framework instance
|
|
5455
5454
|
* @param {Object} pOptions - The options for the service
|
|
5456
5455
|
* @param {String} pServiceHash - The hash of the service
|
|
5457
|
-
*/function PictTemplateProviderDataValueByKey(pFable,pOptions,pServiceHash){var
|
|
5456
|
+
*/function PictTemplateProviderDataValueByKey(pFable,pOptions,pServiceHash){var _this83;_classCallCheck2(this,PictTemplateProviderDataValueByKey);_this83=_callSuper(this,PictTemplateProviderDataValueByKey,[pFable,pOptions,pServiceHash]);/** @type {any} */_this83.log;_this83.addPattern('{~DataValueByKey:','~}');_this83.addPattern('{~DVBK:','~}');return _this83;}_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":141}],202:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderEntity=/*#__PURE__*/function(_libPictTemplate3){/**
|
|
5458
5457
|
* @param {Object} pFable - The Fable Framework instance
|
|
5459
5458
|
* @param {Object} pOptions - The options for the service
|
|
5460
5459
|
* @param {String} pServiceHash - The hash of the service
|
|
5461
|
-
*/function PictTemplateProviderEntity(pFable,pOptions,pServiceHash){var
|
|
5460
|
+
*/function PictTemplateProviderEntity(pFable,pOptions,pServiceHash){var _this84;_classCallCheck2(this,PictTemplateProviderEntity);_this84=_callSuper(this,PictTemplateProviderEntity,[pFable,pOptions,pServiceHash]);/** @type {any} */_this84.log;_this84.addPattern('{~E:','~}');_this84.addPattern('{~Entity:','~}');return _this84;}/**
|
|
5462
5461
|
* Render a template expression, returning a string with the resulting content.
|
|
5463
5462
|
*
|
|
5464
5463
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5476,7 +5475,7 @@ if(tmpEntityTemplate){return this.pict.parseTemplateByHash(tmpEntityTemplate,pRe
|
|
|
5476
5475
|
* @param {Object} pFable - The Fable Framework instance
|
|
5477
5476
|
* @param {Object} pOptions - The options for the service
|
|
5478
5477
|
* @param {String} pServiceHash - The hash of the service
|
|
5479
|
-
*/function PictTemplateProviderSelf(pFable,pOptions,pServiceHash){var
|
|
5478
|
+
*/function PictTemplateProviderSelf(pFable,pOptions,pServiceHash){var _this85;_classCallCheck2(this,PictTemplateProviderSelf);_this85=_callSuper(this,PictTemplateProviderSelf,[pFable,pOptions,pServiceHash]);_this85.addPattern('{~Pict','~}');_this85.addPattern('{~P','~}');_this85.addPattern('{~p','~}');return _this85;}/**
|
|
5480
5479
|
* Render a template expression, returning a string with the resulting content.
|
|
5481
5480
|
*
|
|
5482
5481
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5488,7 +5487,7 @@ if(tmpEntityTemplate){return this.pict.parseTemplateByHash(tmpEntityTemplate,pRe
|
|
|
5488
5487
|
* @param {Object} pFable - The Fable Framework instance
|
|
5489
5488
|
* @param {Object} pOptions - The options for the service
|
|
5490
5489
|
* @param {String} pServiceHash - The hash of the service
|
|
5491
|
-
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var
|
|
5490
|
+
*/function PictTemplateProviderTemplate(pFable,pOptions,pServiceHash){var _this86;_classCallCheck2(this,PictTemplateProviderTemplate);_this86=_callSuper(this,PictTemplateProviderTemplate,[pFable,pOptions,pServiceHash]);/** @type {any} */_this86.log;_this86.addPattern('{~Template:','~}');_this86.addPattern('{~T:','~}');return _this86;}_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)
|
|
5492
5491
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
5493
5492
|
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.
|
|
5494
5493
|
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)
|
|
@@ -5499,7 +5498,7 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,function(pError,pVa
|
|
|
5499
5498
|
* @param {Object} pFable - The Fable Framework instance
|
|
5500
5499
|
* @param {Object} pOptions - The options for the service
|
|
5501
5500
|
* @param {String} pServiceHash - The hash of the service
|
|
5502
|
-
*/function PictTemplateProviderTemplateFromMap(pFable,pOptions,pServiceHash){var
|
|
5501
|
+
*/function PictTemplateProviderTemplateFromMap(pFable,pOptions,pServiceHash){var _this87;_classCallCheck2(this,PictTemplateProviderTemplateFromMap);_this87=_callSuper(this,PictTemplateProviderTemplateFromMap,[pFable,pOptions,pServiceHash]);/** @type {any} */_this87.log;_this87.addPattern('{~TFM:','~}');_this87.addPattern('{~TemplateFromMap:','~}');return _this87;}_inherits(PictTemplateProviderTemplateFromMap,_libPictTemplate6);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
|
|
5503
5502
|
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
|
|
5504
5503
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return'';}// Now resolve the data
|
|
5505
5504
|
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.
|
|
@@ -5512,7 +5511,7 @@ return this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,function(pEr
|
|
|
5512
5511
|
* @param {Object} pFable - The Fable Framework instance
|
|
5513
5512
|
* @param {Object} pOptions - The options for the service
|
|
5514
5513
|
* @param {String} pServiceHash - The hash of the service
|
|
5515
|
-
*/function PictTemplateProviderTemplateSet(pFable,pOptions,pServiceHash){var
|
|
5514
|
+
*/function PictTemplateProviderTemplateSet(pFable,pOptions,pServiceHash){var _this88;_classCallCheck2(this,PictTemplateProviderTemplateSet);_this88=_callSuper(this,PictTemplateProviderTemplateSet,[pFable,pOptions,pServiceHash]);/** @type {any} */_this88.log;_this88.addPattern('{~TemplateSet:','~}');_this88.addPattern('{~TS:','~}');return _this88;}_inherits(PictTemplateProviderTemplateSet,_libPictTemplate7);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)
|
|
5516
5515
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
5517
5516
|
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.
|
|
5518
5517
|
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
|
|
@@ -5524,7 +5523,7 @@ return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(
|
|
|
5524
5523
|
* @param {Object} pFable - The Fable Framework instance
|
|
5525
5524
|
* @param {Object} pOptions - The options for the service
|
|
5526
5525
|
* @param {String} pServiceHash - The hash of the service
|
|
5527
|
-
*/function PictTemplateProviderTemplateSetFromMap(pFable,pOptions,pServiceHash){var
|
|
5526
|
+
*/function PictTemplateProviderTemplateSetFromMap(pFable,pOptions,pServiceHash){var _this89;_classCallCheck2(this,PictTemplateProviderTemplateSetFromMap);_this89=_callSuper(this,PictTemplateProviderTemplateSetFromMap,[pFable,pOptions,pServiceHash]);/** @type {any} */_this89.log;_this89.addPattern('{~TSFM:','~}');_this89.addPattern('{~TemplateSetFromMap:','~}');return _this89;}_inherits(PictTemplateProviderTemplateSetFromMap,_libPictTemplate8);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
|
|
5528
5527
|
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
|
|
5529
5528
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return'';}// Now resolve the data
|
|
5530
5529
|
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.
|
|
@@ -5537,25 +5536,25 @@ return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(
|
|
|
5537
5536
|
* @param {Object} pFable - The Fable Framework instance
|
|
5538
5537
|
* @param {Object} pOptions - The options for the service
|
|
5539
5538
|
* @param {String} pServiceHash - The hash of the service
|
|
5540
|
-
*/function PictTemplateProviderTemplateSetWithPayload(pFable,pOptions,pServiceHash){var
|
|
5539
|
+
*/function PictTemplateProviderTemplateSetWithPayload(pFable,pOptions,pServiceHash){var _this90;_classCallCheck2(this,PictTemplateProviderTemplateSetWithPayload);_this90=_callSuper(this,PictTemplateProviderTemplateSetWithPayload,[pFable,pOptions,pServiceHash]);/** @type {any} */_this90.log;_this90.addPattern('{~TemplateSetWithPayload:','~}');_this90.addPattern('{~TSWP:','~}');return _this90;}_inherits(PictTemplateProviderTemplateSetWithPayload,_libPictTemplate9);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)
|
|
5541
5540
|
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)
|
|
5542
|
-
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,
|
|
5541
|
+
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":141}],209:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateValueSet=/*#__PURE__*/function(_libPictTemplate0){/**
|
|
5543
5542
|
* @param {Object} pFable - The Fable Framework instance
|
|
5544
5543
|
* @param {Object} pOptions - The options for the service
|
|
5545
5544
|
* @param {String} pServiceHash - The hash of the service
|
|
5546
|
-
*/function PictTemplateProviderTemplateValueSet(pFable,pOptions,pServiceHash){var
|
|
5545
|
+
*/function PictTemplateProviderTemplateValueSet(pFable,pOptions,pServiceHash){var _this91;_classCallCheck2(this,PictTemplateProviderTemplateValueSet);_this91=_callSuper(this,PictTemplateProviderTemplateValueSet,[pFable,pOptions,pServiceHash]);/** @type {any} */_this91.log;_this91.addPattern('{~TemplateValueSet:','~}');_this91.addPattern('{~TVS:','~}');return _this91;}_inherits(PictTemplateProviderTemplateValueSet,_libPictTemplate0);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)
|
|
5547
5546
|
var tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
5548
|
-
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
|
|
5547
|
+
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 _i58=0;_i58<tmpValueKeys.length;_i58++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i58]],Key:tmpValueKeys[_i58]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
5549
5548
|
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
|
|
5550
5549
|
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
|
|
5551
5550
|
if(!tmpTemplateFromMapHash){this.log.warn("Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [".concat(tmpHash,"]"));return fCallback(null,'');}// Now resolve the data
|
|
5552
|
-
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
|
|
5551
|
+
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 _i59=0;_i59<tmpValueKeys.length;_i59++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[_i59]],Key:tmpData[tmpValueKeys[_i59]]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
5553
5552
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
5554
|
-
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":141}],210:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderView=/*#__PURE__*/function(
|
|
5553
|
+
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":141}],210:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderView=/*#__PURE__*/function(_libPictTemplate1){/**
|
|
5555
5554
|
* @param {Object} pFable - The Fable Framework instance
|
|
5556
5555
|
* @param {Object} pOptions - The options for the service
|
|
5557
5556
|
* @param {String} pServiceHash - The hash of the service
|
|
5558
|
-
*/function PictTemplateProviderView(pFable,pOptions,pServiceHash){var
|
|
5557
|
+
*/function PictTemplateProviderView(pFable,pOptions,pServiceHash){var _this92;_classCallCheck2(this,PictTemplateProviderView);_this92=_callSuper(this,PictTemplateProviderView,[pFable,pOptions,pServiceHash]);/** @type {any} */_this92.log;_this92.addPattern('{~V:','~}');_this92.addPattern('{~View:','~}');if(!('__TemplateOutputCache'in _this92.pict)){_this92.pict.__TemplateOutputCache={};}return _this92;}/**
|
|
5559
5558
|
* Render a template expression, returning a string with the resulting content.
|
|
5560
5559
|
*
|
|
5561
5560
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5563,38 +5562,38 @@ return this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,function(
|
|
|
5563
5562
|
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
5564
5563
|
*
|
|
5565
5564
|
* @return {string} The rendered template
|
|
5566
|
-
*/_inherits(PictTemplateProviderView,
|
|
5565
|
+
*/_inherits(PictTemplateProviderView,_libPictTemplate1);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
|
|
5567
5566
|
//delete this.pict.__TemplateOutputCache[tmpRenderGUID];
|
|
5568
|
-
return tmpResult;}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var
|
|
5567
|
+
return tmpResult;}},{key:"renderAsync",value:function renderAsync(pTemplateHash,pRecord,fCallback,pContextArray){var _this93=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){_this93.log.warn("Pict: View Template Render: Error rendering view [".concat(tmpViewHash,"]"),pError);return fCallback(pError,'');}var tmpResult=_this93.pict.__TemplateOutputCache[tmpRenderGUID];// TODO: Uncomment this when we like how it's working
|
|
5569
5568
|
//delete this.pict.__TemplateOutputCache[tmpRenderGUID];
|
|
5570
|
-
return fCallback(null,tmpResult);});}}]);}(libPictTemplate);module.exports=PictTemplateProviderView;},{"pict-template":141}],211:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderRandomNumber=/*#__PURE__*/function(
|
|
5569
|
+
return fCallback(null,tmpResult);});}}]);}(libPictTemplate);module.exports=PictTemplateProviderView;},{"pict-template":141}],211:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderRandomNumber=/*#__PURE__*/function(_libPictTemplate10){/**
|
|
5571
5570
|
* @param {Object} pFable - The Fable Framework instance
|
|
5572
5571
|
* @param {Object} pOptions - The options for the service
|
|
5573
5572
|
* @param {String} pServiceHash - The hash of the service
|
|
5574
|
-
*/function PictTemplateProviderRandomNumber(pFable,pOptions,pServiceHash){var
|
|
5573
|
+
*/function PictTemplateProviderRandomNumber(pFable,pOptions,pServiceHash){var _this94;_classCallCheck2(this,PictTemplateProviderRandomNumber);_this94=_callSuper(this,PictTemplateProviderRandomNumber,[pFable,pOptions,pServiceHash]);/** @type {any} */_this94.log;_this94.addPattern('{~RandomNumber:','~}');_this94.addPattern('{~RN:','~}');return _this94;}_inherits(PictTemplateProviderRandomNumber,_libPictTemplate10);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":141}],212:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderRandomNumberString=/*#__PURE__*/function(_libPictTemplate11){/**
|
|
5575
5574
|
* @param {Object} pFable - The Fable Framework instance
|
|
5576
5575
|
* @param {Object} pOptions - The options for the service
|
|
5577
5576
|
* @param {String} pServiceHash - The hash of the service
|
|
5578
|
-
*/function PictTemplateProviderRandomNumberString(pFable,pOptions,pServiceHash){var
|
|
5577
|
+
*/function PictTemplateProviderRandomNumberString(pFable,pOptions,pServiceHash){var _this95;_classCallCheck2(this,PictTemplateProviderRandomNumberString);_this95=_callSuper(this,PictTemplateProviderRandomNumberString,[pFable,pOptions,pServiceHash]);/** @type {any} */_this95.log;_this95.addPattern('{~RandomNumberString:','~}');_this95.addPattern('{~RNS:','~}');return _this95;}_inherits(PictTemplateProviderRandomNumberString,_libPictTemplate11);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":141}],213:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDollars=/*#__PURE__*/function(_libPictTemplate12){/**
|
|
5579
5578
|
* @param {Object} pFable - The Fable Framework instance
|
|
5580
5579
|
* @param {Object} pOptions - The options for the service
|
|
5581
5580
|
* @param {String} pServiceHash - The hash of the service
|
|
5582
|
-
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var
|
|
5581
|
+
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var _this96;_classCallCheck2(this,PictTemplateProviderDollars);_this96=_callSuper(this,PictTemplateProviderDollars,[pFable,pOptions,pServiceHash]);/** @type {any} */_this96.log;_this96.addPattern('{~DataJson:','~}');_this96.addPattern('{~DJ:','~}');return _this96;}_inherits(PictTemplateProviderDollars,_libPictTemplate12);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":141}],214:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateOnlyFormat=/*#__PURE__*/function(_libPictTemplate13){/**
|
|
5583
5582
|
* @param {import('fable')} pFable - The Fable Framework instance
|
|
5584
5583
|
* @param {any} pOptions - The options for the service
|
|
5585
5584
|
* @param {String} pServiceHash - The hash of the service
|
|
5586
|
-
*/function PictTemplateProviderDateOnlyFormat(pFable,pOptions,pServiceHash){var
|
|
5585
|
+
*/function PictTemplateProviderDateOnlyFormat(pFable,pOptions,pServiceHash){var _this97;_classCallCheck2(this,PictTemplateProviderDateOnlyFormat);_this97=_callSuper(this,PictTemplateProviderDateOnlyFormat,[pFable,pOptions,pServiceHash]);/** @type {any} */_this97.options;/** @type {any} */_this97.log;_this97.addPattern('{~DateOnlyFormat:','~}');return _this97;}_inherits(PictTemplateProviderDateOnlyFormat,_libPictTemplate13);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
|
|
5587
5586
|
var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue).tz('UTC');return tmpDayJS.format(tmpDateValueSet[1]);}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateOnlyFormat;/*
|
|
5588
5587
|
# DEAR DEAD CODE DIARY:
|
|
5589
5588
|
|
|
5590
5589
|
```javascript
|
|
5591
5590
|
|
|
5592
5591
|
```
|
|
5593
|
-
*/},{"pict-template":141}],215:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateOnlyYMD=/*#__PURE__*/function(
|
|
5592
|
+
*/},{"pict-template":141}],215:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateOnlyYMD=/*#__PURE__*/function(_libPictTemplate14){/**
|
|
5594
5593
|
* @param {Object} pFable - The Fable Framework instance
|
|
5595
5594
|
* @param {Object} pOptions - The options for the service
|
|
5596
5595
|
* @param {String} pServiceHash - The hash of the service
|
|
5597
|
-
*/function PictTemplateProviderDateOnlyYMD(pFable,pOptions,pServiceHash){var
|
|
5596
|
+
*/function PictTemplateProviderDateOnlyYMD(pFable,pOptions,pServiceHash){var _this98;_classCallCheck2(this,PictTemplateProviderDateOnlyYMD);_this98=_callSuper(this,PictTemplateProviderDateOnlyYMD,[pFable,pOptions,pServiceHash]);/** @type {any} */_this98.options;/** @type {any} */_this98.log;_this98.addPattern('{~DateOnlyYMD:','~}');return _this98;}/**
|
|
5598
5597
|
* Render a template expression, returning a string with the resulting content.
|
|
5599
5598
|
*
|
|
5600
5599
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5602,15 +5601,15 @@ var tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue).tz('UTC');return tmpDayJS.
|
|
|
5602
5601
|
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
5603
5602
|
*
|
|
5604
5603
|
* @return {string} The rendered template
|
|
5605
|
-
*/_inherits(PictTemplateProviderDateOnlyYMD,
|
|
5604
|
+
*/_inherits(PictTemplateProviderDateOnlyYMD,_libPictTemplate14);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
|
|
5606
5605
|
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
|
|
5607
5606
|
// not even sure showing negative is right; showing the era is probably better (BCE vs CE)
|
|
5608
|
-
var prefix=tmpDayJS.valueOf()<-62167219200000?'-':'';return prefix+tmpDayJS.format('YYYY-MM-DD');}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateOnlyYMD;},{"pict-template":141}],216:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateTimeFormat=/*#__PURE__*/function(
|
|
5607
|
+
var prefix=tmpDayJS.valueOf()<-62167219200000?'-':'';return prefix+tmpDayJS.format('YYYY-MM-DD');}}]);}(libPictTemplate);module.exports=PictTemplateProviderDateOnlyYMD;},{"pict-template":141}],216:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateTimeFormat=/*#__PURE__*/function(_libPictTemplate15){/**
|
|
5609
5608
|
* @param {Object} pFable - The Fable Framework instance
|
|
5610
5609
|
* @param {Object} pOptions - The options for the service
|
|
5611
5610
|
* @param {String} pServiceHash - The hash of the service
|
|
5612
|
-
*/function PictTemplateProviderDateTimeFormat(pFable,pOptions,pServiceHash){var
|
|
5613
|
-
return
|
|
5611
|
+
*/function PictTemplateProviderDateTimeFormat(pFable,pOptions,pServiceHash){var _this99;_classCallCheck2(this,PictTemplateProviderDateTimeFormat);_this99=_callSuper(this,PictTemplateProviderDateTimeFormat,[pFable,pOptions,pServiceHash]);/** @type {any} */_this99.options;/** @type {any} */_this99.log;_this99.addPattern('{~DateTimeFormat:','~}');_this99.addPattern('{~DateFormat:','~}');// for backwards compatibility
|
|
5612
|
+
return _this99;}_inherits(PictTemplateProviderDateTimeFormat,_libPictTemplate15);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
|
|
5614
5613
|
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
|
|
5615
5614
|
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()}].`);
|
|
5616
5615
|
// Day.js will try to guess the user's timezone for us
|
|
@@ -5620,12 +5619,12 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
5620
5619
|
```javascript
|
|
5621
5620
|
|
|
5622
5621
|
```
|
|
5623
|
-
*/},{"pict-template":141}],217:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateTimeYMD=/*#__PURE__*/function(
|
|
5622
|
+
*/},{"pict-template":141}],217:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDateTimeYMD=/*#__PURE__*/function(_libPictTemplate16){/**
|
|
5624
5623
|
* @param {Object} pFable - The Fable Framework instance
|
|
5625
5624
|
* @param {Object} pOptions - The options for the service
|
|
5626
5625
|
* @param {String} pServiceHash - The hash of the service
|
|
5627
|
-
*/function PictTemplateProviderDateTimeYMD(pFable,pOptions,pServiceHash){var
|
|
5628
|
-
return
|
|
5626
|
+
*/function PictTemplateProviderDateTimeYMD(pFable,pOptions,pServiceHash){var _this100;_classCallCheck2(this,PictTemplateProviderDateTimeYMD);_this100=_callSuper(this,PictTemplateProviderDateTimeYMD,[pFable,pOptions,pServiceHash]);/** @type {any} */_this100.options;/** @type {any} */_this100.log;_this100.addPattern('{~DateTimeYMD:','~}');_this100.addPattern('{~DateYMD:','~}');// for backwards compatibility
|
|
5627
|
+
return _this100;}/**
|
|
5629
5628
|
* Render a template expression, returning a string with the resulting content.
|
|
5630
5629
|
*
|
|
5631
5630
|
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
@@ -5633,90 +5632,90 @@ return _this102;}/**
|
|
|
5633
5632
|
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
5634
5633
|
*
|
|
5635
5634
|
* @return {string} The rendered template
|
|
5636
|
-
*/_inherits(PictTemplateProviderDateTimeYMD,
|
|
5635
|
+
*/_inherits(PictTemplateProviderDateTimeYMD,_libPictTemplate16);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
|
|
5637
5636
|
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
|
|
5638
5637
|
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()}].`);
|
|
5639
5638
|
// Day.js will try to guess the user's timezone for us
|
|
5640
|
-
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":141}],218:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDigits=/*#__PURE__*/function(
|
|
5639
|
+
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":141}],218:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDigits=/*#__PURE__*/function(_libPictTemplate17){/**
|
|
5641
5640
|
* @param {Object} pFable - The Fable Framework instance
|
|
5642
5641
|
* @param {Object} pOptions - The options for the service
|
|
5643
5642
|
* @param {String} pServiceHash - The hash of the service
|
|
5644
|
-
*/function PictTemplateProviderDigits(pFable,pOptions,pServiceHash){var
|
|
5643
|
+
*/function PictTemplateProviderDigits(pFable,pOptions,pServiceHash){var _this101;_classCallCheck2(this,PictTemplateProviderDigits);_this101=_callSuper(this,PictTemplateProviderDigits,[pFable,pOptions,pServiceHash]);/** @type {any} */_this101.options;/** @type {any} */_this101.log;_this101.addPattern('{~Digits:','~}');return _this101;}_inherits(PictTemplateProviderDigits,_libPictTemplate17);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":141}],219:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDollars=/*#__PURE__*/function(_libPictTemplate18){/**
|
|
5645
5644
|
* @param {Object} pFable - The Fable Framework instance
|
|
5646
5645
|
* @param {Object} pOptions - The options for the service
|
|
5647
5646
|
* @param {String} pServiceHash - The hash of the service
|
|
5648
|
-
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var
|
|
5647
|
+
*/function PictTemplateProviderDollars(pFable,pOptions,pServiceHash){var _this102;_classCallCheck2(this,PictTemplateProviderDollars);_this102=_callSuper(this,PictTemplateProviderDollars,[pFable,pOptions,pServiceHash]);/** @type {any} */_this102.options;/** @type {any} */_this102.log;_this102.addPattern('{~Dollars:','~}');return _this102;}_inherits(PictTemplateProviderDollars,_libPictTemplate18);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":141}],220:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderData=/*#__PURE__*/function(_libPictTemplate19){/**
|
|
5649
5648
|
* @param {Object} pFable - The Fable Framework instance
|
|
5650
5649
|
* @param {Object} pOptions - The options for the service
|
|
5651
5650
|
* @param {String} pServiceHash - The hash of the service
|
|
5652
|
-
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var
|
|
5651
|
+
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this103;_classCallCheck2(this,PictTemplateProviderData);_this103=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);/** @type {any} */_this103.log;_this103.addPattern('{~HtmlCommentEnd:','~}');_this103.addPattern('{~HCE:','~}');return _this103;}_inherits(PictTemplateProviderData,_libPictTemplate19);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":141}],221:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderData=/*#__PURE__*/function(_libPictTemplate20){/**
|
|
5653
5652
|
* @param {Object} pFable - The Fable Framework instance
|
|
5654
5653
|
* @param {Object} pOptions - The options for the service
|
|
5655
5654
|
* @param {String} pServiceHash - The hash of the service
|
|
5656
|
-
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var
|
|
5655
|
+
*/function PictTemplateProviderData(pFable,pOptions,pServiceHash){var _this104;_classCallCheck2(this,PictTemplateProviderData);_this104=_callSuper(this,PictTemplateProviderData,[pFable,pOptions,pServiceHash]);/** @type {any} */_this104.log;_this104.addPattern('{~HtmlCommentStart:','~}');_this104.addPattern('{~HCS:','~}');return _this104;}_inherits(PictTemplateProviderData,_libPictTemplate20);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":141}],222:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderJoin=/*#__PURE__*/function(_libPictTemplate21){/**
|
|
5657
5656
|
* @param {Object} pFable - The Fable Framework instance
|
|
5658
5657
|
* @param {Object} pOptions - The options for the service
|
|
5659
5658
|
* @param {String} pServiceHash - The hash of the service
|
|
5660
|
-
*/function PictTemplateProviderJoin(pFable,pOptions,pServiceHash){var
|
|
5661
|
-
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":141}],223:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderJoinUnique=/*#__PURE__*/function(
|
|
5659
|
+
*/function PictTemplateProviderJoin(pFable,pOptions,pServiceHash){var _this105;_classCallCheck2(this,PictTemplateProviderJoin);_this105=_callSuper(this,PictTemplateProviderJoin,[pFable,pOptions,pServiceHash]);/** @type {any} */_this105.options;/** @type {any} */_this105.log;_this105.addPattern('{~Join:','~}');_this105.addPattern('{~J:','~}');return _this105;}_inherits(PictTemplateProviderJoin,_libPictTemplate21);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
|
|
5660
|
+
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":141}],223:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderJoinUnique=/*#__PURE__*/function(_libPictTemplate22){/**
|
|
5662
5661
|
* @param {Object} pFable - The Fable Framework instance
|
|
5663
5662
|
* @param {Object} pOptions - The options for the service
|
|
5664
5663
|
* @param {String} pServiceHash - The hash of the service
|
|
5665
|
-
*/function PictTemplateProviderJoinUnique(pFable,pOptions,pServiceHash){var
|
|
5666
|
-
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":141}],224:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderPascalCaseIdentifier=/*#__PURE__*/function(
|
|
5664
|
+
*/function PictTemplateProviderJoinUnique(pFable,pOptions,pServiceHash){var _this106;_classCallCheck2(this,PictTemplateProviderJoinUnique);_this106=_callSuper(this,PictTemplateProviderJoinUnique,[pFable,pOptions,pServiceHash]);/** @type {any} */_this106.options;/** @type {any} */_this106.log;_this106.addPattern('{~JoinUnique:','~}');_this106.addPattern('{~JU:','~}');return _this106;}_inherits(PictTemplateProviderJoinUnique,_libPictTemplate22);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
|
|
5665
|
+
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":141}],224:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderPascalCaseIdentifier=/*#__PURE__*/function(_libPictTemplate23){/**
|
|
5667
5666
|
* @param {Object} pFable - The Fable Framework instance
|
|
5668
5667
|
* @param {Object} pOptions - The options for the service
|
|
5669
5668
|
* @param {String} pServiceHash - The hash of the service
|
|
5670
|
-
*/function PictTemplateProviderPascalCaseIdentifier(pFable,pOptions,pServiceHash){var
|
|
5669
|
+
*/function PictTemplateProviderPascalCaseIdentifier(pFable,pOptions,pServiceHash){var _this107;_classCallCheck2(this,PictTemplateProviderPascalCaseIdentifier);_this107=_callSuper(this,PictTemplateProviderPascalCaseIdentifier,[pFable,pOptions,pServiceHash]);/** @type {any} */_this107.options;/** @type {any} */_this107.log;_this107.addPattern('{~PascalCaseIdentifier:','~}');return _this107;}_inherits(PictTemplateProviderPascalCaseIdentifier,_libPictTemplate23);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;/*
|
|
5671
5670
|
# DEAR DEAD CODE DIARY:
|
|
5672
5671
|
|
|
5673
5672
|
```javascript
|
|
5674
5673
|
|
|
5675
5674
|
```
|
|
5676
|
-
*/},{"pict-template":141}],225:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderPluckJoinUnique=/*#__PURE__*/function(
|
|
5675
|
+
*/},{"pict-template":141}],225:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderPluckJoinUnique=/*#__PURE__*/function(_libPictTemplate24){/**
|
|
5677
5676
|
* @param {Object} pFable - The Fable Framework instance
|
|
5678
5677
|
* @param {Object} pOptions - The options for the service
|
|
5679
5678
|
* @param {String} pServiceHash - The hash of the service
|
|
5680
|
-
*/function PictTemplateProviderPluckJoinUnique(pFable,pOptions,pServiceHash){var
|
|
5679
|
+
*/function PictTemplateProviderPluckJoinUnique(pFable,pOptions,pServiceHash){var _this108;_classCallCheck2(this,PictTemplateProviderPluckJoinUnique);_this108=_callSuper(this,PictTemplateProviderPluckJoinUnique,[pFable,pOptions,pServiceHash]);/** @type {any} */_this108.options;/** @type {any} */_this108.log;_this108.addPattern('{~PluckJoinUnique:','~}');_this108.addPattern('{~PJU:','~}');return _this108;}_inherits(PictTemplateProviderPluckJoinUnique,_libPictTemplate24);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
|
|
5681
5680
|
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.
|
|
5682
|
-
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":141}],226:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderBreakpoint=/*#__PURE__*/function(
|
|
5681
|
+
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":141}],226:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderBreakpoint=/*#__PURE__*/function(_libPictTemplate25){/**
|
|
5683
5682
|
* @param {Object} pFable - The Fable Framework instance
|
|
5684
5683
|
* @param {Object} pOptions - The options for the service
|
|
5685
5684
|
* @param {String} pServiceHash - The hash of the service
|
|
5686
|
-
*/function PictTemplateProviderBreakpoint(pFable,pOptions,pServiceHash){var
|
|
5685
|
+
*/function PictTemplateProviderBreakpoint(pFable,pOptions,pServiceHash){var _this109;_classCallCheck2(this,PictTemplateProviderBreakpoint);_this109=_callSuper(this,PictTemplateProviderBreakpoint,[pFable,pOptions,pServiceHash]);/** @type {any} */_this109.log;_this109.addPattern('{~Breakpoint','~}');return _this109;}_inherits(PictTemplateProviderBreakpoint,_libPictTemplate25);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;
|
|
5687
5686
|
debugger;// eslint-disable-line no-debugger
|
|
5688
|
-
return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderBreakpoint;},{"pict-template":141}],227:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDataValueTree=/*#__PURE__*/function(
|
|
5687
|
+
return'';}}]);}(libPictTemplate);module.exports=PictTemplateProviderBreakpoint;},{"pict-template":141}],227:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderDataValueTree=/*#__PURE__*/function(_libPictTemplate26){/**
|
|
5689
5688
|
* @param {Object} pFable - The Fable Framework instance
|
|
5690
5689
|
* @param {Object} pOptions - The options for the service
|
|
5691
5690
|
* @param {String} pServiceHash - The hash of the service
|
|
5692
|
-
*/function PictTemplateProviderDataValueTree(pFable,pOptions,pServiceHash){var
|
|
5691
|
+
*/function PictTemplateProviderDataValueTree(pFable,pOptions,pServiceHash){var _this110;_classCallCheck2(this,PictTemplateProviderDataValueTree);_this110=_callSuper(this,PictTemplateProviderDataValueTree,[pFable,pOptions,pServiceHash]);/** @type {any} */_this110.log;_this110.addPattern('{~DataTree:','~}');_this110.addPattern('{~DT:','~}');return _this110;}_inherits(PictTemplateProviderDataValueTree,_libPictTemplate26);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
|
|
5693
5692
|
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
|
|
5694
|
-
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":141}],228:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogStatement=/*#__PURE__*/function(
|
|
5693
|
+
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":141}],228:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogStatement=/*#__PURE__*/function(_libPictTemplate27){/**
|
|
5695
5694
|
* @param {Object} pFable - The Fable Framework instance
|
|
5696
5695
|
* @param {Object} pOptions - The options for the service
|
|
5697
5696
|
* @param {String} pServiceHash - The hash of the service
|
|
5698
|
-
*/function PictTemplateProviderLogStatement(pFable,pOptions,pServiceHash){var
|
|
5697
|
+
*/function PictTemplateProviderLogStatement(pFable,pOptions,pServiceHash){var _this111;_classCallCheck2(this,PictTemplateProviderLogStatement);_this111=_callSuper(this,PictTemplateProviderLogStatement,[pFable,pOptions,pServiceHash]);/** @type {any} */_this111.log;_this111.addPattern('{~LogStatement:','~}');_this111.addPattern('{~LS:','~}');return _this111;}_inherits(PictTemplateProviderLogStatement,_libPictTemplate27);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":141}],229:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogValue=/*#__PURE__*/function(_libPictTemplate28){/**
|
|
5699
5698
|
* @param {Object} pFable - The Fable Framework instance
|
|
5700
5699
|
* @param {Object} pOptions - The options for the service
|
|
5701
5700
|
* @param {String} pServiceHash - The hash of the service
|
|
5702
|
-
*/function PictTemplateProviderLogValue(pFable,pOptions,pServiceHash){var
|
|
5701
|
+
*/function PictTemplateProviderLogValue(pFable,pOptions,pServiceHash){var _this112;_classCallCheck2(this,PictTemplateProviderLogValue);_this112=_callSuper(this,PictTemplateProviderLogValue,[pFable,pOptions,pServiceHash]);/** @type {any} */_this112.log;_this112.addPattern('{~LogValue:','~}');_this112.addPattern('{~LV:','~}');return _this112;}_inherits(PictTemplateProviderLogValue,_libPictTemplate28);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":141}],230:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderLogValueTree=/*#__PURE__*/function(_libPictTemplate29){/**
|
|
5703
5702
|
* @param {Object} pFable - The Fable Framework instance
|
|
5704
5703
|
* @param {Object} pOptions - The options for the service
|
|
5705
5704
|
* @param {String} pServiceHash - The hash of the service
|
|
5706
|
-
*/function PictTemplateProviderLogValueTree(pFable,pOptions,pServiceHash){var
|
|
5705
|
+
*/function PictTemplateProviderLogValueTree(pFable,pOptions,pServiceHash){var _this113;_classCallCheck2(this,PictTemplateProviderLogValueTree);_this113=_callSuper(this,PictTemplateProviderLogValueTree,[pFable,pOptions,pServiceHash]);/** @type {any} */_defineProperty2(_this113,"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;}_this113.log.trace("[".concat(pBaseAddress,".").concat(tmpObjectValueKeys[i],"] (").concat(tmpBranchType,"): ").concat(tmpBranchValue));if(pCurrentDepth+1>pMaxDepth){return'';}else if(tmpBranchType=='object'){tmpBranchValue=_this113.logValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],"".concat(pBaseAddress,".").concat(tmpObjectValueKeys[i]),pRootObject,pCurrentDepth+1,pMaxDepth);}}return'';});_this113.log;_this113.addPattern('{~LogValueTree:','~}');_this113.addPattern('{~LVT:','~}');return _this113;}_inherits(PictTemplateProviderLogValueTree,_libPictTemplate29);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":141}],231:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderNotEmpty=/*#__PURE__*/function(_libPictTemplate30){/**
|
|
5707
5706
|
* @param {Object} pFable - The Fable Framework instance
|
|
5708
5707
|
* @param {Object} pOptions - The options for the service
|
|
5709
5708
|
* @param {String} pServiceHash - The hash of the service
|
|
5710
|
-
*/function PictTemplateProviderNotEmpty(pFable,pOptions,pServiceHash){var
|
|
5711
|
-
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray)){return tmpHashParts[1];}else{return'';}}}]);}(libPictTemplate);module.exports=PictTemplateProviderNotEmpty;},{"pict-template":141}],232:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateIfBase=/*#__PURE__*/function(
|
|
5709
|
+
*/function PictTemplateProviderNotEmpty(pFable,pOptions,pServiceHash){var _this114;_classCallCheck2(this,PictTemplateProviderNotEmpty);_this114=_callSuper(this,PictTemplateProviderNotEmpty,[pFable,pOptions,pServiceHash]);/** @type {any} */_this114.log;_this114.addPattern('{~NotEmpty:','~}');_this114.addPattern('{~NE:','~}');return _this114;}_inherits(PictTemplateProviderNotEmpty,_libPictTemplate30);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.
|
|
5710
|
+
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray)){return tmpHashParts[1];}else{return'';}}}]);}(libPictTemplate);module.exports=PictTemplateProviderNotEmpty;},{"pict-template":141}],232:[function(require,module,exports){var libPictTemplate=require('pict-template');var PictTemplateProviderTemplateIfBase=/*#__PURE__*/function(_libPictTemplate31){/**
|
|
5712
5711
|
* @param {Object} pFable - The Fable Framework instance
|
|
5713
5712
|
* @param {Object} pOptions - The options for the service
|
|
5714
5713
|
* @param {String} pServiceHash - The hash of the service
|
|
5715
|
-
*/function PictTemplateProviderTemplateIfBase(pFable,pOptions,pServiceHash){_classCallCheck2(this,PictTemplateProviderTemplateIfBase);return _callSuper(this,PictTemplateProviderTemplateIfBase,[pFable,pOptions,pServiceHash]);}_inherits(PictTemplateProviderTemplateIfBase,
|
|
5714
|
+
*/function PictTemplateProviderTemplateIfBase(pFable,pOptions,pServiceHash){_classCallCheck2(this,PictTemplateProviderTemplateIfBase);return _callSuper(this,PictTemplateProviderTemplateIfBase,[pFable,pOptions,pServiceHash]);}_inherits(PictTemplateProviderTemplateIfBase,_libPictTemplate31);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":141}],233:[function(require,module,exports){var libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');var PictTemplateProviderTemplateIf=/*#__PURE__*/function(_libPictTemplateIf){/**
|
|
5716
5715
|
* @param {Object} pFable - The Fable Framework instance
|
|
5717
5716
|
* @param {Object} pOptions - The options for the service
|
|
5718
5717
|
* @param {String} pServiceHash - The hash of the service
|
|
5719
|
-
*/function PictTemplateProviderTemplateIf(pFable,pOptions,pServiceHash){var
|
|
5718
|
+
*/function PictTemplateProviderTemplateIf(pFable,pOptions,pServiceHash){var _this115;_classCallCheck2(this,PictTemplateProviderTemplateIf);_this115=_callSuper(this,PictTemplateProviderTemplateIf,[pFable,pOptions,pServiceHash]);/** @type {any} */_this115.log;_this115.addPattern('{~TemplateIf:','~}');_this115.addPattern('{~TIf:','~}');return _this115;}_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
|
|
5720
5719
|
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
|
|
5721
5720
|
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...
|
|
5722
5721
|
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
|
|
@@ -5730,7 +5729,7 @@ var tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpCompa
|
|
|
5730
5729
|
* @param {Object} pFable - The Fable Framework instance
|
|
5731
5730
|
* @param {Object} pOptions - The options for the service
|
|
5732
5731
|
* @param {String} pServiceHash - The hash of the service
|
|
5733
|
-
*/function PictTemplateProviderTemplateIfAbsolute(pFable,pOptions,pServiceHash){var
|
|
5732
|
+
*/function PictTemplateProviderTemplateIfAbsolute(pFable,pOptions,pServiceHash){var _this116;_classCallCheck2(this,PictTemplateProviderTemplateIfAbsolute);_this116=_callSuper(this,PictTemplateProviderTemplateIfAbsolute,[pFable,pOptions,pServiceHash]);/** @type {any} */_this116.log;_this116.addPattern('{~TemplateIfAbsolute:','~}');_this116.addPattern('{~TIfAbs:','~}');return _this116;}_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
|
|
5734
5733
|
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
|
|
5735
5734
|
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...
|
|
5736
5735
|
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
|