fable 3.0.97 → 3.0.100

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.
Files changed (44) hide show
  1. package/dist/fable.compatible.js +12 -12
  2. package/dist/fable.compatible.min.js +2 -2
  3. package/dist/fable.compatible.min.js.map +1 -1
  4. package/dist/fable.js +11 -11
  5. package/dist/fable.min.js +2 -2
  6. package/dist/fable.min.js.map +1 -1
  7. package/package.json +3 -3
  8. package/source/services/Fable-Service-Anticipate.js +2 -0
  9. package/source/services/Fable-Service-MetaTemplate/MetaTemplate-StringParser.js +18 -12
  10. package/source/services/Fable-Service-MetaTemplate.js +1 -1
  11. package/retold-harness/bookstore-serve-api.js +0 -41
  12. package/retold-harness/configuration-bookstore-serve-api.js +0 -30
  13. package/retold-harness/docker_scripts/MySQL-Laden-Entry.sh +0 -17
  14. package/retold-harness/model/Model-Extended.json +0 -915
  15. package/retold-harness/model/Model-PICT.json +0 -1
  16. package/retold-harness/model/Model.json +0 -280
  17. package/retold-harness/model/bookstore-api-endpoint-exercises.paw +0 -0
  18. package/retold-harness/model/ddl/BookStore.ddl +0 -66
  19. package/retold-harness/model/generated_diagram/README.md +0 -1
  20. package/retold-harness/model/generated_diagram/Stricture_Output.dot +0 -13
  21. package/retold-harness/model/generated_diagram/Stricture_Output.png +0 -0
  22. package/retold-harness/model/generated_documentation/Dictionary.md +0 -18
  23. package/retold-harness/model/generated_documentation/Model-Author.md +0 -20
  24. package/retold-harness/model/generated_documentation/Model-Book.md +0 -26
  25. package/retold-harness/model/generated_documentation/Model-BookAuthorJoin.md +0 -14
  26. package/retold-harness/model/generated_documentation/Model-BookPrice.md +0 -25
  27. package/retold-harness/model/generated_documentation/Model-Review.md +0 -22
  28. package/retold-harness/model/generated_documentation/ModelChangeTracking.md +0 -17
  29. package/retold-harness/model/generated_documentation/README.md +0 -1
  30. package/retold-harness/model/manual_scripts/DropTables.sql +0 -5
  31. package/retold-harness/model/manual_scripts/MySQL-Laden-Entry.sh +0 -17
  32. package/retold-harness/model/manual_scripts/MySQL-Security.sql +0 -5
  33. package/retold-harness/model/manual_scripts/README.md +0 -2
  34. package/retold-harness/model/manual_scripts/my.cnf +0 -4
  35. package/retold-harness/model/meadow/Model-MeadowSchema-Author.json +0 -220
  36. package/retold-harness/model/meadow/Model-MeadowSchema-Book.json +0 -268
  37. package/retold-harness/model/meadow/Model-MeadowSchema-BookAuthorJoin.json +0 -172
  38. package/retold-harness/model/meadow/Model-MeadowSchema-BookPrice.json +0 -260
  39. package/retold-harness/model/meadow/Model-MeadowSchema-Review.json +0 -236
  40. package/retold-harness/model/meadow/README.md +0 -1
  41. package/retold-harness/model/sql_create/BookStore-CreateDatabase.mysql.sql +0 -116
  42. package/retold-harness/model/sql_create/BookStore-DeleteAndRepopulateTables.sql +0 -194
  43. package/retold-harness/model/sql_create/MySQL-Security.sql +0 -5
  44. package/retold-harness/model/sql_create/README.md +0 -1
@@ -539,7 +539,7 @@ if(val.charCodeAt(0)===0x22){val=val.slice(1,-1);}obj[key]=tryDecode(val,dec);}i
539
539
  * @param {object} [options]
540
540
  * @return {string}
541
541
  * @public
