orator 3.0.4 → 3.0.5
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/debug/Harness.js
CHANGED
package/dist/orator.js
CHANGED
|
@@ -1005,7 +1005,7 @@ invoke(pMethod,pRoute,pData,fCallback){// If the data is skipped and a callback
|
|
|
1005
1005
|
let tmpCallback=typeof fCallback=='function'?fCallback:typeof pData=='function'?pData:// This is here in case the developer passed no callback and just wants to fire and forget the IPC call which might not be async safe
|
|
1006
1006
|
()=>{};// Create a bare minimum request object for IPC to pass to our router
|
|
1007
1007
|
let tmpRequest={method:pMethod,url:pRoute,guid:this.orator.fable.getUUID()};// Create a container for the IPC response data to be aggregated to from send() methodds
|
|
1008
|
-
let tmpSynthesizedResponseData=new libOratorServiceServerIPCSynthesizedResponse(this.log,tmpRequest.guid);return this.router.lookup(tmpRequest,tmpSynthesizedResponseData,(pError,pResults)=>{if(pError){this.log.error(`IPC Request Error Request GUID [${tmpRequest.guid}] handling route [${pRoute}]: ${pError}`,{Error:pError,Route:pRoute,Data:pData});}// by default, send data back through
|
|
1008
|
+
let tmpSynthesizedResponseData=new libOratorServiceServerIPCSynthesizedResponse(this.log,tmpRequest.guid);return this.router.lookup(tmpRequest,tmpSynthesizedResponseData,(pError,pResults)=>{if(pError){this.log.error(`IPC Request Error Request GUID [${tmpRequest.guid}] handling route [${pRoute}]: ${pError}`,{Error:pError,Route:pRoute,Data:pData});}// by default, send data back through
|
|
1009
1009
|
return tmpCallback(pError,tmpSynthesizedResponseData.responseData,tmpSynthesizedResponseData,pResults);});}}module.exports=OratorServiceServerIPC;},{"./Orator-ServiceServer-IPC-RouterConstrainer.js":67,"./Orator-ServiceServer-IPC-SynthesizedResponse.js":68,"async/eachofseries":8,"async/waterfall":22,"find-my-way":44,"orator-serviceserver":52}],70:[function(require,module,exports){/**
|
|
1010
1010
|
* Orator Service Abstraction
|
|
1011
1011
|
*
|
|
@@ -1024,7 +1024,7 @@ this.settings.ServicePort=defaultOratorConfiguration.ServicePort;}}// Now check
|
|
|
1024
1024
|
if(!this.settings.hasOwnProperty('Product')){this.settings.Product=defaultOratorConfiguration.Product;}}initializeServiceServer(fNext){var tmpNext=typeof fNext==='function'?fNext:()=>{};if(!this.serviceServer){// If the developer hasn't set this to a service provider class of their own choosing,
|
|
1025
1025
|
// use the built-in network-less one.
|
|
1026
1026
|
if(!this.serviceServerProvider){this.serviceServerProvider=defaultOratorServiceServers.default;}this.serviceServer=new this.serviceServerProvider(this);// For legacy reasons, we also will provide this under the "webServer" variable.
|
|
1027
|
-
this.webServer=this.serviceServer;}else{this.log.warn(`Orator attempting to initialize a service server after initialization has already completed.`);}}_startServiceListener(fNext){return this.serviceServer.listen(this.settings.ServicePort,pError=>{this.log.info(`${this.serviceServer.Name} listening at ${this.serviceServer.URL} port ${this.serviceServer.Port}`);return fNext(pError);});}startService(fNext){var tmpNext=typeof fNext==='function'?fNext:()=>{};if(!this.serviceServer){this.initializeServiceServer();}return this._startServiceListener(tmpNext);}stopService(fNext){var tmpNext=typeof fNext==='function'?fNext:()=>{};if(!this.serviceServer){let tmpMessage=`Orator attempting to stop a service server but the service server has not been intialized yet.`;this.log.warn(tmpMessage);return tmpNext(tmpMessage);}if(!this.serviceServer.Active){let tmpMessage=`Orator attempting to stop a service server but the service server is not actively running.`;this.log.warn(tmpMessage);return tmpNext(tmpMessage);}return this.serviceServer.close(tmpNext);}invoke(pMethod,pRoute,pData,fCallback){return this.serviceServer.invoke(pMethod,pRoute,pData,fCallback);}/*
|
|
1027
|
+
this.webServer=this.serviceServer;}else{this.log.warn(`Orator attempting to initialize a service server after initialization has already completed.`);}return tmpNext();}_startServiceListener(fNext){return this.serviceServer.listen(this.settings.ServicePort,pError=>{this.log.info(`${this.serviceServer.Name} listening at ${this.serviceServer.URL} port ${this.serviceServer.Port}`);return fNext(pError);});}startService(fNext){var tmpNext=typeof fNext==='function'?fNext:()=>{};if(!this.serviceServer){this.initializeServiceServer();}return this._startServiceListener(tmpNext);}stopService(fNext){var tmpNext=typeof fNext==='function'?fNext:()=>{};if(!this.serviceServer){let tmpMessage=`Orator attempting to stop a service server but the service server has not been intialized yet.`;this.log.warn(tmpMessage);return tmpNext(tmpMessage);}if(!this.serviceServer.Active){let tmpMessage=`Orator attempting to stop a service server but the service server is not actively running.`;this.log.warn(tmpMessage);return tmpNext(tmpMessage);}return this.serviceServer.close(tmpNext);}invoke(pMethod,pRoute,pData,fCallback){return this.serviceServer.invoke(pMethod,pRoute,pData,fCallback);}/*
|
|
1028
1028
|
* Legacy Orator Functions
|
|
1029
1029
|
*************************************************************************/startWebServer(fNext){return this.startService(fNext);}// For legacy purposes
|
|
1030
1030
|
stopWebServer(fNext){return this.stopService(fNext);}// For legacy purposes
|
package/dist/orator.min.js
CHANGED
|
@@ -132,5 +132,5 @@ getDefaultServiceServers=()=>{let e={};return e.ipc=t("./Orator-ServiceServer-IP
|
|
|
132
132
|
* @author Steven Velozo <steven@velozo.com>
|
|
133
133
|
* @module Orator Service
|
|
134
134
|
*/
|
|
135
|
-
const n=t("fable"),i=t("./Orator-Default-Configuration.js"),s=t("./Orator-Default-ServiceServers-Node.js");e.exports=class{constructor(t,e){this.fable="object"==typeof t&&t instanceof n?t:new n("object"==typeof t?t:i),this.settings=this.fable.settings,this.log=this.fable.log,this.serviceServer=!1,this.serviceServerProvider=!1,void 0!==e&&(this.serviceServerProvider=e),this.settings.hasOwnProperty("ServicePort")||(this.settings.hasOwnProperty("APIServerPort")?this.settings.ServicePort=this.fable.settings.APIServerPort:this.settings.ServicePort=i.ServicePort),this.settings.hasOwnProperty("Product")||(this.settings.Product=i.Product)}initializeServiceServer(t){this.serviceServer?this.log.warn("Orator attempting to initialize a service server after initialization has already completed."):(this.serviceServerProvider||(this.serviceServerProvider=s.default),this.serviceServer=new this.serviceServerProvider(this),this.webServer=this.serviceServer)}_startServiceListener(t){return this.serviceServer.listen(this.settings.ServicePort,(e=>(this.log.info(`${this.serviceServer.Name} listening at ${this.serviceServer.URL} port ${this.serviceServer.Port}`),t(e))))}startService(t){var e="function"==typeof t?t:()=>{};return this.serviceServer||this.initializeServiceServer(),this._startServiceListener(e)}stopService(t){var e="function"==typeof t?t:()=>{};if(!this.serviceServer){let t="Orator attempting to stop a service server but the service server has not been intialized yet.";return this.log.warn(t),e(t)}if(!this.serviceServer.Active){let t="Orator attempting to stop a service server but the service server is not actively running.";return this.log.warn(t),e(t)}return this.serviceServer.close(e)}invoke(t,e,r,n){return this.serviceServer.invoke(t,e,r,n)}startWebServer(t){return this.startService(t)}stopWebServer(t){return this.stopService(t)}getWebServer(){return this.serviceServer||this.initializeServiceServer(),this.serviceServer}}},{"./Orator-Default-Configuration.js":65,"./Orator-Default-ServiceServers-Node.js":66,fable:35}]},{},[64])(64)}));
|
|
135
|
+
const n=t("fable"),i=t("./Orator-Default-Configuration.js"),s=t("./Orator-Default-ServiceServers-Node.js");e.exports=class{constructor(t,e){this.fable="object"==typeof t&&t instanceof n?t:new n("object"==typeof t?t:i),this.settings=this.fable.settings,this.log=this.fable.log,this.serviceServer=!1,this.serviceServerProvider=!1,void 0!==e&&(this.serviceServerProvider=e),this.settings.hasOwnProperty("ServicePort")||(this.settings.hasOwnProperty("APIServerPort")?this.settings.ServicePort=this.fable.settings.APIServerPort:this.settings.ServicePort=i.ServicePort),this.settings.hasOwnProperty("Product")||(this.settings.Product=i.Product)}initializeServiceServer(t){var e="function"==typeof t?t:()=>{};return this.serviceServer?this.log.warn("Orator attempting to initialize a service server after initialization has already completed."):(this.serviceServerProvider||(this.serviceServerProvider=s.default),this.serviceServer=new this.serviceServerProvider(this),this.webServer=this.serviceServer),e()}_startServiceListener(t){return this.serviceServer.listen(this.settings.ServicePort,(e=>(this.log.info(`${this.serviceServer.Name} listening at ${this.serviceServer.URL} port ${this.serviceServer.Port}`),t(e))))}startService(t){var e="function"==typeof t?t:()=>{};return this.serviceServer||this.initializeServiceServer(),this._startServiceListener(e)}stopService(t){var e="function"==typeof t?t:()=>{};if(!this.serviceServer){let t="Orator attempting to stop a service server but the service server has not been intialized yet.";return this.log.warn(t),e(t)}if(!this.serviceServer.Active){let t="Orator attempting to stop a service server but the service server is not actively running.";return this.log.warn(t),e(t)}return this.serviceServer.close(e)}invoke(t,e,r,n){return this.serviceServer.invoke(t,e,r,n)}startWebServer(t){return this.startService(t)}stopWebServer(t){return this.stopService(t)}getWebServer(){return this.serviceServer||this.initializeServiceServer(),this.serviceServer}}},{"./Orator-Default-Configuration.js":65,"./Orator-Default-ServiceServers-Node.js":66,fable:35}]},{},[64])(64)}));
|
|
136
136
|
//# sourceMappingURL=orator.min.js.map
|