fable 3.0.123 → 3.0.124
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/fable.compatible.js
CHANGED
|
@@ -3019,12 +3019,12 @@ _this17.connectFable(_assertThisInitialized(_this17));// --> Bootstrapping of fa
|
|
|
3019
3019
|
_this17.connectPreinitServiceProviderInstance(_this17.UUID);_this17.connectPreinitServiceProviderInstance(_this17.Logging);_this17.connectPreinitServiceProviderInstance(_this17.SettingsManager);// Initialize and instantiate the default baked-in Data Arithmatic service
|
|
3020
3020
|
_this17.addAndInstantiateServiceType('EnvironmentData',require('./services/Fable-Service-EnvironmentData.js'));_this17.addServiceType('Template',require('./services/Fable-Service-Template.js'));_this17.addServiceType('MetaTemplate',require('./services/Fable-Service-MetaTemplate.js'));_this17.addServiceType('Anticipate',require('./services/Fable-Service-Anticipate.js'));_this17.addAndInstantiateServiceType('Dates',require('./services/Fable-Service-DateManipulation.js'));_this17.addAndInstantiateServiceType('DataFormat',require('./services/Fable-Service-DataFormat.js'));_this17.addAndInstantiateServiceType('DataGeneration',require('./services/Fable-Service-DataGeneration.js'));_this17.addAndInstantiateServiceType('Utility',require('./services/Fable-Service-Utility.js'));_this17.addAndInstantiateServiceType('Math',require('./services/Fable-Service-Math.js'));_this17.addServiceType('RestClient',require('./services/Fable-Service-RestClient.js'));_this17.addServiceType('Manifest',require('manyfest'));_this17.addServiceType('ObjectCache',require('cachetrax'));_this17.addAndInstantiateServiceType('ProgressTime',require('./services/Fable-Service-ProgressTime.js'));_this17.addServiceType('ProgressTrackerSet',require('./services/Fable-Service-ProgressTrackerSet.js'));_this17.addServiceType('Operation',require('./services/Fable-Service-Operation.js'));_this17.addServiceType('CSVParser',require('./services/Fable-Service-CSVParser.js'));_this17.addServiceType('FilePersistence',require('./services/Fable-Service-FilePersistence.js'));return _this17;}/* State Accessors */_createClass2(Fable,[{key:"isFable",get:function get(){return true;}},{key:"settings",get:function get(){return this.SettingsManager.settings;}},{key:"settingsManager",get:function get(){return this.SettingsManager;}// For backwards compatibility
|
|
3021
3021
|
},{key:"getUUID",value:function getUUID(){return this.UUID.getUUID();}},{key:"newAnticipate",value:function newAnticipate(){return this.instantiateServiceProviderWithoutRegistration('Anticipate');}/* Service Manager Methods */},{key:"addServiceType",value:function addServiceType(pServiceType,pServiceClass){if(this.servicesMap.hasOwnProperty(pServiceType)){// TODO: Check if any services are running?
|
|
3022
|
-
this.log.warn("Adding a service type [".concat(pServiceType,"] that already exists."));}else{// Add the container for instantiated services to go in
|
|
3022
|
+
this.log.warn("Adding a service type [".concat(pServiceType,"] that already exists. This will change the default class prototype for this service."));}else{// Add the container for instantiated services to go in
|
|
3023
3023
|
this.servicesMap[pServiceType]={};// Add the type to the list of types
|
|
3024
3024
|
this.serviceTypes.push(pServiceType);}// Using the static member of the class is a much more reliable way to check if it is a service class than instanceof
|
|
3025
3025
|
if(typeof pServiceClass=='function'&&pServiceClass.isFableService){// Add the class to the list of classes
|
|
3026
3026
|
this.serviceClasses[pServiceType]=pServiceClass;}else{// Add the base class to the list of classes
|
|
3027
|
-
this.log.error("Attempted to add service type [".concat(pServiceType,"] with an invalid class. Using base service class, which will not crash but won't provide meaningful services."));this.serviceClasses[pServiceType]=libFableServiceBase;}}// This is for the services that are meant to run mostly single-instance so need a default at initialization
|
|
3027
|
+
this.log.error("Attempted to add service type [".concat(pServiceType,"] with an invalid class. Using base service class, which will not crash but won't provide meaningful services."));this.serviceClasses[pServiceType]=libFableServiceBase;}return this.serviceClasses[pServiceType];}},{key:"addServiceTypeIfNotExists",value:function addServiceTypeIfNotExists(pServiceType,pServiceClass){if(!this.servicesMap.hasOwnProperty(pServiceType)){return this.addServiceType(pServiceType,pServiceClass);}else{return this.serviceClasses[pServiceType];}}// This is for the services that are meant to run mostly single-instance so need a default at initialization
|
|
3028
3028
|
},{key:"addAndInstantiateServiceType",value:function addAndInstantiateServiceType(pServiceType,pServiceClass){this.addServiceType(pServiceType,pServiceClass);return this.instantiateServiceProvider(pServiceType,{},"".concat(pServiceType,"-Default"));}// Some services expect to be overloaded / customized class.
|
|
3029
3029
|
},{key:"instantiateServiceProviderFromPrototype",value:function instantiateServiceProviderFromPrototype(pServiceType,pOptions,pCustomServiceHash,pServicePrototype){// Instantiate the service
|
|
3030
3030
|
var tmpService=new pServicePrototype(this,pOptions,pCustomServiceHash);if(this.extraServiceInitialization){tmpService=this.extraServiceInitialization(tmpService);}// Add the service to the service map
|
|
@@ -3032,7 +3032,7 @@ this.servicesMap[pServiceType][tmpService.Hash]=tmpService;// If this is the fir
|
|
|
3032
3032
|
if(!this.services.hasOwnProperty(pServiceType)){this.setDefaultServiceInstantiation(pServiceType,tmpService.Hash);}return tmpService;}},{key:"instantiateServiceProvider",value:function instantiateServiceProvider(pServiceType,pOptions,pCustomServiceHash){// Instantiate the service
|
|
3033
3033
|
var tmpService=this.instantiateServiceProviderWithoutRegistration(pServiceType,pOptions,pCustomServiceHash);// Add the service to the service map
|
|
3034
3034
|
this.servicesMap[pServiceType][tmpService.Hash]=tmpService;// If this is the first service of this type, make it the default
|
|
3035
|
-
if(!this.services.hasOwnProperty(pServiceType)){this.setDefaultServiceInstantiation(pServiceType,tmpService.Hash);}return tmpService;}// Create a service provider but don't register it to live forever in fable.services
|
|
3035
|
+
if(!this.services.hasOwnProperty(pServiceType)){this.setDefaultServiceInstantiation(pServiceType,tmpService.Hash);}return tmpService;}},{key:"instantiateServiceProviderIfNotExists",value:function instantiateServiceProviderIfNotExists(pServiceType,pOptions,pCustomServiceHash){if(this.services.hasOwnProperty(pServiceType)){return this.services[pServiceType];}else{return this.instantiateServiceProvider(pServiceType,pOptions,pCustomServiceHash);}}// Create a service provider but don't register it to live forever in fable.services
|
|
3036
3036
|
},{key:"instantiateServiceProviderWithoutRegistration",value:function instantiateServiceProviderWithoutRegistration(pServiceType,pOptions,pCustomServiceHash){// Instantiate the service
|
|
3037
3037
|
var tmpService=new this.serviceClasses[pServiceType](this,pOptions,pCustomServiceHash);if(this.extraServiceInitialization){tmpService=this.extraServiceInitialization(tmpService);}return tmpService;}// Connect an initialized service provider that came before Fable was initialized
|
|
3038
3038
|
},{key:"connectPreinitServiceProviderInstance",value:function connectPreinitServiceProviderInstance(pServiceInstance){var tmpServiceType=pServiceInstance.serviceType;var tmpServiceHash=pServiceInstance.Hash;// The service should already be instantiated, so just connect it to fable
|