542
- */function serialize(name,val,options){var opt=options||{};var enc=opt.encode||encode;if(typeof enc!=='function'){throw new TypeError('option encode is invalid');}if(!fieldContentRegExp.test(name)){throw new TypeError('argument name is invalid');}var value=enc(val);if(value&&!fieldContentRegExp.test(value)){throw new TypeError('argument val is invalid');}var str=name+'='+value;if(null!=opt.maxAge){var maxAge=opt.maxAge-0;if(isNaN(maxAge)||!isFinite(maxAge)){throw new TypeError('option maxAge is invalid');}str+='; Max-Age='+Math.floor(maxAge);}if(opt.domain){if(!fieldContentRegExp.test(opt.domain)){throw new TypeError('option domain is invalid');}str+='; Domain='+opt.domain;}if(opt.path){if(!fieldContentRegExp.test(opt.path)){throw new TypeError('option path is invalid');}str+='; Path='+opt.path;}if(opt.expires){var expires=opt.expires;if(!isDate(expires)||isNaN(expires.valueOf())){throw new TypeError('option expires is invalid');}str+='; Expires='+expires.toUTCString();}if(opt.httpOnly){str+='; HttpOnly';}if(opt.secure){str+='; Secure';}if(opt.priority){var priority=typeof opt.priority==='string'?opt.priority.toLowerCase():opt.priority;switch(priority){case'low':str+='; Priority=Low';break;case'medium':str+='; Priority=Medium';break;case'high':str+='; Priority=High';break;default:throw new TypeError('option priority is invalid');}}if(opt.sameSite){var sameSite=typeof opt.sameSite==='string'?opt.sameSite.toLowerCase():opt.sameSite;switch(sameSite){case true:str+='; SameSite=Strict';break;case'lax':str+='; SameSite=Lax';break;case'strict':str+='; SameSite=Strict';break;case'none':str+='; SameSite=None';break;default:throw new TypeError('option sameSite is invalid');}}return str;}/**
542
+ */function serialize(name,val,options){var opt=options||{};var enc=opt.encode||encode;if(typeof enc!=='function'){throw new TypeError('option encode is invalid');}if(!fieldContentRegExp.test(name)){throw new TypeError('argument name is invalid');}var value=enc(val);if(value&&!fieldContentRegExp.test(value)){throw new TypeError('argument val is invalid');}var str=name+'='+value;if(null!=opt.maxAge){var maxAge=opt.maxAge-0;if(isNaN(maxAge)||!isFinite(maxAge)){throw new TypeError('option maxAge is invalid');}str+='; Max-Age='+Math.floor(maxAge);}if(opt.domain){if(!fieldContentRegExp.test(opt.domain)){throw new TypeError('option domain is invalid');}str+='; Domain='+opt.domain;}if(opt.path){if(!fieldContentRegExp.test(opt.path)){throw new TypeError('option path is invalid');}str+='; Path='+opt.path;}if(opt.expires){var expires=opt.expires;if(!isDate(expires)||isNaN(expires.valueOf())){throw new TypeError('option expires is invalid');}str+='; Expires='+expires.toUTCString();}if(opt.httpOnly){str+='; HttpOnly';}if(opt.secure){str+='; Secure';}if(opt.partitioned){str+='; Partitioned';}if(opt.priority){var priority=typeof opt.priority==='string'?opt.priority.toLowerCase():opt.priority;switch(priority){case'low':str+='; Priority=Low';break;case'medium':str+='; Priority=Medium';break;case'high':str+='; Priority=High';break;default:throw new TypeError('option priority is invalid');}}if(opt.sameSite){var sameSite=typeof opt.sameSite==='string'?opt.sameSite.toLowerCase():opt.sameSite;switch(sameSite){case true:str+='; SameSite=Strict';break;case'lax':str+='; SameSite=Lax';break;case'strict':str+='; SameSite=Strict';break;case'none':str+='; SameSite=None';break;default:throw new TypeError('option sameSite is invalid');}}return str;}/**
543
543
  * URL-decode string value. Optimized to skip native call when no %.
544
544
  *
545
545
  * @param {string} str
@@ -547,7 +547,7 @@ if(val.charCodeAt(0)===0x22){val=val.slice(1,-1);}obj[key]=tryDecode(val,dec);}i
547
547
  */function decode(str){return str.indexOf('%')!==-1?decodeURIComponent(str):str;}/**
548
548
  * URL-encode value.
549
549
  *
550
- * @param {string} str
550
+ * @param {string} val
551
551
  * @returns {string}
552
552
  */function encode(val){return encodeURIComponent(val);}/**
553
553
  * Determine if value is a Date.
@@ -2875,9 +2875,9 @@ if(this.servicesMap[pServiceType].hasOwnProperty(pServiceHash)){if(!this.hasOwnP
2875
2875
  function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports["new"]=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceBase;module.exports.CoreServiceProviderBase=libFableServiceBase.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"./services/Fable-Service-Anticipate.js":120,"./services/Fable-Service-CSVParser.js":121,"./services/Fable-Service-DataFormat.js":122,"./services/Fable-Service-DataGeneration.js":124,"./services/Fable-Service-DateManipulation.js":125,"./services/Fable-Service-EnvironmentData.js":126,"./services/Fable-Service-FilePersistence.js":127,"./services/Fable-Service-MetaTemplate.js":128,"./services/Fable-Service-Operation.js":132,"./services/Fable-Service-RestClient.js":133,"./services/Fable-Service-Template.js":134,"./services/Fable-Service-Utility.js":135,"cachetrax":22,"fable-log":43,"fable-serviceproviderbase":44,"fable-settings":47,"fable-uuid":49,"manyfest":72}],120:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceAnticipate=/*#__PURE__*/function(_libFableServiceBase){_inherits(FableServiceAnticipate,_libFableServiceBase);var _super10=_createSuper(FableServiceAnticipate);function FableServiceAnticipate(pFable,pOptions,pServiceHash){var _this18;_classCallCheck2(this,FableServiceAnticipate);_this18=_super10.call(this,pFable,pOptions,pServiceHash);_this18.serviceType='AsyncAnticipate';// The queue of operations waiting to run.
2876
2876
  _this18.operationQueue=[];_this18.erroredOperations=[];_this18.executingOperationCount=0;_this18.completedOperationCount=0;_this18.maxOperations=1;_this18.lastError=undefined;_this18.waitingFunctions=[];return _this18;}_createClass2(FableServiceAnticipate,[{key:"checkQueue",value:function checkQueue(){// This checks to see if we need to start any operations.
2877
2877
  if(this.operationQueue.length>0&&this.executingOperationCount<this.maxOperations){var tmpOperation=this.operationQueue.shift();this.executingOperationCount+=1;tmpOperation(this.buildAnticipatorCallback());}else if(this.waitingFunctions.length>0&&this.executingOperationCount<1){// If there are no operations left, and we have waiting functions, call them.
2878
- for(var i=0;i<this.waitingFunctions.length;i++){this.waitingFunctions[i](this.lastError);}// Reset our state
2878
+ for(var i=0;i<this.waitingFunctions.length;i++){this.log.trace('Calling waiting function.');this.waitingFunctions[i](this.lastError);}// Reset our state
2879
2879
  this.lastError=undefined;this.waitingFunctions=[];}}// Expects a function fAsynchronousFunction(fCallback)
2880
- },{key:"anticipate",value:function anticipate(fAsynchronousFunction){this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}},{key:"buildAnticipatorCallback",value:function buildAnticipatorCallback(){// This uses closure-scoped state to track the callback state
2880
+ },{key:"anticipate",value:function anticipate(fAsynchronousFunction){this.log.trace('Adding a function...');this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}},{key:"buildAnticipatorCallback",value:function buildAnticipatorCallback(){// This uses closure-scoped state to track the callback state
2881
2881
  var tmpCallbackState={Called:false,Error:undefined,OperationSet:this};return hoistedCallback;function hoistedCallback(pError){if(tmpCallbackState.Called){// If they call the callback twice, throw an error
2882
2882
  throw new Error("Anticipation async callback called twice...");}tmpCallbackState.Called=true;tmpCallbackState.error=pError;tmpCallbackState.OperationSet.executingOperationCount-=1;tmpCallbackState.OperationSet.completedOperationCount+=1;tmpCallbackState.OperationSet.checkQueue();}}},{key:"wait",value:function wait(fCallback){this.waitingFunctions.push(fCallback);this.checkQueue();}}]);return FableServiceAnticipate;}(libFableServiceBase);module.exports=FableServiceAnticipate;},{"fable-serviceproviderbase":44}],121:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
