pict 1.0.369 → 1.0.370
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.js +179 -52
- package/dist/pict.js.map +1 -1
- package/dist/pict.min.js +2 -2
- package/dist/pict.min.js.map +1 -1
- package/package.json +3 -3
- package/source/Pict.js +9 -0
- package/source/templates/Pict-Template-AddressedTemplate.js +156 -0
- package/source/templates/Pict-Template-Function.js +118 -0
- package/source/templates/Pict-Template-InlineTemplate.js +111 -0
package/dist/pict.js
CHANGED
|
@@ -771,7 +771,7 @@ generateUUIDv4(){let tmpBuffer=new Array(16);var tmpRandomBytes=this.randomByteG
|
|
|
771
771
|
tmpRandomBytes[6]=tmpRandomBytes[6]&0x0f|0x40;tmpRandomBytes[8]=tmpRandomBytes[8]&0x3f|0x80;return this.bytesToUUID(tmpRandomBytes);}// Simple random UUID generation
|
|
772
772
|
generateRandom(){let tmpUUID='';for(let 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)
|
|
773
773
|
getUUID(){if(this._UUIDModeRandom){return this.generateRandom();}else{return this.generateUUIDv4();}}}// This is for backwards compatibility
|
|
774
|
-
function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports.new=autoConstruct;},{"../package.json":64,"./Fable-UUID-Random.js":65,"fable-serviceproviderbase":59}],67:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.
|
|
774
|
+
function autoConstruct(pSettings){return new FableUUID(pSettings);}module.exports=FableUUID;module.exports.new=autoConstruct;},{"../package.json":64,"./Fable-UUID-Random.js":65,"fable-serviceproviderbase":59}],67:[function(require,module,exports){module.exports={"name":"fable","version":"3.1.74","description":"A service dependency injection, configuration and logging library.","main":"source/Fable.js","scripts":{"start":"node source/Fable.js","coverage":"npx quack coverage","test":"npx quack test","build":"npx quack build","prepublishOnly":"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":"npx quack test -g"},"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":{"pict-docuserve":"^1.3.2","quackage":"^1.2.3"},"dependencies":{"async.eachlimit":"^0.5.2","async.waterfall":"^0.5.2","big.js":"^7.0.1","cachetrax":"^1.0.6","cookie":"^1.1.1","data-arithmatic":"^1.0.7","dayjs":"^1.11.19","fable-log":"^3.0.18","fable-serviceproviderbase":"^3.0.19","fable-settings":"^3.0.16","fable-uuid":"^3.0.14","manyfest":"^1.0.49","simple-get":"^4.0.1"}};},{}],68:[function(require,module,exports){/**
|
|
775
775
|
* Fable Application Services Support Library
|
|
776
776
|
* @author <steven@velozo.com>
|
|
777
777
|
*/// Pre-init services
|
|
@@ -2548,7 +2548,9 @@ pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// Flush the ou
|
|
|
2548
2548
|
this.appendOutputBuffer(pCharacter,pParserState);// If this last character is the end of the pattern, parse it.
|
|
2549
2549
|
// Run the function
|
|
2550
2550
|
let tmpFunctionContext='ParserContext'in pParserState.Pattern?pParserState.Pattern.ParserContext:false;if(tmpFunctionContext){pParserState.OutputBuffer=pParserState.Pattern.Parse.call(tmpFunctionContext,pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,pDataContext,pScope,pState);}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,pScope,pState);}return this.resetOutputBuffer(pParserState);}else if(pCharacter in pParserState.PatternStartNode.PatternEnd){// We broke out of the end -- see if this is a new start of the end.
|
|
2551
|
-
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{
|
|
2551
|
+
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{// Partial end-pattern match aborted -- roll Pattern back to the start node so
|
|
2552
|
+
// subsequent characters scan for the end pattern from the beginning again.
|
|
2553
|
+
pParserState.EndPatternMatchBegan=false;pParserState.Pattern=pParserState.PatternStartNode;this.appendOutputBuffer(pCharacter,pParserState);}}else if('PatternEnd'in pParserState.Pattern){if(!pParserState.StartPatternMatchComplete){pParserState.StartPatternMatchComplete=true;pParserState.PatternStartNode=pParserState.Pattern;}this.appendOutputBuffer(pCharacter,pParserState);if(pCharacter in pParserState.Pattern.PatternEnd){// This is the first character of the end pattern.
|
|
2552
2554
|
pParserState.EndPatternMatchBegan=true;// This leaf has a PatternEnd tree, so we will wait until that end is met.
|
|
2553
2555
|
pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// If this last character is the end of the pattern, parse it.
|
|
2554
2556
|
if('Parse'in pParserState.Pattern){// Run the t*mplate function
|
|
@@ -2584,7 +2586,9 @@ if(!pParserState.StartPatternMatchComplete&&pCharacter in pParserState.Pattern){
|
|
|
2584
2586
|
pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// Flush the output buffer.
|
|
2585
2587
|
this.appendOutputBuffer(pCharacter,pParserState);// If this last character is the end of the pattern, parse it.
|
|
2586
2588
|
if('Parse'in pParserState.Pattern){return this.executePatternAsync(pParserState,pData,fCallback,pDataContext,pScope,pState);}}else if(pCharacter in pParserState.PatternStartNode.PatternEnd){// We broke out of the end -- see if this is a new start of the end.
|
|
2587
|
-
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{
|
|
2589
|
+
pParserState.Pattern=pParserState.PatternStartNode.PatternEnd[pCharacter];this.appendOutputBuffer(pCharacter,pParserState);}else{// Partial end-pattern match aborted -- roll Pattern back to the start node so
|
|
2590
|
+
// subsequent characters scan for the end pattern from the beginning again.
|
|
2591
|
+
pParserState.EndPatternMatchBegan=false;pParserState.Pattern=pParserState.PatternStartNode;this.appendOutputBuffer(pCharacter,pParserState);}}else if('PatternEnd'in pParserState.Pattern){if(!pParserState.StartPatternMatchComplete){pParserState.StartPatternMatchComplete=true;pParserState.PatternStartNode=pParserState.Pattern;}this.appendOutputBuffer(pCharacter,pParserState);if(pCharacter in pParserState.Pattern.PatternEnd){// This is the first character of the end pattern.
|
|
2588
2592
|
pParserState.EndPatternMatchBegan=true;// This leaf has a PatternEnd tree, so we will wait until that end is met.
|
|
2589
2593
|
pParserState.Pattern=pParserState.Pattern.PatternEnd[pCharacter];// If this last character is the end of the pattern, parse it.
|
|
2590
2594
|
if('Parse'in pParserState.Pattern){return this.executePatternAsync(pParserState,pData,fCallback,pDataContext,pScope,pState);}}}else{// We are in a pattern start but didn't match one; reset and start trying again from this character.
|
|
@@ -6091,7 +6095,7 @@ try{if(!global.localStorage)return false;}catch(_){return false;}var val=global.
|
|
|
6091
6095
|
// presumably different callback function.
|
|
6092
6096
|
// This makes sure that own properties are retained, so that
|
|
6093
6097
|
// decorations and such are not lost along the way.
|
|
6094
|
-
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;}}},{}],191:[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;}},{}],192:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.
|
|
6098
|
+
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;}}},{}],191:[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;}},{}],192:[function(require,module,exports){module.exports={"name":"pict","version":"1.0.370","description":"Pict browser library.","main":"source/Pict.js","scripts":{"start":"node source/Pict.js","test":"npx quack test","tests":"npx quack test -g","coverage":"npx quack coverage","build":"npx quack build","prepublishOnly":"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 ."},"files":["source/","dist/","types/"],"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.39.1","@types/jquery":"^3.5.33","@types/sinon":"^17.0.4","eslint":"^9.39.1","globals":"^16.5.0","pict-docuserve":"^1.3.2","quackage":"^1.2.3","sinon":"^20.0.0","typescript":"^5.9.3"},"dependencies":{"cachetrax":"^1.0.6","fable":"^3.1.74","pict-application":"^1.0.34","pict-provider":"^1.0.13","pict-template":"^1.0.15","pict-view":"^1.0.68"}};},{}],193:[function(require,module,exports){// This assumes Pict has been required in the browser. Delcare these as globals so linter can do its job.
|
|
6095
6099
|
/* global Pict, _Pict: writeable *//**
|
|
6096
6100
|
* Simple function to load a pict Application
|
|
6097
6101
|
*
|
|
@@ -6879,7 +6883,13 @@ this.addTemplate(require(`./templates/Pict-Template-Icon.js`));// Look up an ent
|
|
|
6879
6883
|
// ...meaning GET BOOK with IDBook FROM AppData.Some.Address.IDBook and render it to Render-Book-Template
|
|
6880
6884
|
this.addTemplate(require(`./templates/Pict-Template-Entity.js`));// Child Template Expressions
|
|
6881
6885
|
// {~T:Template:AddressOfData~}
|
|
6882
|
-
this.addTemplate(require(`./templates/Pict-Template-Template.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateByDataAddress.js`));//
|
|
6886
|
+
this.addTemplate(require(`./templates/Pict-Template-Template.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateByDataAddress.js`));// Inline Template Expression -- parse the contents as a template at runtime
|
|
6887
|
+
// {<TEMPLATED CONTENT HERE, {~D:AppData.SomeValue~}.>}
|
|
6888
|
+
this.addTemplate(require(`./templates/Pict-Template-InlineTemplate.js`));// Function Expression -- call a function by address with addressed arguments
|
|
6889
|
+
// {~Function:Pict.providers.X.makeThing:Record.X:Record.Y~} / {~F:...~}
|
|
6890
|
+
this.addTemplate(require(`./templates/Pict-Template-Function.js`));// Addressed Template Expression -- resolve an address to a template string and render it
|
|
6891
|
+
// {[AppData.MyTemplate]}
|
|
6892
|
+
this.addTemplate(require(`./templates/Pict-Template-AddressedTemplate.js`));// {~SBR:AppData.Equation:AppData.HomeworkRectangleSize:AppData.HomeworkManifest~}
|
|
6883
6893
|
this.addTemplate(require(`./templates/Pict-Template-SolveByReference.js`));this.addTemplate(require(`./templates/Pict-Template-Solve.js`));// {~TS:Template:AddressOfDataSet~}
|
|
6884
6894
|
this.addTemplate(require(`./templates/Pict-Template-TemplateSet.js`));// {~TVS:Template:AddressOfDataSet~}
|
|
6885
6895
|
this.addTemplate(require(`./templates/Pict-Template-TemplateValueSet.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateSetWithPayload.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateFromMap.js`));this.addTemplate(require(`./templates/Pict-Template-TemplateSetFromMap.js`));// Logical Branching Template Expressions
|
|
@@ -6989,7 +6999,7 @@ let tmpValue="";if(typeof fCallback=="function"){if(Array.isArray(pDataSet)||typ
|
|
|
6989
6999
|
* @return {String?} The parsed template string, or undefined if a callback was provided
|
|
6990
7000
|
*/parseTemplateSetWithPayloadByHash(pTemplateHash,pDataSet,pPayload,fCallback,pContextArray,pScope,pState){let tmpTemplateString=this.TemplateProvider.getTemplate(pTemplateHash);// TODO: Unsure if returning empty is always the right behavior -- if it isn't we will use config to set the behavior
|
|
6991
7001
|
if(!tmpTemplateString){tmpTemplateString="";}return this.parseTemplateSetWithPayload(tmpTemplateString,pDataSet,pPayload,fCallback,pContextArray,pScope,pState);}}module.exports=Pict;module.exports.ServiceProviderBase=require('fable-serviceproviderbase');module.exports.PictApplicationClass=require("pict-application");module.exports.PictViewClass=require("pict-view");module.exports.PictProviderClass=require("pict-provider");module.exports.PictTemplateClass=require("pict-template");module.exports.EnvironmentLog=require("./environments/Pict-Environment-Log.js");module.exports.EnvironmentObject=require("./environments/Pict-Environment-Object.js");module.exports.FilterClauseBase=require('./filters/FilterClauseBase.js');module.exports.FilterClauseLocal=require('./filters/FilterClauseLocal.js');module.exports.FilterClauseInternalJoin=require('./filters/FilterClauseInternalJoin.js');module.exports.FilterClauseExternalJoin=require('./filters/FilterClauseExternalJoin.js');// This is to help understand the type of enivironement we're executing in
|
|
6992
|
-
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require(`./Pict-Browser-SafeOnDocumentReady.js`);module.exports.safeLoadPictApplication=require(`./Pict-Browser-SafeLoad.js`);},{"../package.json":192,"./Pict-Browser-SafeLoad.js":193,"./Pict-Browser-SafeOnDocumentReady.js":194,"./Pict-CSS.js":195,"./Pict-Content-Assignment.js":196,"./Pict-DataProvider.js":197,"./Pict-Meadow-EntityProvider.js":198,"./Pict-Template-Audit.js":199,"./Pict-Template-Provider.js":200,"./environments/Pict-Environment-Log.js":202,"./environments/Pict-Environment-Object.js":203,"./filters/FilterClauseBase.js":205,"./filters/FilterClauseExternalJoin.js":206,"./filters/FilterClauseInternalJoin.js":207,"./filters/FilterClauseLocal.js":208,"./providers/Provider-DataBroker.js":210,"./providers/Provider-Filter-Manager.js":211,"./providers/Provider-Icon.js":212,"./services/Fable-Service-TransactionTracking.js":213,"./templates/Pict-Template-
|
|
7002
|
+
module.exports.isBrowser=new Function("try {return (this===window);} catch(pError) {return false;}");module.exports.safeOnDocumentReady=require(`./Pict-Browser-SafeOnDocumentReady.js`);module.exports.safeLoadPictApplication=require(`./Pict-Browser-SafeLoad.js`);},{"../package.json":192,"./Pict-Browser-SafeLoad.js":193,"./Pict-Browser-SafeOnDocumentReady.js":194,"./Pict-CSS.js":195,"./Pict-Content-Assignment.js":196,"./Pict-DataProvider.js":197,"./Pict-Meadow-EntityProvider.js":198,"./Pict-Template-Audit.js":199,"./Pict-Template-Provider.js":200,"./environments/Pict-Environment-Log.js":202,"./environments/Pict-Environment-Object.js":203,"./filters/FilterClauseBase.js":205,"./filters/FilterClauseExternalJoin.js":206,"./filters/FilterClauseInternalJoin.js":207,"./filters/FilterClauseLocal.js":208,"./providers/Provider-DataBroker.js":210,"./providers/Provider-Filter-Manager.js":211,"./providers/Provider-Icon.js":212,"./services/Fable-Service-TransactionTracking.js":213,"./templates/Pict-Template-AddressedTemplate.js":214,"./templates/Pict-Template-Data.js":215,"./templates/Pict-Template-DataValueByKey.js":216,"./templates/Pict-Template-DataWithAbsoluteFallback.js":217,"./templates/Pict-Template-DataWithTemplateFallback.js":218,"./templates/Pict-Template-Entity.js":219,"./templates/Pict-Template-Function.js":220,"./templates/Pict-Template-Icon.js":221,"./templates/Pict-Template-InlineTemplate.js":222,"./templates/Pict-Template-Self.js":223,"./templates/Pict-Template-Solve.js":224,"./templates/Pict-Template-SolveByReference.js":225,"./templates/Pict-Template-Template.js":226,"./templates/Pict-Template-TemplateByDataAddress.js":227,"./templates/Pict-Template-TemplateByReference.js":228,"./templates/Pict-Template-TemplateByTypes.js":229,"./templates/Pict-Template-TemplateFromAddress.js":230,"./templates/Pict-Template-TemplateFromMap.js":231,"./templates/Pict-Template-TemplateSet.js":232,"./templates/Pict-Template-TemplateSetFromMap.js":233,"./templates/Pict-Template-TemplateSetWithPayload.js":234,"./templates/Pict-Template-TemplateValueSet.js":235,"./templates/Pict-Template-View.js":236,"./templates/data-generation/Pict-Template-RandomNumber.js":237,"./templates/data-generation/Pict-Template-RandomNumberString.js":238,"./templates/data/Pict-Template-DataEncodeJavascriptString.js":239,"./templates/data/Pict-Template-DataJson.js":240,"./templates/data/Pict-Template-DateOnlyFormat.js":241,"./templates/data/Pict-Template-DateOnlyYMD.js":242,"./templates/data/Pict-Template-DateTimeFormat.js":243,"./templates/data/Pict-Template-DateTimeYMD.js":244,"./templates/data/Pict-Template-Digits.js":245,"./templates/data/Pict-Template-Dollars.js":246,"./templates/data/Pict-Template-HtmlCommentEnd.js":247,"./templates/data/Pict-Template-HtmlCommentStart.js":248,"./templates/data/Pict-Template-Join.js":249,"./templates/data/Pict-Template-JoinUnique.js":250,"./templates/data/Pict-Template-PascalCaseIdentifier.js":251,"./templates/data/Pict-Template-PluckJoinUnique.js":252,"./templates/debugging/Pict-Template-Breakpoint.js":253,"./templates/debugging/Pict-Template-DataValueTree.js":254,"./templates/debugging/Pict-Template-LogStatement.js":255,"./templates/debugging/Pict-Template-LogValue.js":256,"./templates/debugging/Pict-Template-LogValueTree.js":257,"./templates/logic/Pict-Template-NotEmpty.js":258,"./templates/logic/Pict-Template-TemplateIf.js":260,"./templates/logic/Pict-Template-TemplateIfAbsolute.js":261,"fable":68,"fable-serviceproviderbase":59,"pict-application":140,"pict-provider":142,"pict-template":144,"pict-view":146}],202:[function(require,module,exports){/**
|
|
6993
7003
|
* Pict browser shim loader
|
|
6994
7004
|
* @author <steven@velozo.com>
|
|
6995
7005
|
*
|
|
@@ -7649,7 +7659,49 @@ return this.transactionMap[pKey];}this.transactionMap[pKey]={TransactionKey:pKey
|
|
|
7649
7659
|
* @return {boolean} true if the event is new, false if it has already been registered
|
|
7650
7660
|
*/checkEvent(pKey,pEvent,pHash){let tmpHash=typeof pHash==='string'?pHash:'';let tmpTransaction=this.transactionMap[pKey];if(tmpTransaction==null){this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] does not exist; auto creating...`);tmpTransaction=this.registerTransaction(pKey);}if(tmpTransaction.Events[pEvent]==null){tmpTransaction.Events[pEvent]={};}if(tmpHash in tmpTransaction.Events[pEvent]){//this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] firing a second time...`);
|
|
7651
7661
|
this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] already exists in transaction [${pKey}]`,'Event');return false;}else{//this.log.warn(`TransactionTracking checkTransactionEvent event [${pEvent}]->[${tmpHash}] key [${pKey}] firing a first time...`);
|
|
7652
|
-
this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] registered in transaction [${pKey}]`,'Event');tmpTransaction.Events[pEvent][tmpHash]=true;return true;}}}module.exports=TransactionTracking;/** @type {Record<string, any>} */TransactionTracking.default_configuration={};},{"fable-serviceproviderbase":59}],214:[function(require,module,exports){const libPictTemplate=require('pict-template')
|
|
7662
|
+
this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] registered in transaction [${pKey}]`,'Event');tmpTransaction.Events[pEvent][tmpHash]=true;return true;}}}module.exports=TransactionTracking;/** @type {Record<string, any>} */TransactionTracking.default_configuration={};},{"fable-serviceproviderbase":59}],214:[function(require,module,exports){const libPictTemplate=require('pict-template');/**
|
|
7663
|
+
* Addressed Template expression.
|
|
7664
|
+
*
|
|
7665
|
+
* {[AppData.MyTemplate]}
|
|
7666
|
+
*
|
|
7667
|
+
* Looks up the value at the given address (resolved through the same
|
|
7668
|
+
* scope as {~D:~} -- Record, AppData, Pict, Bundle, Context, Scope,
|
|
7669
|
+
* TempData, __State) and renders it as a template against the current
|
|
7670
|
+
* Record/Context/Scope/State. Pairs with the inline template `{<...>}`:
|
|
7671
|
+
*
|
|
7672
|
+
* {<inline body, parsed at runtime>}
|
|
7673
|
+
* {[AppData.PathToTemplateString]} <- body is *stored* at the address
|
|
7674
|
+
*
|
|
7675
|
+
* If the address does not resolve, or resolves to a non-string, a warning
|
|
7676
|
+
* is logged that names the address and the full expression, and the
|
|
7677
|
+
* expression renders as ''.
|
|
7678
|
+
*/class PictTemplateProviderAddressedTemplate extends libPictTemplate{/**
|
|
7679
|
+
* @param {Object} pFable - The Fable Framework instance
|
|
7680
|
+
* @param {Object} pOptions - The options for the service
|
|
7681
|
+
* @param {String} pServiceHash - The hash of the service
|
|
7682
|
+
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);/** @type {any} */this.log;this.addPattern('{[',']}');}/**
|
|
7683
|
+
* Render the addressed template: resolve the address to a template
|
|
7684
|
+
* string and parse it against the current scope.
|
|
7685
|
+
*
|
|
7686
|
+
* @param {string} pTemplateHash - The address (what's between `{[` and `]}`)
|
|
7687
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7688
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7689
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7690
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7691
|
+
*
|
|
7692
|
+
* @return {string} The rendered template, or '' when the address can't be resolved to a string.
|
|
7693
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpAddress=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fAddressedTemplateRender]::[${tmpAddress}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fAddressedTemplateRender]::[${tmpAddress}]`);}if(tmpAddress.length<1){this.log.warn(`Pict: Addressed Template Render: No address provided in expression [{[${pTemplateHash}]}]`);return'';}let tmpTemplate=this.resolveStateFromAddress(tmpAddress,tmpRecord,pContextArray,null,pScope,pState);if(tmpTemplate==null){this.log.warn(`Pict: Addressed Template Render: Address [${tmpAddress}] did not resolve for expression [{[${pTemplateHash}]}]`);return'';}if(typeof tmpTemplate!=='string'){this.log.warn(`Pict: Addressed Template Render: Address [${tmpAddress}] resolved to a non-string (${typeof tmpTemplate}) for expression [{[${pTemplateHash}]}]`);return'';}if(tmpTemplate.length<1){return'';}return this.pict.parseTemplate(tmpTemplate,pRecord,null,pContextArray,pScope,pState);}/**
|
|
7694
|
+
* Render the addressed template asynchronously.
|
|
7695
|
+
*
|
|
7696
|
+
* @param {string} pTemplateHash - The address (what's between `{[` and `]}`)
|
|
7697
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7698
|
+
* @param {(error?: Error, content?: String) => void} fCallback - callback function invoked with the rendered template, or an error
|
|
7699
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7700
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7701
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7702
|
+
*
|
|
7703
|
+
* @return {void}
|
|
7704
|
+
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){let tmpAddress=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fAddressedTemplateRenderAsync]::[${tmpAddress}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fAddressedTemplateRenderAsync]::[${tmpAddress}]`);}if(tmpAddress.length<1){this.log.warn(`Pict: Addressed Template Render: No address provided in expression [{[${pTemplateHash}]}]`);return tmpCallback(null,'');}let tmpTemplate=this.resolveStateFromAddress(tmpAddress,tmpRecord,pContextArray,null,pScope,pState);if(tmpTemplate==null){this.log.warn(`Pict: Addressed Template Render: Address [${tmpAddress}] did not resolve for expression [{[${pTemplateHash}]}]`);return tmpCallback(null,'');}if(typeof tmpTemplate!=='string'){this.log.warn(`Pict: Addressed Template Render: Address [${tmpAddress}] resolved to a non-string (${typeof tmpTemplate}) for expression [{[${pTemplateHash}]}]`);return tmpCallback(null,'');}if(tmpTemplate.length<1){return tmpCallback(null,'');}this.pict.parseTemplate(tmpTemplate,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderAddressedTemplate;module.exports.template_hash='AddressedTemplate';},{"pict-template":144}],215:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderData extends libPictTemplate{/**
|
|
7653
7705
|
* @param {Object} pFable - The Fable Framework instance
|
|
7654
7706
|
* @param {Object} pOptions - The options for the service
|
|
7655
7707
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7663,7 +7715,7 @@ this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] registered in transa
|
|
|
7663
7715
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7664
7716
|
*
|
|
7665
7717
|
* @return {string} The rendered template
|
|
7666
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpDefaultValue='';if(tmpHash.indexOf(':')>-1){tmpDefaultValue=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}let tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray,null,pScope,pState);}if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'||tmpValue===''){return tmpDefaultValue;}return tmpValue;}}module.exports=PictTemplateProviderData;},{"pict-template":144}],
|
|
7718
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpDefaultValue='';if(tmpHash.indexOf(':')>-1){tmpDefaultValue=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}let tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray,null,pScope,pState);}if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'||tmpValue===''){return tmpDefaultValue;}return tmpValue;}}module.exports=PictTemplateProviderData;},{"pict-template":144}],216:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDataValueByKey extends libPictTemplate{/**
|
|
7667
7719
|
* @param {Object} pFable - The Fable Framework instance
|
|
7668
7720
|
* @param {Object} pOptions - The options for the service
|
|
7669
7721
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7677,7 +7729,7 @@ this.logToTransaction(pKey,`Event [${pEvent}]->[${tmpHash}] registered in transa
|
|
|
7677
7729
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7678
7730
|
*
|
|
7679
7731
|
* @return {string} The rendered template
|
|
7680
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpHashArray=tmpHash.split(':');if(tmpHashArray.length<2){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] failed because there were not two stanzas in the expression [${pTemplateHash}]`);return'';}let tmpDefaultValue='';if(tmpHashArray.length>2){tmpDefaultValue=tmpHashArray[2];}let tmpValueObject=this.resolveStateFromAddress(tmpHashArray[0],tmpRecord,pContextArray,null,pScope,pState);let tmpValueAddress=this.resolveStateFromAddress(tmpHashArray[1],tmpRecord,pContextArray,null,pScope,pState);let tmpValue=this.pict.manifest.getValueByHash(tmpValueObject,tmpValueAddress);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return tmpDefaultValue;}return tmpValue;}}module.exports=PictTemplateProviderDataValueByKey;},{"pict-template":144}],
|
|
7732
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpHashArray=tmpHash.split(':');if(tmpHashArray.length<2){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] failed because there were not two stanzas in the expression [${pTemplateHash}]`);return'';}let tmpDefaultValue='';if(tmpHashArray.length>2){tmpDefaultValue=tmpHashArray[2];}let tmpValueObject=this.resolveStateFromAddress(tmpHashArray[0],tmpRecord,pContextArray,null,pScope,pState);let tmpValueAddress=this.resolveStateFromAddress(tmpHashArray[1],tmpRecord,pContextArray,null,pScope,pState);let tmpValue=this.pict.manifest.getValueByHash(tmpValueObject,tmpValueAddress);if(tmpValue==null||tmpValue=='undefined'||typeof tmpValue=='undefined'){return tmpDefaultValue;}return tmpValue;}}module.exports=PictTemplateProviderDataValueByKey;},{"pict-template":144}],217:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderData extends libPictTemplate{/**
|
|
7681
7733
|
* @param {Object} pFable - The Fable Framework instance
|
|
7682
7734
|
* @param {Object} pOptions - The options for the service
|
|
7683
7735
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7705,7 +7757,7 @@ return tmpAbsoluteFallbackValue;}/**
|
|
|
7705
7757
|
*
|
|
7706
7758
|
* @return {void} The result is passed to the callback function
|
|
7707
7759
|
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT DataWithAbsoluteFallback [fDataRender]::[${tmpHash}] with tmpRecord:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithAbsoluteFallback [fDataRender]::[${tmpHash}]`);}let tmpAbsoluteFallbackValue='';if(tmpHash.indexOf(':')>-1){tmpAbsoluteFallbackValue=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}let tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray,null,pScope,pState);if(tmpValue&&tmpValue!=='undefined'){if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithAbsoluteFallback [fDataRender]::[${tmpHash}] - Found value: ${tmpValue}`);}return tmpCallback(null,tmpValue);}}// If the value is not found or is undefined, use the fallback value
|
|
7708
|
-
return tmpCallback(null,tmpAbsoluteFallbackValue);}}module.exports=PictTemplateProviderData;},{"pict-template":144}],
|
|
7760
|
+
return tmpCallback(null,tmpAbsoluteFallbackValue);}}module.exports=PictTemplateProviderData;},{"pict-template":144}],218:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderData extends libPictTemplate{/**
|
|
7709
7761
|
* @param {Object} pFable - The Fable Framework instance
|
|
7710
7762
|
* @param {Object} pOptions - The options for the service
|
|
7711
7763
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7735,7 +7787,7 @@ return'';}if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFall
|
|
|
7735
7787
|
* @return {void} The result is passed to the callback function
|
|
7736
7788
|
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] with tmpRecord:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}]`);}let tmpTemplateFallbackAddress='';if(tmpHash.indexOf(':')>-1){tmpTemplateFallbackAddress=tmpHash.split(':')[1];tmpHash=tmpHash.split(':')[0];}let tmpValue='';if(tmpHash!=null){tmpValue=this.resolveStateFromAddress(tmpHash,tmpRecord,pContextArray,null,pScope,pState);if(tmpValue&&tmpValue!=='undefined'){if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] - Found value: ${tmpValue}`);}return tmpCallback(null,tmpValue);}}// If the value is not found or is undefined, try to use the fallback template
|
|
7737
7789
|
this.pict.parseTemplateByHash(tmpTemplateFallbackAddress,tmpRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}if(pValue==null||pValue===''){this.log.warn(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] - No fallback template found at address: ${tmpTemplateFallbackAddress}`);// If no fallback template is found, return an empty string
|
|
7738
|
-
return tmpCallback(null,'');}if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] - Using fallback template from address: ${tmpTemplateFallbackAddress}`);}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderData;},{"pict-template":144}],
|
|
7790
|
+
return tmpCallback(null,'');}if(this.pict.LogNoisiness>3){this.log.trace(`PICT DataWithTemplateFallback [fDataRender]::[${tmpHash}] - Using fallback template from address: ${tmpTemplateFallbackAddress}`);}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderData;},{"pict-template":144}],219:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderEntity extends libPictTemplate{/**
|
|
7739
7791
|
* @param {Object} pFable - The Fable Framework instance
|
|
7740
7792
|
* @param {Object} pOptions - The options for the service
|
|
7741
7793
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7766,7 +7818,43 @@ let tmpAddressParts=tmpHash.split('^');if(tmpAddressParts.length<2){this.log.war
|
|
|
7766
7818
|
tmpEntityID=this.resolveStateFromAddress(String(tmpEntityID),tmpData,pContextArray,null,pScope,pState);}// No Entity or EntityID
|
|
7767
7819
|
if(!tmpEntity||!tmpEntityID){this.log.warn(`Pict: Entity Render: Entity or entity ID not resolved for [${tmpHash}] Entity: ${tmpEntity} ID: ${tmpEntityID}`);return tmpCallback(null,'');}if(this.pict.LogNoisiness>3){this.log.trace(`Pict: Entity Render: Entity [${tmpEntity}] with ID [${tmpEntityID}] as template [${tmpEntityTemplate}] from [${tmpHash}]`);}// Now try to get the entity
|
|
7768
7820
|
this.pict.EntityProvider.getEntity(tmpEntity,tmpEntityID,function(pError,pRecord){if(pError){this.log.error(`Pict: Entity Render: Error getting entity [${tmpEntity}] with ID [${tmpEntityID}] for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}// Now render the template
|
|
7769
|
-
if(tmpEntityTemplate){this.pict.parseTemplateByHash(tmpEntityTemplate,pRecord,tmpCallback,pContextArray,pScope,pState);}else{tmpCallback(null,'');}}.bind(this));}}module.exports=PictTemplateProviderEntity;},{"pict-template":144}],
|
|
7821
|
+
if(tmpEntityTemplate){this.pict.parseTemplateByHash(tmpEntityTemplate,pRecord,tmpCallback,pContextArray,pScope,pState);}else{tmpCallback(null,'');}}.bind(this));}}module.exports=PictTemplateProviderEntity;},{"pict-template":144}],220:[function(require,module,exports){const libPictTemplate=require('pict-template');/**
|
|
7822
|
+
* Function template expression.
|
|
7823
|
+
*
|
|
7824
|
+
* {~Function:Pict.providers.SomeProvider.makeThing:Record.X:Record.Y~}
|
|
7825
|
+
* {~F:Pict.providers.SomeProvider.makeThing:Record.X:Record.Y~}
|
|
7826
|
+
*
|
|
7827
|
+
* First parameter is the address of a function to call (resolved with
|
|
7828
|
+
* `pict.resolveStateFromAddress` against the usual root: Record, AppData,
|
|
7829
|
+
* Pict, Bundle, Context, Scope, TempData, __State). Each subsequent
|
|
7830
|
+
* `:`-separated parameter is itself an address whose resolved value is
|
|
7831
|
+
* passed as an argument to the function. Arity is dynamic.
|
|
7832
|
+
*
|
|
7833
|
+
* Returns whatever the function returns (coerced to '' when null /
|
|
7834
|
+
* undefined). If the address does not resolve to a function, a warning is
|
|
7835
|
+
* logged that names the address and the full template expression, and the
|
|
7836
|
+
* expression renders as ''. If the function throws, the error is logged
|
|
7837
|
+
* and the expression renders as ''.
|
|
7838
|
+
*
|
|
7839
|
+
* `this` is bound to the address's parent object so instance methods work
|
|
7840
|
+
* naturally: `Pict.providers.X.go(...)` invokes with `this === Pict.providers.X`.
|
|
7841
|
+
*/class PictTemplateProviderFunction extends libPictTemplate{/**
|
|
7842
|
+
* @param {Object} pFable - The Fable Framework instance
|
|
7843
|
+
* @param {Object} pOptions - The options for the service
|
|
7844
|
+
* @param {String} pServiceHash - The hash of the service
|
|
7845
|
+
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);/** @type {any} */this.log;this.addPattern('{~Function:','~}');this.addPattern('{~F:','~}');}/**
|
|
7846
|
+
* Render the Function expression: call the resolved function with the
|
|
7847
|
+
* resolved arguments and return its result.
|
|
7848
|
+
*
|
|
7849
|
+
* @param {string} pTemplateHash - The hash contents of the template (what's between the template start and stop tags)
|
|
7850
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7851
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7852
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7853
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7854
|
+
*
|
|
7855
|
+
* @return {string} The function's return value, stringified by the template engine; '' if the function is missing or throws.
|
|
7856
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fFunctionRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fFunctionRender]::[${tmpHash}]`);}let tmpParts=tmpHash.split(':');let tmpFunctionAddress=tmpParts.length>0?tmpParts[0].trim():'';if(tmpFunctionAddress.length<1){this.log.warn(`Pict: Function Render: No function address provided in template [{~Function:${tmpHash}~}]`);return'';}let tmpFunction=this.resolveStateFromAddress(tmpFunctionAddress,tmpRecord,pContextArray,null,pScope,pState);if(typeof tmpFunction!=='function'){this.log.warn(`Pict: Function Render: Function not found at address [${tmpFunctionAddress}] for template [{~Function:${tmpHash}~}]`);return'';}// Resolve `this` to the function's parent so instance methods bind naturally.
|
|
7857
|
+
let tmpThis=null;let tmpLastDot=tmpFunctionAddress.lastIndexOf('.');if(tmpLastDot>0){let tmpParentAddress=tmpFunctionAddress.substring(0,tmpLastDot);tmpThis=this.resolveStateFromAddress(tmpParentAddress,tmpRecord,pContextArray,null,pScope,pState);}let tmpArguments=[];for(let i=1;i<tmpParts.length;i++){tmpArguments.push(this.resolveStateFromAddress(tmpParts[i],tmpRecord,pContextArray,null,pScope,pState));}try{let tmpResult=tmpFunction.apply(tmpThis,tmpArguments);if(tmpResult==null){return'';}return tmpResult;}catch(pError){this.log.warn(`Pict: Function Render: Error invoking function at [${tmpFunctionAddress}] for template [{~Function:${tmpHash}~}]: ${pError.message}`);return'';}}}module.exports=PictTemplateProviderFunction;module.exports.template_hash='Function';},{"pict-template":144}],221:[function(require,module,exports){const libPictTemplate=require('pict-template');/**
|
|
7770
7858
|
* Icon template tag — emits a themable SVG icon by PascalCase name.
|
|
7771
7859
|
*
|
|
7772
7860
|
* {~Icon:Home~} → default variant for 'Home'
|
|
@@ -7795,7 +7883,46 @@ if(tmpEntityTemplate){this.pict.parseTemplateByHash(tmpEntityTemplate,pRecord,tm
|
|
|
7795
7883
|
*/render(pTemplateHash){let tmpBody=(pTemplateHash||'').trim();if(tmpBody.length<1){return'';}let tmpName=tmpBody;let tmpVariant=null;let tmpColon=tmpBody.indexOf(':');if(tmpColon>-1){tmpName=tmpBody.slice(0,tmpColon).trim();tmpVariant=tmpBody.slice(tmpColon+1).trim();}let tmpProvider=this.pict&&this.pict.providers&&this.pict.providers.Icon;if(!tmpProvider||typeof tmpProvider.get!=='function'){// Provider missing — should never happen in a normally-booted
|
|
7796
7884
|
// Pict app, but degrade silently rather than emit something
|
|
7797
7885
|
// that looks like a template tag.
|
|
7798
|
-
return'';}let tmpOpts=tmpVariant?{variant:tmpVariant}:undefined;return tmpProvider.get(tmpName,tmpOpts);}}module.exports=PictTemplateProviderIcon;},{"pict-template":144}],
|
|
7886
|
+
return'';}let tmpOpts=tmpVariant?{variant:tmpVariant}:undefined;return tmpProvider.get(tmpName,tmpOpts);}}module.exports=PictTemplateProviderIcon;},{"pict-template":144}],222:[function(require,module,exports){const libPictTemplate=require('pict-template');/**
|
|
7887
|
+
* Inline Template expression.
|
|
7888
|
+
*
|
|
7889
|
+
* Captures its raw contents (verbatim, including any other pict template
|
|
7890
|
+
* tags) and processes them as a template at runtime. At render time the
|
|
7891
|
+
* captured string is fed back through `pict.parseTemplate(...)` with the
|
|
7892
|
+
* same Record/Context/Scope/State that was active at the outer scope.
|
|
7893
|
+
*
|
|
7894
|
+
* {<TEMPLATED CONTENT HERE, {~D:AppData.SomeValue~}.>}
|
|
7895
|
+
*
|
|
7896
|
+
* Direct nesting of `{<...>}` inside another `{<...>}` is not supported;
|
|
7897
|
+
* the first `>}` closes the outer block. Wrap the inner literal in a
|
|
7898
|
+
* registered template hash and reference it with `{~T:Hash~}` for that.
|
|
7899
|
+
*/class PictTemplateProviderInlineTemplate extends libPictTemplate{/**
|
|
7900
|
+
* @param {Object} pFable - The Fable Framework instance
|
|
7901
|
+
* @param {Object} pOptions - The options for the service
|
|
7902
|
+
* @param {String} pServiceHash - The hash of the service
|
|
7903
|
+
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);/** @type {any} */this.log;this.addPattern('{<','>}');}/**
|
|
7904
|
+
* Render an inline template expression, returning a string with the
|
|
7905
|
+
* processed template content.
|
|
7906
|
+
*
|
|
7907
|
+
* @param {string} pTemplateBody - The raw inline template body (what was between `{<` and `>}`)
|
|
7908
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7909
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7910
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7911
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7912
|
+
*
|
|
7913
|
+
* @return {string} The rendered template
|
|
7914
|
+
*/render(pTemplateBody,pRecord,pContextArray,pScope,pState){let tmpBody=typeof pTemplateBody==='string'?pTemplateBody:'';if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fInlineTemplateRender]::[${tmpBody}] with tmpData:`,pRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fInlineTemplateRender]::[${tmpBody}]`);}if(tmpBody.length<1){return'';}return this.pict.parseTemplate(tmpBody,pRecord,null,pContextArray,pScope,pState);}/**
|
|
7915
|
+
* Render an inline template expression, delivering the result to a callback.
|
|
7916
|
+
*
|
|
7917
|
+
* @param {string} pTemplateBody - The raw inline template body (what was between `{<` and `>}`)
|
|
7918
|
+
* @param {any} pRecord - The json object to be used as the Record for the template render
|
|
7919
|
+
* @param {(error?: Error, content?: String) => void} fCallback - callback function invoked with the rendered template, or an error
|
|
7920
|
+
* @param {Array<any>} pContextArray - An array of context objects accessible from the template; safe to leave empty
|
|
7921
|
+
* @param {any} [pScope] - A sticky scope that can be used to carry state and simplify template
|
|
7922
|
+
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7923
|
+
*
|
|
7924
|
+
* @return {void}
|
|
7925
|
+
*/renderAsync(pTemplateBody,pRecord,fCallback,pContextArray,pScope,pState){let tmpBody=typeof pTemplateBody==='string'?pTemplateBody:'';let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fInlineTemplateRenderAsync]::[${tmpBody}] with tmpData:`,pRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fInlineTemplateRenderAsync]::[${tmpBody}]`);}if(tmpBody.length<1){return tmpCallback(null,'');}this.pict.parseTemplate(tmpBody,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderInlineTemplate;module.exports.template_hash='InlineTemplate';},{"pict-template":144}],223:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderSelf extends libPictTemplate{/**
|
|
7799
7926
|
* @param {Object} pFable - The Fable Framework instance
|
|
7800
7927
|
* @param {Object} pOptions - The options for the service
|
|
7801
7928
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7809,7 +7936,7 @@ return'';}let tmpOpts=tmpVariant?{variant:tmpVariant}:undefined;return tmpProvid
|
|
|
7809
7936
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
7810
7937
|
*
|
|
7811
7938
|
* @return {string} The rendered template
|
|
7812
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){return this.pict.browserAddress;}}module.exports=PictTemplateProviderSelf;},{"pict-template":144}],
|
|
7939
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){return this.pict.browserAddress;}}module.exports=PictTemplateProviderSelf;},{"pict-template":144}],224:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderSolve extends libPictTemplate{/**
|
|
7813
7940
|
* @param {Object} pFable - The Fable Framework instance
|
|
7814
7941
|
* @param {Object} pOptions - The options for the service
|
|
7815
7942
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7824,7 +7951,7 @@ return'';}let tmpOpts=tmpVariant?{variant:tmpVariant}:undefined;return tmpProvid
|
|
|
7824
7951
|
*
|
|
7825
7952
|
* @return {string} The rendered template
|
|
7826
7953
|
*/render(pSolveParams,pRecord,pContextArray,pScope,pState){// {~S:ROUND(250*0.4129+Width,3):AppData.HomeworkRectangleSize:AppData.HomeworkManifest~}
|
|
7827
|
-
const[tmpEquation,tmpRecordAddress,tmpManifestAddress]=pSolveParams.trim().split(':',3);const tmpContextualRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Solve [fTemplateRender]::[${pSolveParams}] with tmpData:`,tmpContextualRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Solve [fTemplateRender]::[${pSolveParams}]`);}if(!tmpEquation){if(this.pict.LogNoisiness>2){this.log.warn(`Pict: Solve: Equation not found for [${tmpEquation}]`);}return'';}const tmpRecord=tmpRecordAddress&&this.pict.resolveStateFromAddress(tmpRecordAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||tmpContextualRecord;const tmpManifest=tmpManifestAddress&&this.pict.resolveStateFromAddress(tmpManifestAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||this.pict.manifest;const expressionParser=this.fable.instantiateServiceProviderIfNotExists('ExpressionParser');const tmpResultObject={};return expressionParser.solve(tmpEquation,tmpRecord,tmpResultObject,tmpManifest,tmpRecord);}}module.exports=PictTemplateProviderSolve;},{"pict-template":144}],
|
|
7954
|
+
const[tmpEquation,tmpRecordAddress,tmpManifestAddress]=pSolveParams.trim().split(':',3);const tmpContextualRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Solve [fTemplateRender]::[${pSolveParams}] with tmpData:`,tmpContextualRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Solve [fTemplateRender]::[${pSolveParams}]`);}if(!tmpEquation){if(this.pict.LogNoisiness>2){this.log.warn(`Pict: Solve: Equation not found for [${tmpEquation}]`);}return'';}const tmpRecord=tmpRecordAddress&&this.pict.resolveStateFromAddress(tmpRecordAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||tmpContextualRecord;const tmpManifest=tmpManifestAddress&&this.pict.resolveStateFromAddress(tmpManifestAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||this.pict.manifest;const expressionParser=this.fable.instantiateServiceProviderIfNotExists('ExpressionParser');const tmpResultObject={};return expressionParser.solve(tmpEquation,tmpRecord,tmpResultObject,tmpManifest,tmpRecord);}}module.exports=PictTemplateProviderSolve;},{"pict-template":144}],225:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderSolveByReference extends libPictTemplate{/**
|
|
7828
7955
|
* @param {Object} pFable - The Fable Framework instance
|
|
7829
7956
|
* @param {Object} pOptions - The options for the service
|
|
7830
7957
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7839,7 +7966,7 @@ const[tmpEquation,tmpRecordAddress,tmpManifestAddress]=pSolveParams.trim().split
|
|
|
7839
7966
|
*
|
|
7840
7967
|
* @return {string} The rendered template
|
|
7841
7968
|
*/render(pSolveParams,pRecord,pContextArray,pScope,pState){// {~SBR:AppData.Equation:AppData.HomeworkRectangleSize:AppData.HomeworkManifest~}
|
|
7842
|
-
const[tmpEquationAddress,tmpRecordAddress,tmpManifestAddress]=pSolveParams.trim().split(':',3);const tmpContextualRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT SolveByReference [fTemplateRender]::[${pSolveParams}] with tmpData:`,tmpContextualRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT SolveByReference [fTemplateRender]::[${pSolveParams}]`);}const tmpEquation=this.pict.resolveStateFromAddress(tmpEquationAddress,tmpContextualRecord,pContextArray,null,pScope,pState);if(!tmpEquation){if(this.pict.LogNoisiness>2){this.log.warn(`Pict: SolveByReference: Equation not found for [${tmpEquationAddress}]`);}return'';}const tmpRecord=tmpRecordAddress&&this.pict.resolveStateFromAddress(tmpRecordAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||tmpContextualRecord;const tmpManifest=tmpManifestAddress&&this.pict.resolveStateFromAddress(tmpManifestAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||this.pict.manifest;const expressionParser=this.fable.instantiateServiceProviderIfNotExists('ExpressionParser');const tmpResultObject={};return expressionParser.solve(tmpEquation,tmpRecord,tmpResultObject,tmpManifest,tmpRecord);}}module.exports=PictTemplateProviderSolveByReference;},{"pict-template":144}],
|
|
7969
|
+
const[tmpEquationAddress,tmpRecordAddress,tmpManifestAddress]=pSolveParams.trim().split(':',3);const tmpContextualRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT SolveByReference [fTemplateRender]::[${pSolveParams}] with tmpData:`,tmpContextualRecord);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT SolveByReference [fTemplateRender]::[${pSolveParams}]`);}const tmpEquation=this.pict.resolveStateFromAddress(tmpEquationAddress,tmpContextualRecord,pContextArray,null,pScope,pState);if(!tmpEquation){if(this.pict.LogNoisiness>2){this.log.warn(`Pict: SolveByReference: Equation not found for [${tmpEquationAddress}]`);}return'';}const tmpRecord=tmpRecordAddress&&this.pict.resolveStateFromAddress(tmpRecordAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||tmpContextualRecord;const tmpManifest=tmpManifestAddress&&this.pict.resolveStateFromAddress(tmpManifestAddress,tmpContextualRecord,pContextArray,null,pScope,pState)||this.pict.manifest;const expressionParser=this.fable.instantiateServiceProviderIfNotExists('ExpressionParser');const tmpResultObject={};return expressionParser.solve(tmpEquation,tmpRecord,tmpResultObject,tmpManifest,tmpRecord);}}module.exports=PictTemplateProviderSolveByReference;},{"pict-template":144}],226:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplate extends libPictTemplate{/**
|
|
7843
7970
|
* @param {Object} pFable - The Fable Framework instance
|
|
7844
7971
|
* @param {Object} pOptions - The options for the service
|
|
7845
7972
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7871,7 +7998,7 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray,
|
|
|
7871
7998
|
let tmpHashTemplateSeparator=tmpHash.indexOf(':');tmpTemplateHash=tmpHash.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpHash.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateHash=tmpHash;}// No template hash
|
|
7872
7999
|
if(!tmpTemplateHash){this.log.warn(`Pict: Template Render Async: TemplateHash not resolved for [${tmpHash}]`);return fCallback(null,'');}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
7873
8000
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
7874
|
-
this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplate;},{"pict-template":144}],
|
|
8001
|
+
this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplate;},{"pict-template":144}],227:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateByDataAddress extends libPictTemplate{/**
|
|
7875
8002
|
* @param {Object} pFable - The Fable Framework instance
|
|
7876
8003
|
* @param {Object} pOptions - The options for the service
|
|
7877
8004
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7903,7 +8030,7 @@ return this.pict.parseTemplate(tmpTemplate,pRecord,null,pContextArray,pScope,pSt
|
|
|
7903
8030
|
let tmpHashTemplateSeparator=tmpDataAddress.indexOf(':');tmpTemplateDataAddress=tmpDataAddress.substring(0,tmpHashTemplateSeparator);if(tmpHashTemplateSeparator>-1){tmpAddressOfData=tmpDataAddress.substring(tmpHashTemplateSeparator+1);}else{tmpTemplateDataAddress=tmpDataAddress;}// No template hash
|
|
7904
8031
|
if(!tmpTemplateDataAddress){this.log.warn(`Pict: Template Render Async: TemplateHash not resolved for [${tmpDataAddress}]`);return tmpCallback(null,'');}let tmpTemplate=this.pict.resolveStateFromAddress(tmpTemplateDataAddress,pRecord,pContextArray,null,pScope,pState)||'';if(!tmpTemplate){if(this.pict.LogNoisiness>2){this.log.warn(`Pict: Template Render: Template not found for [${tmpTemplateDataAddress}]`);}tmpTemplate='';}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
7905
8032
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
7906
|
-
this.pict.parseTemplate(tmpTemplate,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplate(tmpTemplate,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateByDataAddress;},{"pict-template":144}],
|
|
8033
|
+
this.pict.parseTemplate(tmpTemplate,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplate(tmpTemplate,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateByDataAddress;},{"pict-template":144}],228:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplate extends libPictTemplate{/**
|
|
7907
8034
|
* @param {Object} pFable - The Fable Framework instance
|
|
7908
8035
|
* @param {Object} pOptions - The options for the service
|
|
7909
8036
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7939,7 +8066,7 @@ if(!tmpTemplateHashReferenceLocation){this.log.warn(`Pict: Template Render Async
|
|
|
7939
8066
|
let tmpTemplateHash=this.resolveStateFromAddress(tmpTemplateHashReferenceLocation,pRecord,pContextArray,null,pScope,pState);// No template hash
|
|
7940
8067
|
if(!tmpTemplateHash){this.log.warn(`Pict: Template Render Async: TemplateHash not resolved for [${tmpHash}]`);return fCallback(null,'');}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
7941
8068
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
7942
|
-
this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplate;},{"pict-template":144}],
|
|
8069
|
+
this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplate;},{"pict-template":144}],229:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateByTypes extends libPictTemplate{/**
|
|
7943
8070
|
* @param {Object} pFable - The Fable Framework instance
|
|
7944
8071
|
* @param {Object} pOptions - The options for the service
|
|
7945
8072
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -7972,7 +8099,7 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,tmpRecord,null,pContextArra
|
|
|
7972
8099
|
let tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){return fCallback(null,'');}tmpAddressToTest=tmpTemplateHashes[0];tmpDataTypesToTest=tmpTemplateHashes[1].split(',');tmpTemplateHash=tmpTemplateHashes[2];if(tmpTemplateHashes.length>3){tmpAddressOfData=tmpTemplateHashes[3];}if(tmpTemplateHashes.length>4){tmpFallbackTemplate=tmpTemplateHashes[4];}// No template hash
|
|
7973
8100
|
if(!tmpTemplateHash){return fCallback(null,'');}let tmpRecord=pRecord;if(tmpAddressOfData){tmpRecord=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState);}const tmpValueAtAddress=this.resolveStateFromAddress(tmpAddressToTest,tmpData,pContextArray,null,pScope,pState);/** @type {string} */let tmpTypeOfDataAtAddress=typeof tmpValueAtAddress;if(tmpTypeOfDataAtAddress=='object'&&Array.isArray(tmpValueAtAddress)){tmpTypeOfDataAtAddress='array';}if(tmpDataTypesToTest.indexOf(tmpTypeOfDataAtAddress)===-1){// Type not found, use the fallback template if we have one.
|
|
7974
8101
|
if(tmpFallbackTemplate){tmpTemplateHash=tmpFallbackTemplate;}else{return fCallback(null,'');}}// No address was provided, just render the template with what this template has.
|
|
7975
|
-
this.pict.parseTemplateByHash(tmpTemplateHash,tmpRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderTemplateByTypes;},{"pict-template":144}],
|
|
8102
|
+
this.pict.parseTemplateByHash(tmpTemplateHash,tmpRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderTemplateByTypes;},{"pict-template":144}],230:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateFromAddress extends libPictTemplate{/**
|
|
7976
8103
|
* @param {Object} pFable - The Fable Framework instance
|
|
7977
8104
|
* @param {Object} pOptions - The options for the service
|
|
7978
8105
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8008,7 +8135,7 @@ if(!tmpTemplateContentAddress){this.log.warn(`Pict: Template Render Async: Templ
|
|
|
8008
8135
|
let tmpTemplateContent=this.resolveStateFromAddress(tmpTemplateContentAddress,pRecord,pContextArray,null,pScope,pState);// No template hash
|
|
8009
8136
|
if(!tmpTemplateContent){this.log.warn(`Pict: Template Render Async: TemplateHash not resolved for [${tmpHash}]`);return fCallback(null,'');}if(!tmpAddressOfData){// No address was provided, just render the template with what this template has.
|
|
8010
8137
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
8011
|
-
this.pict.parseTemplate(tmpTemplateContent,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplate(tmpTemplateContent,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateFromAddress;},{"pict-template":144}],
|
|
8138
|
+
this.pict.parseTemplate(tmpTemplateContent,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplate(tmpTemplateContent,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateFromAddress;},{"pict-template":144}],231:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateFromMap extends libPictTemplate{/**
|
|
8012
8139
|
* @param {Object} pFable - The Fable Framework instance
|
|
8013
8140
|
* @param {Object} pOptions - The options for the service
|
|
8014
8141
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8042,7 +8169,7 @@ let tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this
|
|
|
8042
8169
|
if(!tmpTemplateFromMapHash){this.log.warn(`Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [${tmpHash}]`);return fCallback(null,'');}// Now resolve the data
|
|
8043
8170
|
let tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray,null,pScope,pState);let tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray,null,pScope,pState);if(!tmpMap){this.log.warn(`Pict: TemplateFromMap Render: Map not resolved for [${tmpHash}]`);return fCallback(null,'');}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
8044
8171
|
// The async portion of this is a mind bender because of how entry can happen dynamically from TemplateFromMaps
|
|
8045
|
-
this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateFromMap;},{"pict-template":144}],
|
|
8172
|
+
this.pict.parseTemplateByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateFromMap;},{"pict-template":144}],232:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateSet extends libPictTemplate{/**
|
|
8046
8173
|
* @param {Object} pFable - The Fable Framework instance
|
|
8047
8174
|
* @param {Object} pOptions - The options for the service
|
|
8048
8175
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8075,7 +8202,7 @@ let tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this
|
|
|
8075
8202
|
if(!tmpTemplateFromMapHash){this.log.warn(`Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [${tmpHash}]`);return fCallback(null,'');}// Now resolve the data
|
|
8076
8203
|
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState);if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
8077
8204
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
8078
|
-
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateSet;},{"pict-template":144}],
|
|
8205
|
+
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateSet;},{"pict-template":144}],233:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateSetFromMap extends libPictTemplate{/**
|
|
8079
8206
|
* @param {Object} pFable - The Fable Framework instance
|
|
8080
8207
|
* @param {Object} pOptions - The options for the service
|
|
8081
8208
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8109,7 +8236,7 @@ let tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<3){this
|
|
|
8109
8236
|
if(!tmpTemplateFromMapHash){this.log.warn(`Pict: TemplateFromMapSet Render Async: TemplateFromMapHash not resolved for [${tmpHash}]`);return fCallback(null,'');}// Now resolve the data
|
|
8110
8237
|
let tmpMap=this.resolveStateFromAddress(tmpAddressOfMap,tmpData,pContextArray,null,pScope,pState);let tmpKey=this.resolveStateFromAddress(tmpAddressOfKey,tmpData,pContextArray,null,pScope,pState);if(!tmpMap){this.log.warn(`Pict: TemplateFromMapSet Render: Map not resolved for [${tmpHash}]`);return fCallback(null,'');}tmpData=tmpMap[tmpKey];if(!tmpData){// No address was provided, just render the TemplateFromMap with what this TemplateFromMap has.
|
|
8111
8238
|
// The async portion of this is a mind bender because of how entry can happen dynamically from TemplateFromMaps
|
|
8112
|
-
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateSetFromMap;},{"pict-template":144}],
|
|
8239
|
+
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateSetFromMap;},{"pict-template":144}],234:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateSetWithPayload extends libPictTemplate{/**
|
|
8113
8240
|
* @param {Object} pFable - The Fable Framework instance
|
|
8114
8241
|
* @param {Object} pOptions - The options for the service
|
|
8115
8242
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8136,7 +8263,7 @@ let tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){t
|
|
|
8136
8263
|
*
|
|
8137
8264
|
* @return {void}
|
|
8138
8265
|
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpCallback=typeof fCallback==='function'?fCallback:()=>{return'';};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fTemplateSetWithPayloadRenderAsync]::[${tmpHash}]`);}else if(this.pict.LogNoisiness>0){this.log.trace(`PICT Template [fTemplateSetWithPayloadRenderAsync]::[${tmpHash}]`);}let tmpTemplateHash;let tmpAddressOfData;let tmpAddressOfPayload;// This is just a simple 3 part hash (template, address of set, address of payload)
|
|
8139
|
-
let tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){this.log.trace(`PICT Template [fTemplateSetWithPayloadRender]::[${tmpHash}] failed because there were not three stanzas in the expression [${pTemplateHash}]`);return fCallback(null,'');}tmpTemplateHash=tmpTemplateHashes[0];tmpAddressOfData=tmpTemplateHashes[1];tmpAddressOfPayload=tmpTemplateHashes[2];let tmpData=this.resolveStateFromAddress(tmpAddressOfData,pRecord,pContextArray,null,pScope,pState);if(!tmpData){tmpData=pRecord;}if(!tmpData){tmpData={};}let tmpPayloadData=this.resolveStateFromAddress(tmpAddressOfPayload,pRecord,pContextArray,null,pScope,pState);if(!tmpPayloadData){tmpPayloadData=pRecord;}if(!tmpPayloadData){tmpPayloadData={};}this.pict.parseTemplateSetWithPayloadByHash(tmpTemplateHash,tmpData,tmpPayloadData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderTemplateSetWithPayload;},{"pict-template":144}],
|
|
8266
|
+
let tmpTemplateHashes=tmpHash.trim().split(':');if(tmpTemplateHashes.length<3){this.log.trace(`PICT Template [fTemplateSetWithPayloadRender]::[${tmpHash}] failed because there were not three stanzas in the expression [${pTemplateHash}]`);return fCallback(null,'');}tmpTemplateHash=tmpTemplateHashes[0];tmpAddressOfData=tmpTemplateHashes[1];tmpAddressOfPayload=tmpTemplateHashes[2];let tmpData=this.resolveStateFromAddress(tmpAddressOfData,pRecord,pContextArray,null,pScope,pState);if(!tmpData){tmpData=pRecord;}if(!tmpData){tmpData={};}let tmpPayloadData=this.resolveStateFromAddress(tmpAddressOfPayload,pRecord,pContextArray,null,pScope,pState);if(!tmpPayloadData){tmpPayloadData=pRecord;}if(!tmpPayloadData){tmpPayloadData={};}this.pict.parseTemplateSetWithPayloadByHash(tmpTemplateHash,tmpData,tmpPayloadData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}module.exports=PictTemplateProviderTemplateSetWithPayload;},{"pict-template":144}],235:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateValueSet extends libPictTemplate{/**
|
|
8140
8267
|
* @param {Object} pFable - The Fable Framework instance
|
|
8141
8268
|
* @param {Object} pOptions - The options for the service
|
|
8142
8269
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8169,7 +8296,7 @@ let tmpTemplateHashPart=tmpHash.split(':');if(tmpTemplateHashPart.length<2){this
|
|
|
8169
8296
|
if(!tmpTemplateFromMapHash){this.log.warn(`Pict: TemplateFromMap Render Async: TemplateFromMapHash not resolved for [${tmpHash}]`);return fCallback(null,'');}// Now resolve the data
|
|
8170
8297
|
tmpData=this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState);let tmpDataValueSet=[];if(Array.isArray(tmpData)){for(let i=0;i<tmpData.length;i++){tmpDataValueSet.push({Value:tmpData[i],Key:i});}}else if(typeof tmpData==='object'){let tmpValueKeys=Object.keys(tmpData);for(let i=0;i<tmpValueKeys.length;i++){tmpDataValueSet.push({Value:tmpData[tmpValueKeys[i]],Key:tmpData[tmpValueKeys[i]]});}}else{tmpDataValueSet.push({Value:tmpData});}tmpData=tmpDataValueSet;if(!tmpData){// No address was provided, just render the template with what this template has.
|
|
8171
8298
|
// The async portion of this is a mind bender because of how entry can happen dynamically from templates
|
|
8172
|
-
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateValueSet;},{"pict-template":144}],
|
|
8299
|
+
this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateSetByHash(tmpTemplateFromMapHash,tmpData,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}}module.exports=PictTemplateProviderTemplateValueSet;},{"pict-template":144}],236:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderView extends libPictTemplate{/**
|
|
8173
8300
|
* @param {Object} pFable - The Fable Framework instance
|
|
8174
8301
|
* @param {Object} pOptions - The options for the service
|
|
8175
8302
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8196,7 +8323,7 @@ return tmpResult;}/**
|
|
|
8196
8323
|
* @return {void}
|
|
8197
8324
|
*/renderAsync(pTemplateHash,pRecord,fCallback,pContextArray,pScope,pState){const tmpViewHash=pTemplateHash.trim();if(!(tmpViewHash in this.pict.views)){this.log.warn(`Pict: View Template Render: View not found for [${tmpViewHash}]`);return fCallback(null,'');}let tmpRenderGUID=this.pict.getUUID();const tmpView=this.pict.views[tmpViewHash];return tmpView.renderAsync('__Virtual',`__TemplateOutputCache.${tmpRenderGUID}`,pRecord,pState?pState.RootRenderable:undefined,(pError,pResult)=>{if(pError){this.log.warn(`Pict: View Template Render: Error rendering view [${tmpViewHash}]`,pError);return fCallback(pError,'');}let tmpResult=this.pict.__TemplateOutputCache[tmpRenderGUID];// TODO: Uncomment this when we like how it's working
|
|
8198
8325
|
//delete this.pict.__TemplateOutputCache[tmpRenderGUID];
|
|
8199
|
-
return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},{"pict-template":144}],
|
|
8326
|
+
return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},{"pict-template":144}],237:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderRandomNumber extends libPictTemplate{/**
|
|
8200
8327
|
* @param {Object} pFable - The Fable Framework instance
|
|
8201
8328
|
* @param {Object} pOptions - The options for the service
|
|
8202
8329
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8210,7 +8337,7 @@ return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},
|
|
|
8210
8337
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8211
8338
|
*
|
|
8212
8339
|
* @return {string} The rendered template
|
|
8213
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fRandomNumber]::[${tmpHash}]`);}let tmpMinimumNumber=0;let tmpMaxNumber=9999999;if(tmpHash.length>0){let tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpMinimumNumber=parseInt(tmpHashParts[0]);}catch{tmpMinimumNumber=0;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch{tmpMaxNumber=9999999;}}}return this.fable.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);}}module.exports=PictTemplateProviderRandomNumber;},{"pict-template":144}],
|
|
8340
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fRandomNumber]::[${tmpHash}]`);}let tmpMinimumNumber=0;let tmpMaxNumber=9999999;if(tmpHash.length>0){let tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpMinimumNumber=parseInt(tmpHashParts[0]);}catch{tmpMinimumNumber=0;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch{tmpMaxNumber=9999999;}}}return this.fable.DataGeneration.randomIntegerBetween(tmpMinimumNumber,tmpMaxNumber);}}module.exports=PictTemplateProviderRandomNumber;},{"pict-template":144}],238:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderRandomNumberString extends libPictTemplate{/**
|
|
8214
8341
|
* @param {Object} pFable - The Fable Framework instance
|
|
8215
8342
|
* @param {Object} pOptions - The options for the service
|
|
8216
8343
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8224,7 +8351,7 @@ return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},
|
|
|
8224
8351
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8225
8352
|
*
|
|
8226
8353
|
* @return {string} The rendered template
|
|
8227
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fRandomNumberString]::[${tmpHash}]`);}let tmpStringLength=4;let tmpMaxNumber=9999;if(tmpHash.length>0){let tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpStringLength=parseInt(tmpHashParts[0]);}catch{tmpStringLength=4;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch{tmpMaxNumber=9999;}}}return this.fable.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);}}module.exports=PictTemplateProviderRandomNumberString;},{"pict-template":144}],
|
|
8354
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fRandomNumberString]::[${tmpHash}]`);}let tmpStringLength=4;let tmpMaxNumber=9999;if(tmpHash.length>0){let tmpHashParts=tmpHash.split(',');if(tmpHashParts.length>0){try{tmpStringLength=parseInt(tmpHashParts[0]);}catch{tmpStringLength=4;}}if(tmpHashParts.length>1){try{tmpMaxNumber=parseInt(tmpHashParts[1]);}catch{tmpMaxNumber=9999;}}}return this.fable.DataGeneration.randomNumericString(tmpStringLength,tmpMaxNumber);}}module.exports=PictTemplateProviderRandomNumberString;},{"pict-template":144}],239:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDataEncodeJavascriptString extends libPictTemplate{/**
|
|
8228
8355
|
* @param {Object} pFable - The Fable Framework instance
|
|
8229
8356
|
* @param {Object} pOptions - The options for the service
|
|
8230
8357
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8238,7 +8365,7 @@ return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},
|
|
|
8238
8365
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8239
8366
|
*
|
|
8240
8367
|
* @return {string} The rendered template
|
|
8241
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}]`);}let tmpDataToEncode=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.pict.DataFormat.stringEncodeForJavascript(tmpDataToEncode);}}module.exports=PictTemplateProviderDataEncodeJavascriptString;},{"pict-template":144}],
|
|
8368
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}]`);}let tmpDataToEncode=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.pict.DataFormat.stringEncodeForJavascript(tmpDataToEncode);}}module.exports=PictTemplateProviderDataEncodeJavascriptString;},{"pict-template":144}],240:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderJSONOutput extends libPictTemplate{/**
|
|
8242
8369
|
* @param {Object} pFable - The Fable Framework instance
|
|
8243
8370
|
* @param {Object} pOptions - The options for the service
|
|
8244
8371
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8252,7 +8379,7 @@ return fCallback(null,tmpResult);});}}module.exports=PictTemplateProviderView;},
|
|
|
8252
8379
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8253
8380
|
*
|
|
8254
8381
|
* @return {string} The rendered template
|
|
8255
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}]`);}let tmpDataToStringify=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);if(!tmpDataToStringify){tmpDataToStringify=pRecord;}return JSON.stringify(tmpDataToStringify);}}module.exports=PictTemplateProviderJSONOutput;},{"pict-template":144}],
|
|
8382
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataJson]::[${tmpHash}]`);}let tmpDataToStringify=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);if(!tmpDataToStringify){tmpDataToStringify=pRecord;}return JSON.stringify(tmpDataToStringify);}}module.exports=PictTemplateProviderJSONOutput;},{"pict-template":144}],241:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDateOnlyFormat extends libPictTemplate{/**
|
|
8256
8383
|
* @param {import('fable')} pFable - The Fable Framework instance
|
|
8257
8384
|
* @param {any} pOptions - The options for the service
|
|
8258
8385
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8273,7 +8400,7 @@ let tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);return tmpDayJS.format(tmp
|
|
|
8273
8400
|
```javascript
|
|
8274
8401
|
|
|
8275
8402
|
```
|
|
8276
|
-
*/},{"pict-template":144}],
|
|
8403
|
+
*/},{"pict-template":144}],242:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDateOnlyYMD extends libPictTemplate{/**
|
|
8277
8404
|
* @param {Object} pFable - The Fable Framework instance
|
|
8278
8405
|
* @param {Object} pOptions - The options for the service
|
|
8279
8406
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8291,7 +8418,7 @@ let tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);return tmpDayJS.format(tmp
|
|
|
8291
8418
|
let tmpDayJS=this.fable.Dates.dayJS.utc(tmpDateValue);//FIXME: this is kind of wacked out; -62167219200000 is the unix ms timestamp for 0000-01-01 00:00:00 UTC
|
|
8292
8419
|
// not even sure showing negative is right; showing the era is probably better (BCE vs CE)
|
|
8293
8420
|
//const prefix = tmpDayJS.valueOf() < -62167219200000 ? '-' : '';
|
|
8294
|
-
const tmpPrefix='';return tmpPrefix+tmpDayJS.format('YYYY-MM-DD');}}module.exports=PictTemplateProviderDateOnlyYMD;},{"pict-template":144}],
|
|
8421
|
+
const tmpPrefix='';return tmpPrefix+tmpDayJS.format('YYYY-MM-DD');}}module.exports=PictTemplateProviderDateOnlyYMD;},{"pict-template":144}],243:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDateTimeFormat extends libPictTemplate{/**
|
|
8295
8422
|
* @param {Object} pFable - The Fable Framework instance
|
|
8296
8423
|
* @param {Object} pOptions - The options for the service
|
|
8297
8424
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8316,7 +8443,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8316
8443
|
```javascript
|
|
8317
8444
|
|
|
8318
8445
|
```
|
|
8319
|
-
*/},{"pict-template":144}],
|
|
8446
|
+
*/},{"pict-template":144}],244:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDateTimeYMD extends libPictTemplate{/**
|
|
8320
8447
|
* @param {Object} pFable - The Fable Framework instance
|
|
8321
8448
|
* @param {Object} pOptions - The options for the service
|
|
8322
8449
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8335,7 +8462,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8335
8462
|
let 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
|
|
8336
8463
|
if(this.pict.options.Timezone){tmpDayJS=tmpDayJS.tz(this.pict.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. (${pError.message||pError})`);}}}catch{//this.log.error(`Error casting timezone using tz .. casting to the browser guess which is [${this.fable.Dates.dayJS.tz.guess()}].`);
|
|
8337
8464
|
// Day.js will try to guess the user's timezone for us
|
|
8338
|
-
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. (${pError.message||pError})`);}}return tmpDayJS.format('YYYY-MM-DD');}}module.exports=PictTemplateProviderDateTimeYMD;},{"pict-template":144}],
|
|
8465
|
+
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. (${pError.message||pError})`);}}return tmpDayJS.format('YYYY-MM-DD');}}module.exports=PictTemplateProviderDateTimeYMD;},{"pict-template":144}],245:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDigits extends libPictTemplate{/**
|
|
8339
8466
|
* @param {Object} pFable - The Fable Framework instance
|
|
8340
8467
|
* @param {Object} pOptions - The options for the service
|
|
8341
8468
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8349,7 +8476,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8349
8476
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8350
8477
|
*
|
|
8351
8478
|
* @return {string} The rendered template
|
|
8352
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDigits]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDigits]::[${tmpHash}]`);}let tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.fable.DataFormat.formatterAddCommasToNumber(this.fable.DataFormat.formatterRoundNumber(tmpColumnData,2));}}module.exports=PictTemplateProviderDigits;},{"pict-template":144}],
|
|
8479
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDigits]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDigits]::[${tmpHash}]`);}let tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.fable.DataFormat.formatterAddCommasToNumber(this.fable.DataFormat.formatterRoundNumber(tmpColumnData,2));}}module.exports=PictTemplateProviderDigits;},{"pict-template":144}],246:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDollars extends libPictTemplate{/**
|
|
8353
8480
|
* @param {Object} pFable - The Fable Framework instance
|
|
8354
8481
|
* @param {Object} pOptions - The options for the service
|
|
8355
8482
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8363,7 +8490,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8363
8490
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8364
8491
|
*
|
|
8365
8492
|
* @return {string} The rendered template
|
|
8366
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDollars]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDollars]::[${tmpHash}]`);}let tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.fable.DataFormat.formatterDollars(tmpColumnData);}}module.exports=PictTemplateProviderDollars;},{"pict-template":144}],
|
|
8493
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDollars]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDollars]::[${tmpHash}]`);}let tmpColumnData=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);return this.fable.DataFormat.formatterDollars(tmpColumnData);}}module.exports=PictTemplateProviderDollars;},{"pict-template":144}],247:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderHTMLCommandEnd extends libPictTemplate{/**
|
|
8367
8494
|
* @param {Object} pFable - The Fable Framework instance
|
|
8368
8495
|
* @param {Object} pOptions - The options for the service
|
|
8369
8496
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8377,7 +8504,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8377
8504
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8378
8505
|
*
|
|
8379
8506
|
* @return {string} The rendered template
|
|
8380
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpValue=false;const[tmpValueAddress,tmpPolarityStr]=tmpHash.split(':');if(tmpValueAddress!=null){tmpValue=this.resolveStateFromAddress(tmpValueAddress,tmpRecord,pContextArray,null,pScope,pState);}const tmpPolarity=tmpPolarityStr!=null?tmpPolarityStr==='1'||tmpPolarityStr.toLowerCase()==='true'||tmpPolarityStr.toLowerCase()==='t':false;if(Boolean(tmpValue)==tmpPolarity){return' -->';}return'';}}module.exports=PictTemplateProviderHTMLCommandEnd;},{"pict-template":144}],
|
|
8507
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpValue=false;const[tmpValueAddress,tmpPolarityStr]=tmpHash.split(':');if(tmpValueAddress!=null){tmpValue=this.resolveStateFromAddress(tmpValueAddress,tmpRecord,pContextArray,null,pScope,pState);}const tmpPolarity=tmpPolarityStr!=null?tmpPolarityStr==='1'||tmpPolarityStr.toLowerCase()==='true'||tmpPolarityStr.toLowerCase()==='t':false;if(Boolean(tmpValue)==tmpPolarity){return' -->';}return'';}}module.exports=PictTemplateProviderHTMLCommandEnd;},{"pict-template":144}],248:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderHTMLCommandStart extends libPictTemplate{/**
|
|
8381
8508
|
* @param {Object} pFable - The Fable Framework instance
|
|
8382
8509
|
* @param {Object} pOptions - The options for the service
|
|
8383
8510
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8391,7 +8518,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8391
8518
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8392
8519
|
*
|
|
8393
8520
|
* @return {string} The rendered template
|
|
8394
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpValue=false;const[tmpValueAddress,tmpPolarityStr]=tmpHash.split(':');if(tmpValueAddress!=null){tmpValue=this.resolveStateFromAddress(tmpValueAddress,tmpRecord,pContextArray,null,pScope,pState);}const tmpPolarity=tmpPolarityStr!=null?tmpPolarityStr==='1'||tmpPolarityStr.toLowerCase()==='true'||tmpPolarityStr.toLowerCase()==='t':false;if(Boolean(tmpValue)==tmpPolarity){return'<!-- ';}return'';}}module.exports=PictTemplateProviderHTMLCommandStart;},{"pict-template":144}],
|
|
8521
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpRecord=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}] with tmpData:`,tmpRecord);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Template [fDataRender]::[${tmpHash}]`);}let tmpValue=false;const[tmpValueAddress,tmpPolarityStr]=tmpHash.split(':');if(tmpValueAddress!=null){tmpValue=this.resolveStateFromAddress(tmpValueAddress,tmpRecord,pContextArray,null,pScope,pState);}const tmpPolarity=tmpPolarityStr!=null?tmpPolarityStr==='1'||tmpPolarityStr.toLowerCase()==='true'||tmpPolarityStr.toLowerCase()==='t':false;if(Boolean(tmpValue)==tmpPolarity){return'<!-- ';}return'';}}module.exports=PictTemplateProviderHTMLCommandStart;},{"pict-template":144}],249:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderJoin extends libPictTemplate{/**
|
|
8395
8522
|
* @param {Object} pFable - The Fable Framework instance
|
|
8396
8523
|
* @param {Object} pOptions - The options for the service
|
|
8397
8524
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8406,7 +8533,7 @@ try{tmpDayJS=tmpDayJS.tz(this.fable.Dates.dayJS.tz.guess());}catch(pError){this.
|
|
|
8406
8533
|
*
|
|
8407
8534
|
* @return {string} The rendered template
|
|
8408
8535
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash;let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Join [fDataRender]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Join [fDataRender]::[${tmpHash}]`);}let tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
8409
|
-
let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(let j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}module.exports=PictTemplateProviderJoin;},{"pict-template":144}],
|
|
8536
|
+
let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(let j=0;j<tmpValueSet.length;j++){tmpValueList.push(tmpValueSet[j]);}}else if(tmpValueSet){tmpValueList.push(tmpValueSet);}}return tmpValueList.join(tmpSeparator);}}module.exports=PictTemplateProviderJoin;},{"pict-template":144}],250:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderJoinUnique extends libPictTemplate{/**
|
|
8410
8537
|
* @param {Object} pFable - The Fable Framework instance
|
|
8411
8538
|
* @param {Object} pOptions - The options for the service
|
|
8412
8539
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8421,7 +8548,7 @@ let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];for(let i=0;i<tmpD
|
|
|
8421
8548
|
*
|
|
8422
8549
|
* @return {string} The rendered template
|
|
8423
8550
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash;let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Join Unique [fDataRender]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Join Unique [fDataRender]::[${tmpHash}]`);}let tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<2){return'';}// Get the separator string
|
|
8424
|
-
let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={};for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(let 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);}}module.exports=PictTemplateProviderJoinUnique;},{"pict-template":144}],
|
|
8551
|
+
let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={};for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){for(let 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);}}module.exports=PictTemplateProviderJoinUnique;},{"pict-template":144}],251:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderPascalCaseIdentifier extends libPictTemplate{/**
|
|
8425
8552
|
* @param {Object} pFable - The Fable Framework instance
|
|
8426
8553
|
* @param {Object} pOptions - The options for the service
|
|
8427
8554
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8441,7 +8568,7 @@ let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={}
|
|
|
8441
8568
|
```javascript
|
|
8442
8569
|
|
|
8443
8570
|
```
|
|
8444
|
-
*/},{"pict-template":144}],
|
|
8571
|
+
*/},{"pict-template":144}],252:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderPluckJoinUnique extends libPictTemplate{/**
|
|
8445
8572
|
* @param {Object} pFable - The Fable Framework instance
|
|
8446
8573
|
* @param {Object} pOptions - The options for the service
|
|
8447
8574
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8457,7 +8584,7 @@ let tmpSeparator=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={}
|
|
|
8457
8584
|
* @return {string} The rendered template
|
|
8458
8585
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash;let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Pluck Join Unique [fDataRender]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>3){this.log.trace(`PICT Pluck Join Unique [fDataRender]::[${tmpHash}]`);}let tmpDataAddresses=tmpHash.split('^');if(tmpDataAddresses.length<3){return'';}// Get the separator string
|
|
8459
8586
|
let tmpSeparator=tmpDataAddresses.shift();let tmpAddress=tmpDataAddresses.shift();let tmpValueList=[];let tmpValueMap={};for(let i=0;i<tmpDataAddresses.length;i++){let tmpValueSet=this.resolveStateFromAddress(tmpDataAddresses[i],tmpData,pContextArray,null,pScope,pState);if(tmpValueSet&&Array.isArray(tmpValueSet)){// This one only works on arrays of objects.
|
|
8460
|
-
for(let j=0;j<tmpValueSet.length;j++){if(tmpValueSet[j]===null||typeof tmpValueSet!=='object'){continue;}let 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);}}module.exports=PictTemplateProviderPluckJoinUnique;},{"pict-template":144}],
|
|
8587
|
+
for(let j=0;j<tmpValueSet.length;j++){if(tmpValueSet[j]===null||typeof tmpValueSet!=='object'){continue;}let 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);}}module.exports=PictTemplateProviderPluckJoinUnique;},{"pict-template":144}],253:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderBreakpoint extends libPictTemplate{/**
|
|
8461
8588
|
* @param {Object} pFable - The Fable Framework instance
|
|
8462
8589
|
* @param {Object} pOptions - The options for the service
|
|
8463
8590
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8473,7 +8600,7 @@ for(let j=0;j<tmpValueSet.length;j++){if(tmpValueSet[j]===null||typeof tmpValueS
|
|
|
8473
8600
|
* @return {string} The rendered template
|
|
8474
8601
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpError=new Error(`PICT Template Breakpoint: ${tmpHash}`);this.log.trace(`PICT Template Breakpoint: ${tmpHash}`,tmpError.stack);//throw tmpError;
|
|
8475
8602
|
debugger;// eslint-disable-line no-debugger
|
|
8476
|
-
return'';}}module.exports=PictTemplateProviderBreakpoint;},{"pict-template":144}],
|
|
8603
|
+
return'';}}module.exports=PictTemplateProviderBreakpoint;},{"pict-template":144}],254:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderDataValueTree extends libPictTemplate{/**
|
|
8477
8604
|
* @param {Object} pFable - The Fable Framework instance
|
|
8478
8605
|
* @param {Object} pOptions - The options for the service
|
|
8479
8606
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8503,7 +8630,7 @@ tmpPictObjectWrapTemplate=`<div class="PICT PICTObjectSet">{~D:Record.ObjectValu
|
|
|
8503
8630
|
*/dataValueTreeObjectSet(pObject,pRootObject,pCurrentDepth,pMaxDepth,pContextArray,pScope,pState){let tmpTemplateResult='';if(typeof pObject!=='object'){return tmpTemplateResult;}let tmpObjectValueKeys=Object.keys(pObject);let 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
|
|
8504
8631
|
tmpPictObjectBranchTemplate=`
|
|
8505
8632
|
<div class="PICTObjectBranchDepth_{~D:Record.CurrentDepth~}"><div class="PICTObjectBranch">{~D:Record.BranchKey~}</div><div class="PICTObjectBranchValue">{~D:Record.BranchValue~}</div></div>
|
|
8506
|
-
`;}for(let i=0;i<tmpObjectValueKeys.length;i++){let tmpBranchType=typeof pObject[tmpObjectValueKeys[i]];let tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray,pScope);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}let 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,pScope,pState);}return tmpTemplateResult;}}module.exports=PictTemplateProviderDataValueTree;},{"pict-template":144}],
|
|
8633
|
+
`;}for(let i=0;i<tmpObjectValueKeys.length;i++){let tmpBranchType=typeof pObject[tmpObjectValueKeys[i]];let tmpBranchValue='';switch(tmpBranchType){case'object':if(pCurrentDepth+1>pMaxDepth){tmpBranchValue='...';}else{tmpBranchValue=this.dataValueTreeObjectSet(pObject[tmpObjectValueKeys[i]],pRootObject,pCurrentDepth+1,pMaxDepth,pContextArray,pScope);}break;default:tmpBranchValue=pObject[tmpObjectValueKeys[i]];break;}let 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,pScope,pState);}return tmpTemplateResult;}}module.exports=PictTemplateProviderDataValueTree;},{"pict-template":144}],255:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderLogStatement extends libPictTemplate{/**
|
|
8507
8634
|
* @param {Object} pFable - The Fable Framework instance
|
|
8508
8635
|
* @param {Object} pOptions - The options for the service
|
|
8509
8636
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8517,7 +8644,7 @@ tmpPictObjectBranchTemplate=`
|
|
|
8517
8644
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8518
8645
|
*
|
|
8519
8646
|
* @return {string} The rendered template
|
|
8520
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();this.log.trace(`PICT Template Log Message: ${tmpHash}`);return'';}}module.exports=PictTemplateProviderLogStatement;},{"pict-template":144}],
|
|
8647
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();this.log.trace(`PICT Template Log Message: ${tmpHash}`);return'';}}module.exports=PictTemplateProviderLogStatement;},{"pict-template":144}],256:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderLogValue extends libPictTemplate{/**
|
|
8521
8648
|
* @param {Object} pFable - The Fable Framework instance
|
|
8522
8649
|
* @param {Object} pOptions - The options for the service
|
|
8523
8650
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8531,7 +8658,7 @@ tmpPictObjectBranchTemplate=`
|
|
|
8531
8658
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8532
8659
|
*
|
|
8533
8660
|
* @return {string} The rendered template
|
|
8534
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};let tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);let tmpValueType=typeof tmpValue;if(tmpValue==null||tmpValueType=='undefined'){this.log.trace(`PICT Template Log Value: [${tmpHash}] is ${tmpValueType}.`);}else if(tmpValueType=='object'){this.log.trace(`PICT Template Log Value: [${tmpHash}] is an object.`,tmpValue);}else{this.log.trace(`PICT Template Log Value: [${tmpHash}] is a ${tmpValueType} = [${tmpValue}]`);}return'';}}module.exports=PictTemplateProviderLogValue;},{"pict-template":144}],
|
|
8661
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};let tmpValue=this.resolveStateFromAddress(tmpHash,tmpData,pContextArray,null,pScope,pState);let tmpValueType=typeof tmpValue;if(tmpValue==null||tmpValueType=='undefined'){this.log.trace(`PICT Template Log Value: [${tmpHash}] is ${tmpValueType}.`);}else if(tmpValueType=='object'){this.log.trace(`PICT Template Log Value: [${tmpHash}] is an object.`,tmpValue);}else{this.log.trace(`PICT Template Log Value: [${tmpHash}] is a ${tmpValueType} = [${tmpValue}]`);}return'';}}module.exports=PictTemplateProviderLogValue;},{"pict-template":144}],257:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderLogValueTree extends libPictTemplate{/**
|
|
8535
8662
|
* @param {Object} pFable - The Fable Framework instance
|
|
8536
8663
|
* @param {Object} pOptions - The options for the service
|
|
8537
8664
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8545,7 +8672,7 @@ tmpPictObjectBranchTemplate=`
|
|
|
8545
8672
|
* @param {any} [pState] - A catchall state object for plumbing data through template processing.
|
|
8546
8673
|
*
|
|
8547
8674
|
* @return {string} The rendered template
|
|
8548
|
-
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let 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,null,pScope,pState);tmpData.ResolvedValueType=typeof tmpData.ResolvedValue;try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch{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: [${tmpData.TemplateHash}] resolved data is not an object.`,tmpData.ResolvedValue);}return'';}}module.exports=PictTemplateProviderLogValueTree;},{"pict-template":144}],
|
|
8675
|
+
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let 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,null,pScope,pState);tmpData.ResolvedValueType=typeof tmpData.ResolvedValue;try{tmpData.TreeMaxDepth=tmpData.ValueTreeParameters.length<2?1:parseInt(tmpData.ValueTreeParameters[1]);}catch{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: [${tmpData.TemplateHash}] resolved data is not an object.`,tmpData.ResolvedValue);}return'';}}module.exports=PictTemplateProviderLogValueTree;},{"pict-template":144}],258:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderNotEmpty extends libPictTemplate{/**
|
|
8549
8676
|
* @param {Object} pFable - The Fable Framework instance
|
|
8550
8677
|
* @param {Object} pOptions - The options for the service
|
|
8551
8678
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8560,11 +8687,11 @@ tmpPictObjectBranchTemplate=`
|
|
|
8560
8687
|
*
|
|
8561
8688
|
* @return {string} The rendered template
|
|
8562
8689
|
*/render(pTemplateHash,pRecord,pContextArray,pScope,pState){let tmpHash=pTemplateHash.trim();let tmpData=typeof pRecord==='object'?pRecord:{};if(this.pict.LogNoisiness>4){this.log.trace(`PICT Template [fNotEmptyRender]::[${tmpHash}] with tmpData:`,tmpData);}else if(this.pict.LogNoisiness>2){this.log.trace(`PICT Template [fNotEmptyRender]::[${tmpHash}]`);}let tmpHashParts=tmpHash.split('^');// For now just check truthiness. Not sure if this is grand.
|
|
8563
|
-
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray,null,pScope,pState)){return tmpHashParts[1];}return'';}}module.exports=PictTemplateProviderNotEmpty;},{"pict-template":144}],
|
|
8690
|
+
if(this.resolveStateFromAddress(tmpHashParts[0],tmpData,pContextArray,null,pScope,pState)){return tmpHashParts[1];}return'';}}module.exports=PictTemplateProviderNotEmpty;},{"pict-template":144}],259:[function(require,module,exports){const libPictTemplate=require('pict-template');class PictTemplateProviderTemplateIfBase extends libPictTemplate{/**
|
|
8564
8691
|
* @param {Object} pFable - The Fable Framework instance
|
|
8565
8692
|
* @param {Object} pOptions - The options for the service
|
|
8566
8693
|
* @param {String} pServiceHash - The hash of the service
|
|
8567
|
-
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);}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;case'==':return pValueLeft==pValueRight;default:return false;}}}module.exports=PictTemplateProviderTemplateIfBase;},{"pict-template":144}],
|
|
8694
|
+
*/constructor(pFable,pOptions,pServiceHash){super(pFable,pOptions,pServiceHash);}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;case'==':return pValueLeft==pValueRight;default:return false;}}}module.exports=PictTemplateProviderTemplateIfBase;},{"pict-template":144}],260:[function(require,module,exports){const libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');class PictTemplateProviderTemplateIf extends libPictTemplateIf{/**
|
|
8568
8695
|
* @param {Object} pFable - The Fable Framework instance
|
|
8569
8696
|
* @param {Object} pOptions - The options for the service
|
|
8570
8697
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8599,7 +8726,7 @@ if(!tmpTemplateHash){this.log.warn(`Pict: Template Render: TemplateHash not reso
|
|
|
8599
8726
|
if(!tmpComparisonOperation){this.log.warn(`Pict: Template Render: Comparison Operation not resolved for [${tmpHash}]`);return tmpCallback(null,'');}// Now try to break the comparison into three parts...
|
|
8600
8727
|
let tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn(`Pict: Template Render: Comparison Operation not complete (three parts expected) for [${tmpHash}]`);return tmpCallback(null,'');}// Now look up the data at the comparison location
|
|
8601
8728
|
try{// This is the only thing that's different from the absolute value function above. Collapse these.
|
|
8602
|
-
let tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray,null,pScope,pState),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray,null,pScope,pState));if(!tmpComparisonResult){return tmpCallback(null,'');}if(!tmpAddressOfData){this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}catch(pError){this.log.error(`Pict: Template Render: Error looking up comparison data for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}}}module.exports=PictTemplateProviderTemplateIf;},{"./Pict-Template-TemplateIf-Base.js":
|
|
8729
|
+
let tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray,null,pScope,pState),tmpComparisonParts[1],this.resolveStateFromAddress(tmpComparisonParts[2],tmpData,pContextArray,null,pScope,pState));if(!tmpComparisonResult){return tmpCallback(null,'');}if(!tmpAddressOfData){this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}catch(pError){this.log.error(`Pict: Template Render: Error looking up comparison data for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}}}module.exports=PictTemplateProviderTemplateIf;},{"./Pict-Template-TemplateIf-Base.js":259}],261:[function(require,module,exports){const libPictTemplateIf=require('./Pict-Template-TemplateIf-Base.js');class PictTemplateProviderTemplateIfAbsolute extends libPictTemplateIf{/**
|
|
8603
8730
|
* @param {Object} pFable - The Fable Framework instance
|
|
8604
8731
|
* @param {Object} pOptions - The options for the service
|
|
8605
8732
|
* @param {String} pServiceHash - The hash of the service
|
|
@@ -8633,5 +8760,5 @@ return this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,null,pContextArray,
|
|
|
8633
8760
|
if(!tmpTemplateHash){this.log.warn(`Pict: Template Render: TemplateHash not resolved for [${tmpHash}]`);return tmpCallback(null,'');}// No comparison operation
|
|
8634
8761
|
if(!tmpComparisonOperation){this.log.warn(`Pict: Template Render: Comparison Operation not resolved for [${tmpHash}]`);return tmpCallback(null,'');}// Now try to break the comparison into three parts...
|
|
8635
8762
|
let tmpComparisonParts=tmpComparisonOperation.split('^');if(tmpComparisonParts.length<3){this.log.warn(`Pict: Template Render: Comparison Operation not complete (three parts expected) for [${tmpHash}]`);return tmpCallback(null,'');}// Now look up the data at the comparison location
|
|
8636
|
-
try{let tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray,null,pScope,pState),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return tmpCallback(null,'');}if(!tmpAddressOfData){this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}catch(pError){this.log.error(`Pict: Template Render: Error looking up comparison data for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}}}module.exports=PictTemplateProviderTemplateIfAbsolute;},{"./Pict-Template-TemplateIf-Base.js":
|
|
8763
|
+
try{let tmpComparisonResult=this.compareValues(this.resolveStateFromAddress(tmpComparisonParts[0],tmpData,pContextArray,null,pScope,pState),tmpComparisonParts[1],tmpComparisonParts[2]);if(!tmpComparisonResult){return tmpCallback(null,'');}if(!tmpAddressOfData){this.pict.parseTemplateByHash(tmpTemplateHash,pRecord,(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}else{this.pict.parseTemplateByHash(tmpTemplateHash,this.resolveStateFromAddress(tmpAddressOfData,tmpData,pContextArray,null,pScope,pState),(pError,pValue)=>{if(pError){return tmpCallback(pError,'');}return tmpCallback(null,pValue);},pContextArray,pScope,pState);}}catch(pError){this.log.error(`Pict: Template Render: Error looking up comparison data for [${tmpHash}]: ${pError}`,pError);return tmpCallback(pError,'');}}}module.exports=PictTemplateProviderTemplateIfAbsolute;},{"./Pict-Template-TemplateIf-Base.js":259}]},{},[201])(201);});
|
|
8637
8764
|
//# sourceMappingURL=pict.js.map
|