fable 3.0.35 → 3.0.37
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/.config/configstore/update-notifier-npm.json +1 -1
- package/.config/vscode-sqltools/runningInfo.json +1 -1
- package/Dockerfile_LUXURYCode +7 -4
- package/debug/Harness.js +3 -4
- package/dist/fable.compatible.js +14 -14
- package/dist/fable.compatible.min.js +2 -2
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +6 -6
- package/dist/fable.min.js +2 -2
- package/dist/fable.min.js.map +1 -1
- package/package.json +5 -2
- package/retold-harness/Bookstore-Import-Books.sh +4 -0
- package/retold-harness/bookstore-api-endpoint-exercises.paw +0 -0
- package/retold-harness/bookstore-import-books-run.js +9 -0
- package/retold-harness/bookstore-serve-meadow-endpoint-apis-run.js +6 -0
- package/{.config/retold-harness → retold-harness}/bookstore-serve-meadow-endpoint-apis.js +4 -1
- package/{.config/retold-harness → retold-harness}/package.json +5 -2
- package/source/Fable.js +2 -0
- package/source/services/Fable-Service-EnvironmentData-Web.js +15 -0
- package/source/services/Fable-Service-EnvironmentData.js +15 -0
- package/source/services/Fable-Service-RestClient.js +130 -26
- package/test/Fable_tests.js +2 -0
- package/test/RestClient_test.js +69 -3
- package/.config/retold-harness/bookstore-api-endpoint-exercises.paw +0 -0
- package/.config/retold-harness/bookstore-import-books-run.js +0 -1
- /package/{.config/retold-harness → retold-harness}/MySQL-Laden-Entry.sh +0 -0
- /package/{.config/retold-harness → retold-harness}/MySQL-Security.sql +0 -0
- /package/{.config/retold-harness → retold-harness}/bookstore-configuration.json +0 -0
- /package/{.config/retold-harness → retold-harness}/bookstore-import-books.js +0 -0
- /package/{.config/retold-harness → retold-harness}/bookstore-serve-meadow-endpoint-apis-IPC.js +0 -0
- /package/{.config/retold-harness → retold-harness}/data/books.csv +0 -0
- /package/{.config/retold-harness → retold-harness}/model/ddl/BookStore.ddl +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_diagram/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_diagram/Stricture_Output.dot +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_diagram/Stricture_Output.png +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Dictionary.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Author.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Book.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-BookAuthorJoin.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-BookPrice.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Review.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/ModelChangeTracking.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore-Extended.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore-PICT.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/json_schema/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/manual_scripts/DropTables.sql +0 -0
- /package/{.config/retold-harness → retold-harness}/model/manual_scripts/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Author.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Book.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-BookAuthorJoin.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-BookPrice.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Review.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/sql_create/BookStore-CreateDatabase.mysql.sql +0 -0
- /package/{.config/retold-harness → retold-harness}/model/sql_create/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/test_old/Tests.js +0 -0
- /package/{.config/retold-harness → retold-harness}/test_old/untitled.js +0 -0
package/Dockerfile_LUXURYCode
CHANGED
|
@@ -54,14 +54,14 @@ RUN code-server --install-extension mtxr.sqltools-driver-mysql
|
|
|
54
54
|
# An easy on the eyes color theme
|
|
55
55
|
# RUN code-server --install-extension daylerees.rainglow
|
|
56
56
|
|
|
57
|
-
RUN echo "...configuring mariadb (mysql) server
|
|
57
|
+
RUN echo "...configuring mariadb (mysql) server...."
|
|
58
58
|
RUN sudo sed -i "s|bind-address|#bind-address|g" /etc/mysql/mariadb.conf.d/50-server.cnf
|
|
59
|
-
ADD
|
|
60
|
-
ADD
|
|
59
|
+
ADD ./retold-harness/MySQL-Security.sql /home/coder/MySQL-Configure-Security.sql
|
|
60
|
+
ADD ./retold-harness/MySQL-Laden-Entry.sh /usr/bin/MySQL-Laden-Entry.sh
|
|
61
61
|
RUN ( sudo mysqld_safe --skip-grant-tables --skip-networking & ) && sleep 5 && mysql -u root < /home/coder/MySQL-Configure-Security.sql
|
|
62
62
|
|
|
63
63
|
# Import the initial database
|
|
64
|
-
COPY
|
|
64
|
+
COPY ./retold-harness/model/sql_create/BookStore-CreateDatabase.mysql.sql /home/coder/MySQL-Create-Databases.sql
|
|
65
65
|
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" -e "CREATE DATABASE bookstore;"
|
|
66
66
|
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" bookstore < /home/coder/MySQL-Create-Databases.sql
|
|
67
67
|
|
|
@@ -84,4 +84,7 @@ RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm alias default 14
|
|
|
84
84
|
|
|
85
85
|
WORKDIR /home/coder/fable
|
|
86
86
|
|
|
87
|
+
# RUN . ~/.nvm/nvm.sh && source ~/.bashrc && npm install
|
|
88
|
+
# RUN . /home/coder/fable/retold-harness/Bookstore-Import-Books.sh
|
|
89
|
+
|
|
87
90
|
ENTRYPOINT ["/usr/bin/MySQL-Laden-Entry.sh"]
|
package/debug/Harness.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
let libBookstore = require('../retold-harness/bookstore-serve-meadow-endpoint-apis-run.js');
|
|
2
|
+
/*
|
|
1
3
|
const libFable = require('../source/Fable.js');
|
|
2
4
|
|
|
3
5
|
class SimpleService extends libFable.ServiceProviderBase
|
|
@@ -39,7 +41,4 @@ tmpRestClient.getJSON('https://en.wiktionary.org/w/api.php?action=parse&prop=wik
|
|
|
39
41
|
{
|
|
40
42
|
testFable.log.info('Response received!');
|
|
41
43
|
});
|
|
42
|
-
|
|
43
|
-
var fable = new libFable();
|
|
44
|
-
|
|
45
|
-
fable.log.info('What are you doing, Dave?', {SomeColorSetting: 'Red', CurrentFolder: __dirname });
|
|
44
|
+
*/
|
package/dist/fable.compatible.js
CHANGED
|
@@ -1677,7 +1677,7 @@ if(!this.defaultServices.hasOwnProperty(tmpServiceType)){this.setDefaultServiceI
|
|
|
1677
1677
|
* @author <steven@velozo.com>
|
|
1678
1678
|
*/ // Pre-init services
|
|
1679
1679
|
var libFableSettings=require('fable-settings');var libFableUUID=require('fable-uuid');var libFableLog=require('fable-log');var libFableServiceManager=require('./Fable-ServiceManager.js');// Default Services
|
|
1680
|
-
var libFableServiceDataFormat=require('./services/Fable-Service-DataFormat.js');var libFableServiceMetaTemplate=require('./services/Fable-Service-MetaTemplate.js');var libFableServiceOperation=require('./services/Fable-Service-Operation.js');var libFableServiceRestClient=require('./services/Fable-Service-RestClient.js');var libFableServiceTemplate=require('./services/Fable-Service-Template.js');var libFableServiceUtility=require('./services/Fable-Service-Utility.js');var Fable=/*#__PURE__*/function(){function Fable(pSettings){_classCallCheck2(this,Fable);// Initialization Phase 0: Set up the lowest level state (core services)
|
|
1680
|
+
var libFableServiceEnvironmentData=require('./services/Fable-Service-EnvironmentData.js');var libFableServiceDataFormat=require('./services/Fable-Service-DataFormat.js');var libFableServiceMetaTemplate=require('./services/Fable-Service-MetaTemplate.js');var libFableServiceOperation=require('./services/Fable-Service-Operation.js');var libFableServiceRestClient=require('./services/Fable-Service-RestClient.js');var libFableServiceTemplate=require('./services/Fable-Service-Template.js');var libFableServiceUtility=require('./services/Fable-Service-Utility.js');var Fable=/*#__PURE__*/function(){function Fable(pSettings){_classCallCheck2(this,Fable);// Initialization Phase 0: Set up the lowest level state (core services)
|
|
1681
1681
|
// Container for the core services prototypes.
|
|
1682
1682
|
// This is here so if an API consumer changes the default for a core service,
|
|
1683
1683
|
// fable still runs with what was initialized.
|
|
@@ -1690,8 +1690,8 @@ this._coreServices.ServiceManager=new libFableServiceManager(this);this.serviceM
|
|
|
1690
1690
|
// Initialization Phase 2: Map in the default services.
|
|
1691
1691
|
// They will then be available in the Default service provider set as well.
|
|
1692
1692
|
this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.ServiceManager);this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.UUID);this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.Logging);this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.SettingsManager);// Initialize and instantiate the default baked-in Data Arithmatic service
|
|
1693
|
-
this.serviceManager.addServiceType('Template',libFableServiceTemplate);this.serviceManager.addServiceType('MetaTemplate',libFableServiceMetaTemplate);this.serviceManager.addAndInstantiateServiceType('DataFormat',libFableServiceDataFormat);this.serviceManager.addAndInstantiateServiceType('Utility',libFableServiceUtility);this.serviceManager.addServiceType('Operation',libFableServiceOperation);this.serviceManager.addServiceType('RestClient',libFableServiceRestClient);}_createClass2(Fable,[{key:"settings",get:function get(){return this._coreServices.SettingsManager.settings;}},{key:"settingsManager",get:function get(){return this._coreServices.SettingsManager;}},{key:"log",get:function get(){return this._coreServices.Logging;}},{key:"services",get:function get(){return this._coreServices.ServiceManager.services;}},{key:"defaultServices",get:function get(){return this._coreServices.ServiceManager.defaultServices;}},{key:"getUUID",value:function getUUID(){return this._coreServices.UUID.getUUID();}},{key:"fable",get:function get(){return this;}}]);return Fable;}();// This is for backwards compatibility
|
|
1694
|
-
function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports["new"]=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceManager.ServiceProviderBase;module.exports.CoreServiceProviderBase=libFableServiceManager.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"./Fable-ServiceManager.js":78,"./services/Fable-Service-DataFormat.js":80,"./services/Fable-Service-
|
|
1693
|
+
this.serviceManager.addAndInstantiateServiceType('EnvironmentData',libFableServiceEnvironmentData);this.serviceManager.addServiceType('Template',libFableServiceTemplate);this.serviceManager.addServiceType('MetaTemplate',libFableServiceMetaTemplate);this.serviceManager.addAndInstantiateServiceType('DataFormat',libFableServiceDataFormat);this.serviceManager.addAndInstantiateServiceType('Utility',libFableServiceUtility);this.serviceManager.addServiceType('Operation',libFableServiceOperation);this.serviceManager.addServiceType('RestClient',libFableServiceRestClient);}_createClass2(Fable,[{key:"settings",get:function get(){return this._coreServices.SettingsManager.settings;}},{key:"settingsManager",get:function get(){return this._coreServices.SettingsManager;}},{key:"log",get:function get(){return this._coreServices.Logging;}},{key:"services",get:function get(){return this._coreServices.ServiceManager.services;}},{key:"defaultServices",get:function get(){return this._coreServices.ServiceManager.defaultServices;}},{key:"getUUID",value:function getUUID(){return this._coreServices.UUID.getUUID();}},{key:"fable",get:function get(){return this;}}]);return Fable;}();// This is for backwards compatibility
|
|
1694
|
+
function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports["new"]=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceManager.ServiceProviderBase;module.exports.CoreServiceProviderBase=libFableServiceManager.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"./Fable-ServiceManager.js":78,"./services/Fable-Service-DataFormat.js":80,"./services/Fable-Service-EnvironmentData.js":81,"./services/Fable-Service-MetaTemplate.js":82,"./services/Fable-Service-Operation.js":84,"./services/Fable-Service-RestClient.js":85,"./services/Fable-Service-Template.js":86,"./services/Fable-Service-Utility.js":87,"fable-log":27,"fable-settings":32,"fable-uuid":34}],80:[function(require,module,exports){/**
|
|
1695
1695
|
*/var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
1696
1696
|
* Data Formatting and Translation Functions
|
|
1697
1697
|
*
|
|
@@ -1887,7 +1887,7 @@ return'';}if(tmpEnclosedValueEndIndex>0&&tmpEnclosedValueEndIndex>tmpEnclosedVal
|
|
|
1887
1887
|
* @param {number} pEnclosureEnd
|
|
1888
1888
|
* @returns {string}
|
|
1889
1889
|
*/},{key:"stringRemoveEnclosureByIndex",value:function stringRemoveEnclosureByIndex(pString,pEnclosureIndexToRemove,pEnclosureStart,pEnclosureEnd){var tmpString=typeof pString=='string'?pString:'';var tmpEnclosureIndexToRemove=typeof pEnclosureIndexToRemove=='number'?pEnclosureIndexToRemove:0;var tmpEnclosureStart=typeof pEnclosureStart=='string'?pEnclosureStart:'(';var tmpEnclosureEnd=typeof pEnclosureEnd=='string'?pEnclosureEnd:')';var tmpEnclosureCount=0;var tmpEnclosureDepth=0;var tmpMatchedEnclosureIndex=false;var tmpEnclosureStartIndex=0;var tmpEnclosureEndIndex=0;for(var i=0;i<tmpString.length;i++){// This is the start of an enclosure
|
|
1890
|
-
if(tmpString[i]==tmpEnclosureStart){tmpEnclosureDepth++;if(tmpEnclosureDepth==1){tmpEnclosureCount++;if(tmpEnclosureIndexToRemove==tmpEnclosureCount-1){tmpMatchedEnclosureIndex=true;tmpEnclosureStartIndex=i;}}}else if(tmpString[i]==tmpEnclosureEnd){tmpEnclosureDepth--;if(tmpEnclosureDepth==0&&tmpMatchedEnclosureIndex&&tmpEnclosureEndIndex<=tmpEnclosureStartIndex){tmpEnclosureEndIndex=i;tmpMatchedEnclosureIndex=false;}}}if(tmpEnclosureCount<=tmpEnclosureIndexToRemove){return tmpString;}var tmpReturnString='';if(tmpEnclosureStartIndex>1){tmpReturnString=tmpString.substring(0,tmpEnclosureStartIndex);}if(tmpString.length>tmpEnclosureEndIndex+1&&tmpEnclosureEndIndex>tmpEnclosureStartIndex){tmpReturnString+=tmpString.substring(tmpEnclosureEndIndex+1);}return tmpReturnString;}}]);return DataFormat;}(libFableServiceProviderBase);module.exports=DataFormat;},{"fable-serviceproviderbase":29}],81:[function(require,module,exports){var libFableServiceBase=require('../Fable-ServiceManager.js').ServiceProviderBase;var libPrecedent=require('precedent');var FableServiceMetaTemplate=/*#__PURE__*/function(
|
|
1890
|
+
if(tmpString[i]==tmpEnclosureStart){tmpEnclosureDepth++;if(tmpEnclosureDepth==1){tmpEnclosureCount++;if(tmpEnclosureIndexToRemove==tmpEnclosureCount-1){tmpMatchedEnclosureIndex=true;tmpEnclosureStartIndex=i;}}}else if(tmpString[i]==tmpEnclosureEnd){tmpEnclosureDepth--;if(tmpEnclosureDepth==0&&tmpMatchedEnclosureIndex&&tmpEnclosureEndIndex<=tmpEnclosureStartIndex){tmpEnclosureEndIndex=i;tmpMatchedEnclosureIndex=false;}}}if(tmpEnclosureCount<=tmpEnclosureIndexToRemove){return tmpString;}var tmpReturnString='';if(tmpEnclosureStartIndex>1){tmpReturnString=tmpString.substring(0,tmpEnclosureStartIndex);}if(tmpString.length>tmpEnclosureEndIndex+1&&tmpEnclosureEndIndex>tmpEnclosureStartIndex){tmpReturnString+=tmpString.substring(tmpEnclosureEndIndex+1);}return tmpReturnString;}}]);return DataFormat;}(libFableServiceProviderBase);module.exports=DataFormat;},{"fable-serviceproviderbase":29}],81:[function(require,module,exports){var libFableServiceBase=require('../Fable-ServiceManager.js').ServiceProviderBase;var FableServiceEnvironmentData=/*#__PURE__*/function(_libFableServiceBase){_inherits(FableServiceEnvironmentData,_libFableServiceBase);var _super8=_createSuper(FableServiceEnvironmentData);function FableServiceEnvironmentData(pFable,pOptions,pServiceHash){var _this11;_classCallCheck2(this,FableServiceEnvironmentData);_this11=_super8.call(this,pFable,pOptions,pServiceHash);_this11.serviceType='EnvironmentData';_this11.Environment="node.js";return _this11;}return _createClass2(FableServiceEnvironmentData);}(libFableServiceBase);module.exports=FableServiceEnvironmentData;},{"../Fable-ServiceManager.js":78}],82:[function(require,module,exports){var libFableServiceBase=require('../Fable-ServiceManager.js').ServiceProviderBase;var libPrecedent=require('precedent');var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase2){_inherits(FableServiceMetaTemplate,_libFableServiceBase2);var _super9=_createSuper(FableServiceMetaTemplate);function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this12;_classCallCheck2(this,FableServiceMetaTemplate);_this12=_super9.call(this,pFable,pOptions,pServiceHash);_this12.serviceType='MetaTemplate';_this12._MetaTemplateLibrary=new libPrecedent(_this12.options);return _this12;}/**
|
|
1891
1891
|
* Add a Pattern to the Parse Tree
|
|
1892
1892
|
* @method addPattern
|
|
1893
1893
|
* @param {Object} pTree - A node on the parse tree to push the characters into
|
|
@@ -1899,7 +1899,7 @@ if(tmpString[i]==tmpEnclosureStart){tmpEnclosureDepth++;if(tmpEnclosureDepth==1)
|
|
|
1899
1899
|
* @method parseString
|
|
1900
1900
|
* @param {string} pString - The string to parse
|
|
1901
1901
|
* @return {string} The result from the parser
|
|
1902
|
-
*/},{key:"parseString",value:function parseString(pString,pData){return this._MetaTemplateLibrary.parseString(pString,pData);}}]);return FableServiceMetaTemplate;}(libFableServiceBase);module.exports=FableServiceMetaTemplate;},{"../Fable-ServiceManager.js":78,"precedent":40}],
|
|
1902
|
+
*/},{key:"parseString",value:function parseString(pString,pData){return this._MetaTemplateLibrary.parseString(pString,pData);}}]);return FableServiceMetaTemplate;}(libFableServiceBase);module.exports=FableServiceMetaTemplate;},{"../Fable-ServiceManager.js":78,"precedent":40}],83:[function(require,module,exports){module.exports={"Metadata":{"GUID":false,"Hash":false,"Title":"","Summary":"","Version":0},"Status":{"Completed":false,"CompletionProgress":0,"CompletionTimeElapsed":0,"Steps":1,"StepsCompleted":0,"StartTime":0,"EndTime":0},"Errors":[],"Log":[]};},{}],84:[function(require,module,exports){var libFableServiceBase=require('../Fable-ServiceManager.js').ServiceProviderBase;var _OperationStatePrototypeString=JSON.stringify(require('./Fable-Service-Operation-DefaultSettings.js'));var FableOperation=/*#__PURE__*/function(_libFableServiceBase3){_inherits(FableOperation,_libFableServiceBase3);var _super10=_createSuper(FableOperation);function FableOperation(pFable,pOptions,pServiceHash){var _this13;_classCallCheck2(this,FableOperation);_this13=_super10.call(this,pFable,pOptions,pServiceHash);_this13.serviceType='PhasedOperation';_this13.state=JSON.parse(_OperationStatePrototypeString);_this13.state.Metadata.GUID=_this13.fable.getUUID();_this13.state.Metadata.Hash=_this13.Hash;_this13.name=typeof _this13.options.Name=='string'?_this13.options.Name:"Unnamed Operation ".concat(_this13.state.Metadata.GUID);return _this13;}_createClass2(FableOperation,[{key:"GUID",get:function get(){return this.state.Metadata.GUID;}},{key:"log",get:function get(){return this;}},{key:"writeOperationLog",value:function writeOperationLog(pLogLevel,pLogText,pLogObject){this.state.Log.push("".concat(new Date().toUTCString()," [").concat(pLogLevel,"]: ").concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Log.push(JSON.stringify(pLogObject));}}},{key:"writeOperationErrors",value:function writeOperationErrors(pLogText,pLogObject){this.state.Errors.push("".concat(pLogText));if(_typeof(pLogObject)=='object'){this.state.Errors.push(JSON.stringify(pLogObject));}}},{key:"trace",value:function trace(pLogText,pLogObject){this.writeOperationLog('TRACE',pLogText,pLogObject);this.fable.log.trace(pLogText,pLogObject);}},{key:"debug",value:function debug(pLogText,pLogObject){this.writeOperationLog('DEBUG',pLogText,pLogObject);this.fable.log.debug(pLogText,pLogObject);}},{key:"info",value:function info(pLogText,pLogObject){this.writeOperationLog('INFO',pLogText,pLogObject);this.fable.log.info(pLogText,pLogObject);}},{key:"warn",value:function warn(pLogText,pLogObject){this.writeOperationLog('WARN',pLogText,pLogObject);this.fable.log.warn(pLogText,pLogObject);}},{key:"error",value:function error(pLogText,pLogObject){this.writeOperationLog('ERROR',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.error(pLogText,pLogObject);}},{key:"fatal",value:function fatal(pLogText,pLogObject){this.writeOperationLog('FATAL',pLogText,pLogObject);this.writeOperationErrors(pLogText,pLogObject);this.fable.log.fatal(pLogText,pLogObject);}}]);return FableOperation;}(libFableServiceBase);module.exports=FableOperation;},{"../Fable-ServiceManager.js":78,"./Fable-Service-Operation-DefaultSettings.js":83}],85:[function(require,module,exports){var libFableServiceBase=require('../Fable-ServiceManager.js').ServiceProviderBase;var libSimpleGet=require('simple-get');var FableServiceRestClient=/*#__PURE__*/function(_libFableServiceBase4){_inherits(FableServiceRestClient,_libFableServiceBase4);var _super11=_createSuper(FableServiceRestClient);function FableServiceRestClient(pFable,pOptions,pServiceHash){var _this14;_classCallCheck2(this,FableServiceRestClient);_this14=_super11.call(this,pFable,pOptions,pServiceHash);_this14.TraceLog=false;if(_this14.options.TraceLog||_this14.fable.TraceLog){_this14.TraceLog=true;}_this14.dataFormat=_this14.fable.defaultServices.DataFormat;_this14.serviceType='RestClient';return _this14;}_createClass2(FableServiceRestClient,[{key:"getJSON",value:function getJSON(pOptionsOrURL,fCallback){return this.getRaw(pOptionsOrURL,function(pError,pResponse,pResult){if(pError){return fCallback(pError,pResponse,pResult);}if(pResponse.statusCode!=200){return fCallback(new Error("Invalid status code ".concat(pResponse.statusCode)),pResponse,pResult);}return fCallback(pError,pResponse,JSON.parse(pResult));});}},{key:"getRaw",value:function getRaw(pOptionsOrURL,fCallback){var _this15=this;var tmpRequestOptions=(typeof pOptions==="undefined"?"undefined":_typeof(pOptions))=='object'?pOptions:{};if(typeof pOptionsOrURL=='string'){tmpRequestOptions.url=pOptionsOrURL;}var tmpRequestStartTime=this.fable.log.getTimeStamp();if(this.TraceLog){var tmpConnectTime=this.fable.log.getTimeStamp();this.fable.log.debug("Beginning GET request to ".concat(tmpRequestOptions.url," at ").concat(tmpRequestStartTime));}libSimpleGet.get(tmpRequestOptions,function(pError,pResponse){if(pError){return fCallback(pError,pResponse,tmpRequestOptions);}if(_this15.TraceLog){var _tmpConnectTime=_this15.fable.log.getTimeStamp();_this15.fable.log.debug("--> GET connected in ".concat(_this15.dataFormat.formatTimeDelta(tmpRequestStartTime,_tmpConnectTime),"ms code ").concat(pResponse.statusCode));}var tmpData='';pResponse.on('data',function(pChunk){if(_this15.TraceLog){var tmpChunkTime=_this15.fable.log.getTimeStamp();_this15.fable.log.debug("--> GET data chunk size ".concat(pChunk.length,"b received in ").concat(_this15.dataFormat.formatTimeDelta(tmpRequestStartTime,tmpChunkTime),"ms"));}tmpData+=pChunk;});pResponse.on('end',function(){if(_this15.TraceLog){var tmpCompletionTime=_this15.fable.log.getTimeStamp();_this15.fable.log.debug("==> GET completed data size ".concat(tmpData.length,"b received in ").concat(_this15.dataFormat.formatTimeDelta(tmpRequestStartTime,tmpCompletionTime),"ms"));}return fCallback(pError,pResponse,tmpData);});});}}]);return FableServiceRestClient;}(libFableServiceBase);module.exports=FableServiceRestClient;},{"../Fable-ServiceManager.js":78,"simple-get":50}],86:[function(require,module,exports){var libFableServiceBase=require('../Fable-ServiceManager.js').ServiceProviderBase;var FableServiceTemplate=/*#__PURE__*/function(_libFableServiceBase5){_inherits(FableServiceTemplate,_libFableServiceBase5);var _super12=_createSuper(FableServiceTemplate);// Underscore and lodash have a behavior, _.template, which compiles a
|
|
1903
1903
|
// string-based template with code snippets into simple executable pieces,
|
|
1904
1904
|
// with the added twist of returning a precompiled function ready to go.
|
|
1905
1905
|
//
|
|
@@ -1908,19 +1908,19 @@ if(tmpString[i]==tmpEnclosureStart){tmpEnclosureDepth++;if(tmpEnclosureDepth==1)
|
|
|
1908
1908
|
//
|
|
1909
1909
|
// This is an implementation of that.
|
|
1910
1910
|
// TODO: Make this use precedent, add configuration, add debugging.
|
|
1911
|
-
function FableServiceTemplate(pFable,pOptions,pServiceHash){var
|
|
1911
|
+
function FableServiceTemplate(pFable,pOptions,pServiceHash){var _this16;_classCallCheck2(this,FableServiceTemplate);_this16=_super12.call(this,pFable,pOptions,pServiceHash);_this16.serviceType='Template';// These are the exact regex's used in lodash/underscore
|
|
1912
1912
|
// TODO: Switch this to precedent
|
|
1913
|
-
|
|
1913
|
+
_this16.Matchers={Evaluate:/<%([\s\S]+?)%>/g,Interpolate:/<%=([\s\S]+?)%>/g,Escaper:/\\|'|\r|\n|\t|\u2028|\u2029/g,Unescaper:/\\(\\|'|r|n|t|u2028|u2029)/g,// This is how underscore does it, so we are keeping it for now.
|
|
1914
1914
|
GuaranteedNonMatch:/.^/};// This is a helper for the escaper and unescaper functions.
|
|
1915
1915
|
// Right now we are going to keep what underscore is doing, but, not forever.
|
|
1916
|
-
|
|
1916
|
+
_this16.templateEscapes={'\\':'\\',"'":"'",'r':'\r','\r':'r','n':'\n','\n':'n','t':'\t','\t':'t','u2028':"\u2028","\u2028":'u2028','u2029':"\u2029","\u2029":'u2029'};// This is defined as such to underscore that it is a dynamic programming
|
|
1917
1917
|
// function on this class.
|
|
1918
|
-
|
|
1918
|
+
_this16.renderFunction=false;_this16.templateString=false;return _this16;}_createClass2(FableServiceTemplate,[{key:"renderTemplate",value:function renderTemplate(pData){return this.renderFunction(pData);}},{key:"templateFunction",value:function templateFunction(pData){var fRenderTemplateBound=this.renderTemplate.bind(this);return fRenderTemplateBound;}},{key:"buildTemplateFunction",value:function buildTemplateFunction(pTemplateText,pData){var _this17=this;// For now this is being kept in a weird form ... this is to mimic the old
|
|
1919
1919
|
// underscore code until this is rewritten using precedent.
|
|
1920
|
-
this.TemplateSource="__p+='"+pTemplateText.replace(this.Matchers.Escaper,function(pMatch){return"\\".concat(
|
|
1920
|
+
this.TemplateSource="__p+='"+pTemplateText.replace(this.Matchers.Escaper,function(pMatch){return"\\".concat(_this17.templateEscapes[pMatch]);}).replace(this.Matchers.Interpolate||this.Matchers.GuaranteedNonMatch,function(pMatch,pCode){return"'+\n(".concat(decodeURIComponent(pCode),")+\n'");}).replace(this.Matchers.Evaluate||this.Matchers.GuaranteedNonMatch,function(pMatch,pCode){return"';\n".concat(decodeURIComponent(pCode),"\n;__p+='");})+"';\n";this.TemplateSource="with(pTemplateDataObject||{}){\n".concat(this.TemplateSource,"}\n");this.TemplateSource="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n".concat(this.TemplateSource,"return __p;\n");this.renderFunction=new Function('pTemplateDataObject',this.TemplateSource);if(typeof pData!='undefined'){return this.renderFunction(pData);}// Provide the compiled function source as a convenience for build time
|
|
1921
1921
|
// precompilation.
|
|
1922
|
-
this.TemplateSourceCompiled='function(obj){\n'+this.TemplateSource+'}';return this.templateFunction();}}]);return FableServiceTemplate;}(libFableServiceBase);module.exports=FableServiceTemplate;},{"../Fable-ServiceManager.js":78}],
|
|
1923
|
-
var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('async.eachlimit');var FableServiceUtility=/*#__PURE__*/function(
|
|
1922
|
+
this.TemplateSourceCompiled='function(obj){\n'+this.TemplateSource+'}';return this.templateFunction();}}]);return FableServiceTemplate;}(libFableServiceBase);module.exports=FableServiceTemplate;},{"../Fable-ServiceManager.js":78}],87:[function(require,module,exports){var libFableServiceBase=require('../Fable-ServiceManager.js').ServiceProviderBase;// TODO: These are still pretty big -- consider the smaller polyfills
|
|
1923
|
+
var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('async.eachlimit');var FableServiceUtility=/*#__PURE__*/function(_libFableServiceBase6){_inherits(FableServiceUtility,_libFableServiceBase6);var _super13=_createSuper(FableServiceUtility);// Underscore and lodash have a behavior, _.template, which compiles a
|
|
1924
1924
|
// string-based template with code snippets into simple executable pieces,
|
|
1925
1925
|
// with the added twist of returning a precompiled function ready to go.
|
|
1926
1926
|
//
|
|
@@ -1929,8 +1929,8 @@ var libAsyncWaterfall=require('async.waterfall');var libAsyncEachLimit=require('
|
|
|
1929
1929
|
//
|
|
1930
1930
|
// This is an implementation of that.
|
|
1931
1931
|
// TODO: Make this use precedent, add configuration, add debugging.
|
|
1932
|
-
function FableServiceUtility(pFable,pOptions,pServiceHash){var
|
|
1933
|
-
|
|
1932
|
+
function FableServiceUtility(pFable,pOptions,pServiceHash){var _this18;_classCallCheck2(this,FableServiceUtility);_this18=_super13.call(this,pFable,pOptions,pServiceHash);_this18.templates={};// These two functions are used extensively throughout
|
|
1933
|
+
_this18.waterfall=libAsyncWaterfall;_this18.eachLimit=libAsyncEachLimit;return _this18;}// Underscore and lodash have a behavior, _.extend, which merges objects.
|
|
1934
1934
|
// Now that es6 gives us this, use the native thingy.
|
|
1935
1935
|
_createClass2(FableServiceUtility,[{key:"extend",value:function extend(pDestinationObject){for(var _len2=arguments.length,pSourceObjects=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){pSourceObjects[_key2-1]=arguments[_key2];}return Object.assign.apply(Object,[pDestinationObject].concat(pSourceObjects));}// Underscore and lodash have a behavior, _.template, which compiles a
|
|
1936
1936
|
// string-based template with code snippets into simple executable pieces,
|