2883
2883
  * Parsing CSVs. Why? Because it's a thing that needs to be done.
@@ -3131,7 +3131,7 @@ return _this25.makeFolderRecursive(tmpParameters,fCallback);}else{console.log(pC
3131
3131
  * @author Steven Velozo <steven@velozo.com>
3132
3132
  * @description Process text stream trie and postfix tree, parsing out meta-template expression functions.
3133
3133
  */var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase5){_inherits(FableServiceMetaTemplate,_libFableServiceBase5);var _super17=_createSuper(FableServiceMetaTemplate);function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this26;_classCallCheck2(this,FableServiceMetaTemplate);_this26=_super17.call(this,pFable,pOptions,pServiceHash);_this26.serviceType='MetaTemplate';_this26.WordTree=new libWordTree();// In order to allow asynchronous template processing we need to use the async.eachLimit function
3134
- _this26.StringParser=new libStringParser(_this26.fable.services.Utility.eachLimit);_this26.ParseTree=_this26.WordTree.ParseTree;return _this26;}/**
3134
+ _this26.StringParser=new libStringParser(_this26.fable);_this26.ParseTree=_this26.WordTree.ParseTree;return _this26;}/**
3135
3135
  * Add a Pattern to the Parse Tree
3136
3136
  * @method addPattern
3137
3137
  * @param {Object} pTree - A node on the parse tree to push the characters into
@@ -3150,7 +3150,7 @@ _this26.StringParser=new libStringParser(_this26.fable.services.Utility.eachLimi
3150
3150
  * @description Parse a string, properly processing each matched token in the word tree.
3151
3151
  */var StringParser=/*#__PURE__*/function(){/**
3152
3152
  * StringParser Constructor
3153
- */function StringParser(fEachLimit){_classCallCheck2(this,StringParser);this.eachLimit=fEachLimit;}/**
3153
+ */function StringParser(pFable){_classCallCheck2(this,StringParser);this.fable=pFable;}/**
3154
3154
  * Create a fresh parsing state object to work with.
3155
3155
  * @method newParserState
3156
3156
  * @param {Object} pParseTree - A node on the parse tree to begin parsing from (usually root)
@@ -3194,9 +3194,9 @@ if(pParserState.ParseTree.hasOwnProperty(pCharacter)){// ... assign the root nod
3194
3194
  this.resetOutputBuffer(pParserState);this.appendOutputBuffer(pCharacter,pParserState);pParserState.Pattern=pParserState.ParseTree[pCharacter];pParserState.PatternMatch=true;return true;}else{this.appendOutputBuffer(pCharacter,pParserState);}}return false;}},{key:"executePatternAsync",value:function executePatternAsync(pParserState,pData,fCallback){var _this27=this;// ... this is the end of a pattern, cut off the end tag and parse it.
3195
3195
  // Trim the start and end tags off the output buffer now
3196
3196
  if(pParserState.Pattern.isAsync&&!pParserState.Pattern.isBoth){// Run the function
3197
- return pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){console.log("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this27.resetOutputBuffer(pParserState);return setTimeout(fCallback,0);});}else if(pParserState.Pattern.isAsync&&pParserState.Pattern.isBoth){// Run the function when both async and non async were provided with the pattern
3198
- return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){console.log("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this27.resetOutputBuffer(pParserState);return setTimeout(fCallback,0);});}else{// Run the t*mplate function
3199
- pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData);this.resetOutputBuffer(pParserState);return setTimeout(fCallback,0);}}/**
3197
+ return pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){console.log("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this27.resetOutputBuffer(pParserState);return fCallback();});}else if(pParserState.Pattern.isAsync&&pParserState.Pattern.isBoth){// Run the function when both async and non async were provided with the pattern
3198
+ return pParserState.Pattern.ParseAsync(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData,function(pError,pAsyncOutput){if(pError){console.log("Precedent ERROR: Async template error happened parsing ".concat(pParserState.Pattern.PatternStart," ... ").concat(pParserState.Pattern.PatternEnd,": ").concat(pError));}pParserState.OutputBuffer=pAsyncOutput;_this27.resetOutputBuffer(pParserState);return fCallback();});}else{// Run the t*mplate function
3199
+ pParserState.OutputBuffer=pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length,pParserState.OutputBuffer.length-(pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)),pData);this.resetOutputBuffer(pParserState);return fCallback();}}/**
3200
3200
  * Parse a character in the buffer.
3201
3201
  * @method parseCharacter
3202
3202
  * @param {string} pCharacter - The character to append
@@ -3226,8 +3226,8 @@ return fCallback();}/**
3226
3226
  * @param {function} fCallback - The callback function to call when the parse is complete
3227
3227
  */},{key:"parseString",value:function parseString(pString,pParseTree,pData,fCallback){var _this28=this;if(typeof fCallback!=='function'){var tmpParserState=this.newParserState(pParseTree);for(var i=0;i<pString.length;i++){// TODO: This is not fast.
3228
3228
  this.parseCharacter(pString[i],tmpParserState,pData,fCallback);}this.flushOutputBuffer(tmpParserState);return tmpParserState.Output;}else{// This is the async mode
3229
- var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;this.eachLimit(pString,1,function(pCharacter,fCharacterCallback){_this28.parseCharacterAsync(pCharacter,_tmpParserState,pData,fCharacterCallback);},function(pError){// Flush the remaining data
3230
- _this28.flushOutputBuffer(_tmpParserState);fCallback(pError,_tmpParserState.Output);});}}}]);return StringParser;}();module.exports=StringParser;},{}],130:[function(require,module,exports){/**
3229
+ var _tmpParserState=this.newParserState(pParseTree);_tmpParserState.Asynchronous=true;var tmpAnticipate=this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');var _loop=function _loop(_i12){tmpAnticipate.anticipate(function(fCallback){_this28.parseCharacterAsync(pString[_i12],_tmpParserState,pData,fCallback);});};for(var _i12=0;_i12<pString.length;_i12++){_loop(_i12);}tmpAnticipate.wait(function(pError){// Flush the remaining data
3230
+ _this28.flushOutputBuffer(_tmpParserState);return fCallback(pError,_tmpParserState.Output);});}}}]);return StringParser;}();module.exports=StringParser;},{}],130:[function(require,module,exports){/**
3231
3231
  * Word Tree
3232
3232
  * @author Steven Velozo <steven@velozo.com>
3233
3233
  * @description Create a tree (directed graph) of Javascript objects, one character per object.
@@ -3254,7 +3254,7 @@ _this28.flushOutputBuffer(_tmpParserState);fCallback(pError,_tmpParserState.Outp
3254
3254
  * @param {function} fParser - The function to parse if this is the matched pattern, once the Pattern End is met. If this is a string, a simple replacement occurs.
3255
3255
  * @return {bool} True if adding the pattern was successful
3256
3256
  */},{key:"addPattern",value:function addPattern(pPatternStart,pPatternEnd,fParser){if(pPatternStart.length<1){return false;}if(typeof pPatternEnd==='string'&&pPatternEnd.length<1){return false;}var tmpLeaf=this.ParseTree;// Add the tree of leaves iteratively
3257
- for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!tmpLeaf.hasOwnProperty('PatternEnd')){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i12=0;_i12<tmpPatternEnd.length;_i12++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i12],_i12);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(){return fParser;}:function(pData){return pData;};return tmpLeaf;}/** Add a Pattern to the Parse Tree
3257
+ for(var i=0;i<pPatternStart.length;i++){tmpLeaf=this.addChild(tmpLeaf,pPatternStart[i],i);}if(!tmpLeaf.hasOwnProperty('PatternEnd')){tmpLeaf.PatternEnd={};}var tmpPatternEnd=typeof pPatternEnd==='string'?pPatternEnd:pPatternStart;for(var _i13=0;_i13<tmpPatternEnd.length;_i13++){tmpLeaf=this.addEndChild(tmpLeaf,tmpPatternEnd[_i13],_i13);}tmpLeaf.PatternStartString=pPatternStart;tmpLeaf.PatternEndString=tmpPatternEnd;tmpLeaf.Parse=typeof fParser==='function'?fParser:typeof fParser==='string'?function(){return fParser;}:function(pData){return pData;};return tmpLeaf;}/** Add a Pattern to the Parse Tree
3258
3258
  * @method addPatternAsync
3259
3259
  * @param {Object} pPatternStart - The starting string for the pattern (e.g. "${")
3260
3260
  * @param {string} pPatternEnd - The ending string for the pattern (e.g. "}")