fable-serviceproviderbase 3.0.11 → 3.0.12
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-serviceproviderbase.compatible.js +17 -14
- package/dist/fable-serviceproviderbase.compatible.min.js +1 -1
- package/dist/fable-serviceproviderbase.compatible.min.js.map +1 -1
- package/dist/fable-serviceproviderbase.js +17 -14
- package/dist/fable-serviceproviderbase.min.js +1 -1
- package/dist/fable-serviceproviderbase.min.js.map +1 -1
- package/package.json +1 -1
- package/source/Fable-ServiceProviderBase.js +20 -18
|
@@ -64,29 +64,26 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
64
64
|
// 2) With an object or nothing as the first parameter, where it will be treated as the options object
|
|
65
65
|
function FableServiceProviderBase(pFable, pOptions, pServiceHash) {
|
|
66
66
|
_classCallCheck(this, FableServiceProviderBase);
|
|
67
|
-
// Check if a fable was passed in
|
|
67
|
+
// Check if a fable was passed in; connect it if so
|
|
68
68
|
if (_typeof(pFable) === 'object' && pFable.isFable) {
|
|
69
|
-
this.
|
|
69
|
+
this.connectFable(pFable);
|
|
70
70
|
} else {
|
|
71
71
|
this.fable = false;
|
|
72
72
|
}
|
|
73
|
+
|
|
74
|
+
// initialize options and UUID based on whether the fable was passed in or not.
|
|
73
75
|
if (this.fable) {
|
|
74
|
-
this.
|
|
76
|
+
this.UUID = pFable.getUUID();
|
|
75
77
|
this.options = _typeof(pOptions) === 'object' ? pOptions : {};
|
|
76
78
|
} else {
|
|
77
79
|
// With no fable, check to see if there was an object passed into either of the first two
|
|
78
80
|
// Parameters, and if so, treat it as the options object
|
|
79
81
|
this.options = _typeof(pFable) === 'object' && !pFable.isFable ? pFable : _typeof(pOptions) === 'object' ? pOptions : {};
|
|
82
|
+
this.UUID = "CORE-SVC-".concat(Math.floor(Math.random() * (99999 - 10000) + 10000));
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
// It's expected that the deriving class will set this
|
|
83
|
-
this.serviceType =
|
|
84
|
-
if (this.fable) {
|
|
85
|
-
this.UUID = pFable.getUUID();
|
|
86
|
-
} else {
|
|
87
|
-
// Without any dependencies, get a decently random UUID for the service
|
|
88
|
-
this.UUID = "CORE-SVC-".concat(Math.floor(Math.random() * (99999 - 10000) + 10000));
|
|
89
|
-
}
|
|
86
|
+
this.serviceType = "Unknown-".concat(this.UUID);
|
|
90
87
|
|
|
91
88
|
// The service hash is used to identify the specific instantiation of the service in the services map
|
|
92
89
|
this.Hash = typeof pServiceHash === 'string' ? pServiceHash : !this.fable && typeof pOptions === 'string' ? pOptions : "".concat(this.UUID);
|
|
@@ -102,9 +99,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
102
99
|
if (!this.fable) {
|
|
103
100
|
this.fable = pFable;
|
|
104
101
|
}
|
|
105
|
-
this.log
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
if (!this.log) {
|
|
103
|
+
this.log = this.fable.Logging;
|
|
104
|
+
}
|
|
105
|
+
if (!this.services) {
|
|
106
|
+
this.services = this.fable.services;
|
|
107
|
+
}
|
|
108
|
+
if (!this.servicesMap) {
|
|
109
|
+
this.servicesMap = this.fable.servicesMap;
|
|
110
|
+
}
|
|
108
111
|
return true;
|
|
109
112
|
}
|
|
110
113
|
}]);
|
|
@@ -113,7 +116,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
113
116
|
_defineProperty(FableServiceProviderBase, "isFableService", true);
|
|
114
117
|
module.exports = FableServiceProviderBase;
|
|
115
118
|
|
|
116
|
-
// This is left here in case we want to go back to having different code for "core" services
|
|
119
|
+
// This is left here in case we want to go back to having different code/base class for "core" services
|
|
117
120
|
module.exports.CoreServiceProviderBase = FableServiceProviderBase;
|
|
118
121
|
}, {}]
|
|
119
122
|
}, {}, [1])(1);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).FableServiceproviderbase=e()}}((function(){return function e(t,r,o){function
|
|
1
|
+
"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}!function(e){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).FableServiceproviderbase=e()}}((function(){return function e(t,r,o){function i(f,s){if(!r[f]){if(!t[f]){var a="function"==typeof require&&require;if(!s&&a)return a(f,!0);if(n)return n(f,!0);var c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[f]={exports:{}};t[f][0].call(l.exports,(function(e){return i(t[f][1][e]||e)}),l,l.exports,e,t,r,o)}return r[f].exports}for(var n="function"==typeof require&&require,f=0;f<o.length;f++)i(o[f]);return i}({1:[function(e,t,r){var o=function(){function e(t,r,o){_classCallCheck(this,e),"object"===_typeof(t)&&t.isFable?this.connectFable(t):this.fable=!1,this.fable?(this.UUID=t.getUUID(),this.options="object"===_typeof(r)?r:{}):(this.options="object"!==_typeof(t)||t.isFable?"object"===_typeof(r)?r:{}:t,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof o?o:this.fable||"string"!=typeof r?"".concat(this.UUID):r}return _createClass(e,[{key:"connectFable",value:function(e){if("object"!==_typeof(e)||!e.isFable){var t="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(_typeof(e),"].}");return console.log(t),new Error(t)}return this.fable||(this.fable=e),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}]),e}();_defineProperty(o,"isFableService",!0),t.exports=o,t.exports.CoreServiceProviderBase=o},{}]},{},[1])(1)}));
|
|
2
2
|
//# sourceMappingURL=fable-serviceproviderbase.compatible.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["fable-serviceproviderbase.compatible.min.js","node_modules/browser-pack/_prelude.js","source/Fable-ServiceProviderBase.js"],"names":["_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","protoProps","staticProps","prototype","_defineProperty","obj","value","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","Number","o","iterator","constructor","f","exports","module","define","amd","window","global","self","this","FableServiceproviderbase","r","e","n","t","c","require","u","a","Error","code","p","FableServiceProviderBase","pFable","pOptions","pServiceHash","isFable","fable","connectFable","options","serviceType","UUID","getUUID","concat","Math","floor","random","Hash","tmpErrorMessage","console","log","servicesMap","services","CoreServiceProviderBase"],"mappings":"AAAA,aAEA,SAASA,gBAAgBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,oCAAwC,CACxJ,SAASC,kBAAkBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,IAAIE,EAAaH,EAAMC,GAAIE,EAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,UAAWF,IAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQU,eAAeN,EAAWO,KAAMP,EAAa,CAAE,CAC5U,SAASQ,aAAaf,EAAagB,EAAYC,GAAyN,OAAtMD,GAAYd,kBAAkBF,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kB,MAEAlB,KAAAsB,KAAAR,EAAAS,UAKAvB,KAAAsB,KAAA,YAAAE,OAAAC,KAAAC,MAAA,MAAAD,KAAAE,SAAA,MAIA3B,KAAA4B,KAAA,iBAAAZ,EAAAA,EACAhB,KAAAkB,OAAA,iBAAAH,EAAA,GAAAS,OACAxB,KAAAsB,MADAP,CAEA,CAqBA,OArBA9C,aAAA4C,EAAA,CAAA,CAAA7C,IAAA,eAAAO,MAEA,SAAAuC,GAEA,GAAA,WAAApC,QAAAoC,KAAAA,EAAAG,QACA,CACA,IAAAY,EAAA,sHAAAL,OAAA9C,QAAAoC,GAAA,OAEA,OADAgB,QAAAC,IAAAF,GACA,IAAAnB,MAAAmB,EACA,CAWA,OATA7B,KAAAkB,QAEAlB,KAAAkB,MAAAJ,GAGAd,KAAA+B,IAAA/B,KAAAkB,MAAAa,IACA/B,KAAAgC,YAAAhC,KAAAkB,MAAAc,YACAhC,KAAAiC,SAAAjC,KAAAkB,MAAAe,UAEA,CACA,KAAApB,CAAA,CAtEA,GAsEAxC,gBAtEAwC,EAAA,kBAwEA,GAGAnB,EAAAD,QAAAoB,EAGAnB,EAAAD,QAAAyC,wBAAArB,CFEA,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GCrFX,CDqFe,EACf","file":"fable-serviceproviderbase.compatible.min.js","sourcesContent":["(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.FableServiceproviderbase = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\t// The constructor can be used in two ways:\n\t// 1) With a fable, options object and service hash (the options object and service hash are optional)\n\t// 2) With an object or nothing as the first parameter, where it will be treated as the options object\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\t// Check if a fable was passed in\n\t\tif ((typeof(pFable) === 'object') && pFable.isFable)\n\t\t{\n\t\t\tthis.fable = pFable;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.fable = false;\n\t\t}\n\n\t\tif (this.fable)\n\t\t{\n\t\t\tthis.connectFable(this.fable);\n\t\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// With no fable, check to see if there was an object passed into either of the first two\n\t\t\t// Parameters, and if so, treat it as the options object\n\t\t\tthis.options = ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t\t: (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t}\n\n\t\t// It's expected that the deriving class will set this\n\t\tthis.serviceType = 'Unknown';\n\n\t\tif (this.fable)\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Without any dependencies, get a decently random UUID for the service\n\t\t\tthis.UUID = `CORE-SVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\t// The service hash is used to identify the specific instantiation of the service in the services map\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash \n\t\t\t\t\t: (!this.fable && (typeof(pOptions) === 'string')) ? pOptions\n\t\t\t\t\t: `${this.UUID}`;\n\t}\n\n\tconnectFable(pFable)\n\t{\n\t\tif ((typeof(pFable) !== 'object') || (!pFable.isFable))\n\t\t{\n\t\t\tlet tmpErrorMessage = `Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof(pFable)}].}`;\n\t\t\tconsole.log(tmpErrorMessage);\n\t\t\treturn new Error(tmpErrorMessage);\n\t\t}\n\n\t\tif (!this.fable)\n\t\t{\n\t\t\tthis.fable = pFable;\n\t\t}\n\n\t\tthis.log = this.fable.log;\n\t\tthis.servicesMap = this.fable.servicesMap;\n\t\tthis.services = this.fable.services;\n\n\t\treturn true;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\n// This is left here in case we want to go back to having different code for \"core\" services\nmodule.exports.CoreServiceProviderBase = FableServiceProviderBase;\n},{}]},{},[1])(1)\n});\n\n","(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()","/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\t// The constructor can be used in two ways:\n\t// 1) With a fable, options object and service hash (the options object and service hash are optional)\n\t// 2) With an object or nothing as the first parameter, where it will be treated as the options object\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\t// Check if a fable was passed in\n\t\tif ((typeof(pFable) === 'object') && pFable.isFable)\n\t\t{\n\t\t\tthis.fable = pFable;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.fable = false;\n\t\t}\n\n\t\tif (this.fable)\n\t\t{\n\t\t\tthis.connectFable(this.fable);\n\t\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// With no fable, check to see if there was an object passed into either of the first two\n\t\t\t// Parameters, and if so, treat it as the options object\n\t\t\tthis.options = ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t\t: (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t}\n\n\t\t// It's expected that the deriving class will set this\n\t\tthis.serviceType = 'Unknown';\n\n\t\tif (this.fable)\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Without any dependencies, get a decently random UUID for the service\n\t\t\tthis.UUID = `CORE-SVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\t// The service hash is used to identify the specific instantiation of the service in the services map\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash \n\t\t\t\t\t: (!this.fable && (typeof(pOptions) === 'string')) ? pOptions\n\t\t\t\t\t: `${this.UUID}`;\n\t}\n\n\tconnectFable(pFable)\n\t{\n\t\tif ((typeof(pFable) !== 'object') || (!pFable.isFable))\n\t\t{\n\t\t\tlet tmpErrorMessage = `Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof(pFable)}].}`;\n\t\t\tconsole.log(tmpErrorMessage);\n\t\t\treturn new Error(tmpErrorMessage);\n\t\t}\n\n\t\tif (!this.fable)\n\t\t{\n\t\t\tthis.fable = pFable;\n\t\t}\n\n\t\tthis.log = this.fable.log;\n\t\tthis.servicesMap = this.fable.servicesMap;\n\t\tthis.services = this.fable.services;\n\n\t\treturn true;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\n// This is left here in case we want to go back to having different code for \"core\" services\nmodule.exports.CoreServiceProviderBase = FableServiceProviderBase;"]}
|
|
1
|
+
{"version":3,"sources":["fable-serviceproviderbase.compatible.min.js","node_modules/browser-pack/_prelude.js","source/Fable-ServiceProviderBase.js"],"names":["_classCallCheck","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_createClass","protoProps","staticProps","prototype","_defineProperty","obj","value","arg","_toPrimitive","_typeof","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","Number","o","iterator","constructor","f","exports","module","define","amd","window","global","self","this","FableServiceproviderbase","r","e","n","t","c","require","u","a","Error","code","p","FableServiceProviderBase","pFable","pOptions","pServiceHash","isFable","connectFable","fable","UUID","getUUID","options","concat","Math","floor","random","serviceType","Hash","tmpErrorMessage","console","log","Logging","services","servicesMap","CoreServiceProviderBase"],"mappings":"AAAA,aAEA,SAASA,gBAAgBC,EAAUC,GAAe,KAAMD,aAAoBC,GAAgB,MAAM,IAAIC,UAAU,oCAAwC,CACxJ,SAASC,kBAAkBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,IAAIE,EAAaH,EAAMC,GAAIE,EAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,UAAWF,IAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQU,eAAeN,EAAWO,KAAMP,EAAa,CAAE,CAC5U,SAASQ,aAAaf,EAAagB,EAAYC,GAAyN,OAAtMD,GAAYd,kBAAkBF,EAAYkB,UAAWF,GAAiBC,GAAaf,kBAAkBF,EAAaiB,GAAcN,OAAOC,eAAeZ,EAAa,YAAa,CAAEU,UAAU,IAAiBV,CAAa,CAC5R,SAASmB,gBAAgBC,EAAKN,EAAKO,GAA4L,OAAnLP,EAAMD,eAAeC,MAAiBM,EAAOT,OAAOC,eAAeQ,EAAKN,EAAK,CAAEO,MAAOA,EAAOb,YAAY,EAAMC,cAAc,EAAMC,UAAU,IAAkBU,EAAIN,GAAOO,EAAgBD,CAAK,CAC3O,SAASP,eAAeS,GAAO,IAAIR,EAAMS,aAAaD,EAAK,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AgB,QAAAC,IAAAF,GACA,IAAAnB,MAAAmB,EACA,CAqBA,OAnBA7B,KAAAmB,QAEAnB,KAAAmB,MAAAL,GAGAd,KAAA+B,MAEA/B,KAAA+B,IAAA/B,KAAAmB,MAAAa,SAEAhC,KAAAiC,WAEAjC,KAAAiC,SAAAjC,KAAAmB,MAAAc,UAGAjC,KAAAkC,cAEAlC,KAAAkC,YAAAlC,KAAAmB,MAAAe,cAGA,CACA,KAAArB,CAAA,CAxEA,GAwEAxC,gBAxEAwC,EAAA,kBA0EA,GAGAnB,EAAAD,QAAAoB,EAGAnB,EAAAD,QAAA0C,wBAAAtB,CFEA,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GCvFX,CDuFe,EACf","file":"fable-serviceproviderbase.compatible.min.js","sourcesContent":["(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.FableServiceproviderbase = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\t// The constructor can be used in two ways:\n\t// 1) With a fable, options object and service hash (the options object and service hash are optional)\n\t// 2) With an object or nothing as the first parameter, where it will be treated as the options object\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\t// Check if a fable was passed in; connect it if so\n\t\tif ((typeof(pFable) === 'object') && pFable.isFable)\n\t\t{\n\t\t\tthis.connectFable(pFable);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.fable = false;\n\t\t}\n\n\t\t// initialize options and UUID based on whether the fable was passed in or not.\n\t\tif (this.fable)\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// With no fable, check to see if there was an object passed into either of the first two\n\t\t\t// Parameters, and if so, treat it as the options object\n\t\t\tthis.options = ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t\t: (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t\tthis.UUID = `CORE-SVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\t// It's expected that the deriving class will set this\n\t\tthis.serviceType = `Unknown-${this.UUID}`;\n\n\t\t// The service hash is used to identify the specific instantiation of the service in the services map\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash \n\t\t\t\t\t: (!this.fable && (typeof(pOptions) === 'string')) ? pOptions\n\t\t\t\t\t: `${this.UUID}`;\n\t}\n\n\tconnectFable(pFable)\n\t{\n\t\tif ((typeof(pFable) !== 'object') || (!pFable.isFable))\n\t\t{\n\t\t\tlet tmpErrorMessage = `Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof(pFable)}].}`;\n\t\t\tconsole.log(tmpErrorMessage);\n\t\t\treturn new Error(tmpErrorMessage);\n\t\t}\n\n\t\tif (!this.fable)\n\t\t{\n\t\t\tthis.fable = pFable;\n\t\t}\n\n\t\tif (!this.log)\n\t\t{\n\t\t\tthis.log = this.fable.Logging;\n\t\t}\n\t\tif (!this.services)\n\t\t{\n\t\t\tthis.services = this.fable.services;\n\t\t}\n\n\t\tif (!this.servicesMap)\n\t\t{\n\t\t\tthis.servicesMap = this.fable.servicesMap;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\n// This is left here in case we want to go back to having different code/base class for \"core\" services\nmodule.exports.CoreServiceProviderBase = FableServiceProviderBase;\n},{}]},{},[1])(1)\n});\n\n","(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()","/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\t// The constructor can be used in two ways:\n\t// 1) With a fable, options object and service hash (the options object and service hash are optional)\n\t// 2) With an object or nothing as the first parameter, where it will be treated as the options object\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\t// Check if a fable was passed in; connect it if so\n\t\tif ((typeof(pFable) === 'object') && pFable.isFable)\n\t\t{\n\t\t\tthis.connectFable(pFable);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.fable = false;\n\t\t}\n\n\t\t// initialize options and UUID based on whether the fable was passed in or not.\n\t\tif (this.fable)\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// With no fable, check to see if there was an object passed into either of the first two\n\t\t\t// Parameters, and if so, treat it as the options object\n\t\t\tthis.options = ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t\t: (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t\tthis.UUID = `CORE-SVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\t// It's expected that the deriving class will set this\n\t\tthis.serviceType = `Unknown-${this.UUID}`;\n\n\t\t// The service hash is used to identify the specific instantiation of the service in the services map\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash \n\t\t\t\t\t: (!this.fable && (typeof(pOptions) === 'string')) ? pOptions\n\t\t\t\t\t: `${this.UUID}`;\n\t}\n\n\tconnectFable(pFable)\n\t{\n\t\tif ((typeof(pFable) !== 'object') || (!pFable.isFable))\n\t\t{\n\t\t\tlet tmpErrorMessage = `Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof(pFable)}].}`;\n\t\t\tconsole.log(tmpErrorMessage);\n\t\t\treturn new Error(tmpErrorMessage);\n\t\t}\n\n\t\tif (!this.fable)\n\t\t{\n\t\t\tthis.fable = pFable;\n\t\t}\n\n\t\tif (!this.log)\n\t\t{\n\t\t\tthis.log = this.fable.Logging;\n\t\t}\n\t\tif (!this.services)\n\t\t{\n\t\t\tthis.services = this.fable.services;\n\t\t}\n\n\t\tif (!this.servicesMap)\n\t\t{\n\t\t\tthis.servicesMap = this.fable.servicesMap;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\n// This is left here in case we want to go back to having different code/base class for \"core\" services\nmodule.exports.CoreServiceProviderBase = FableServiceProviderBase;"]}
|
|
@@ -60,29 +60,26 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
60
60
|
// 1) With a fable, options object and service hash (the options object and service hash are optional)
|
|
61
61
|
// 2) With an object or nothing as the first parameter, where it will be treated as the options object
|
|
62
62
|
constructor(pFable, pOptions, pServiceHash) {
|
|
63
|
-
// Check if a fable was passed in
|
|
63
|
+
// Check if a fable was passed in; connect it if so
|
|
64
64
|
if (typeof pFable === 'object' && pFable.isFable) {
|
|
65
|
-
this.
|
|
65
|
+
this.connectFable(pFable);
|
|
66
66
|
} else {
|
|
67
67
|
this.fable = false;
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
// initialize options and UUID based on whether the fable was passed in or not.
|
|
69
71
|
if (this.fable) {
|
|
70
|
-
this.
|
|
72
|
+
this.UUID = pFable.getUUID();
|
|
71
73
|
this.options = typeof pOptions === 'object' ? pOptions : {};
|
|
72
74
|
} else {
|
|
73
75
|
// With no fable, check to see if there was an object passed into either of the first two
|
|
74
76
|
// Parameters, and if so, treat it as the options object
|
|
75
77
|
this.options = typeof pFable === 'object' && !pFable.isFable ? pFable : typeof pOptions === 'object' ? pOptions : {};
|
|
78
|
+
this.UUID = "CORE-SVC-".concat(Math.floor(Math.random() * (99999 - 10000) + 10000));
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
// It's expected that the deriving class will set this
|
|
79
|
-
this.serviceType =
|
|
80
|
-
if (this.fable) {
|
|
81
|
-
this.UUID = pFable.getUUID();
|
|
82
|
-
} else {
|
|
83
|
-
// Without any dependencies, get a decently random UUID for the service
|
|
84
|
-
this.UUID = "CORE-SVC-".concat(Math.floor(Math.random() * (99999 - 10000) + 10000));
|
|
85
|
-
}
|
|
82
|
+
this.serviceType = "Unknown-".concat(this.UUID);
|
|
86
83
|
|
|
87
84
|
// The service hash is used to identify the specific instantiation of the service in the services map
|
|
88
85
|
this.Hash = typeof pServiceHash === 'string' ? pServiceHash : !this.fable && typeof pOptions === 'string' ? pOptions : "".concat(this.UUID);
|
|
@@ -96,16 +93,22 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
|
96
93
|
if (!this.fable) {
|
|
97
94
|
this.fable = pFable;
|
|
98
95
|
}
|
|
99
|
-
this.log
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
if (!this.log) {
|
|
97
|
+
this.log = this.fable.Logging;
|
|
98
|
+
}
|
|
99
|
+
if (!this.services) {
|
|
100
|
+
this.services = this.fable.services;
|
|
101
|
+
}
|
|
102
|
+
if (!this.servicesMap) {
|
|
103
|
+
this.servicesMap = this.fable.servicesMap;
|
|
104
|
+
}
|
|
102
105
|
return true;
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
108
|
_defineProperty(FableServiceProviderBase, "isFableService", true);
|
|
106
109
|
module.exports = FableServiceProviderBase;
|
|
107
110
|
|
|
108
|
-
// This is left here in case we want to go back to having different code for "core" services
|
|
111
|
+
// This is left here in case we want to go back to having different code/base class for "core" services
|
|
109
112
|
module.exports.CoreServiceProviderBase = FableServiceProviderBase;
|
|
110
113
|
}, {}]
|
|
111
114
|
}, {}, [1])(1);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function _defineProperty(e,t,
|
|
1
|
+
"use strict";function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).FableServiceproviderbase=e()}}((function(){return function e(t,i,r){function o(s,f){if(!i[s]){if(!t[s]){var a="function"==typeof require&&require;if(!f&&a)return a(s,!0);if(n)return n(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[s]={exports:{}};t[s][0].call(l.exports,(function(e){return o(t[s][1][e]||e)}),l,l.exports,e,t,i,r)}return i[s].exports}for(var n="function"==typeof require&&require,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,i){class r{constructor(e,t,i){"object"==typeof e&&e.isFable?this.connectFable(e):this.fable=!1,this.fable?(this.UUID=e.getUUID(),this.options="object"==typeof t?t:{}):(this.options="object"!=typeof e||e.isFable?"object"==typeof t?t:{}:e,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof i?i:this.fable||"string"!=typeof t?"".concat(this.UUID):t}connectFable(e){if("object"!=typeof e||!e.isFable){let t="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(typeof e,"].}");return console.log(t),new Error(t)}return this.fable||(this.fable=e),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}_defineProperty(r,"isFableService",!0),t.exports=r,t.exports.CoreServiceProviderBase=r},{}]},{},[1])(1)}));
|
|
2
2
|
//# sourceMappingURL=fable-serviceproviderbase.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["fable-serviceproviderbase.min.js","node_modules/browser-pack/_prelude.js","source/Fable-ServiceProviderBase.js"],"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","f","exports","module","define","amd","window","global","self","this","FableServiceproviderbase","r","e","n","t","o","i","c","require","u","a","Error","code","p","length","FableServiceProviderBase","constructor","pFable","pOptions","pServiceHash","isFable","
|
|
1
|
+
{"version":3,"sources":["fable-serviceproviderbase.min.js","node_modules/browser-pack/_prelude.js","source/Fable-ServiceProviderBase.js"],"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","f","exports","module","define","amd","window","global","self","this","FableServiceproviderbase","r","e","n","t","o","i","c","require","u","a","Error","code","p","length","FableServiceProviderBase","constructor","pFable","pOptions","pServiceHash","isFable","connectFable","fable","UUID","getUUID","options","concat","Math","floor","random","serviceType","Hash","tmpErrorMessage","console","log","Logging","services","servicesMap","CoreServiceProviderBase"],"mappings":"AAAA,aAEA,SAASA,gBAAgBC,EAAKC,EAAKC,GAA4L,OAAnLD,EAAME,eAAeF,MAAiBD,EAAOI,OAAOC,eAAeL,EAAKC,EAAK,CAAEC,MAAOA,EAAOI,YAAY,EAAMC,cAAc,EAAMC,UAAU,IAAkBR,EAAIC,GAAOC,EAAgBF,CAAK,CAC3O,SAASG,eAAeM,GAAO,IAAIR,EAAMS,aAAaD,EAAK,UAAW,MAAsB,iBAARR,EAAmBA,EAAMU,OAAOV,EAAM,CAC1H,SAASS,aAAaE,EAAOC,GAAQ,GAAqB,iBAAVD,GAAgC,OAAVA,EAAgB,OAAOA,EAAO,IAAIE,EAAOF,EAAMG,OAAOC,aAAc,QAAaC,IAATH,EAAoB,CAAE,IAAII,EAAMJ,EAAKK,KAAKP,EAAOC,GAAQ,WAAY,GAAmB,iBAARK,EAAkB,OAAOA,EAAK,MAAM,IAAIE,UAAU,+CAAiD,CAAE,OAAiB,WAATP,EAAoBF,OAASU,QAAQT,EAAQ,ECJxX,SAAAU,GAAA,GAAA,iBAAAC,SAAA,oBAAAC,OAAAA,OAAAD,QAAAD,SAAA,GAAA,mBAAAG,QAAAA,OAAAC,IAAAD,OAAA,GAAAH,OAAA,EAAA,oBAAAK,OAAAA,OAAA,oBAAAC,OAAAA,OAAA,oBAAAC,KAAAA,KAAAC,MAAAC,yBAAAT,GAAA,CAAA,CAAA,EAAA,WAAA,OAAA,SAAAU,EAAAC,EAAAC,EAAAC,GAAA,SAAAC,EAAAC,EAAAf,GAAA,IAAAY,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,IAAAC,EAAA,mBAAAC,SAAAA,QAAA,IAAAjB,GAAAgB,EAAA,OAAAA,EAAAD,GAAA,GAAA,GAAAG,EAAA,OAAAA,EAAAH,GAAA,G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AuB,QAEAvB,KAAAuB,MAAAL,GAGAlB,KAAAmC,MAEAnC,KAAAmC,IAAAnC,KAAAuB,MAAAa,SAEApC,KAAAqC,WAEArC,KAAAqC,SAAArC,KAAAuB,MAAAc,UAGArC,KAAAsC,cAEAtC,KAAAsC,YAAAtC,KAAAuB,MAAAe,cAGA,CACA,EAGArE,gBA3EA+C,EAAA,kBA0EA,GAGAtB,EAAAD,QAAAuB,EAGAtB,EAAAD,QAAA8C,wBAAAvB,CFEA,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GCvFX,CDuFe,EACf","file":"fable-serviceproviderbase.min.js","sourcesContent":["(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.FableServiceproviderbase = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\t// The constructor can be used in two ways:\n\t// 1) With a fable, options object and service hash (the options object and service hash are optional)\n\t// 2) With an object or nothing as the first parameter, where it will be treated as the options object\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\t// Check if a fable was passed in; connect it if so\n\t\tif ((typeof(pFable) === 'object') && pFable.isFable)\n\t\t{\n\t\t\tthis.connectFable(pFable);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.fable = false;\n\t\t}\n\n\t\t// initialize options and UUID based on whether the fable was passed in or not.\n\t\tif (this.fable)\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// With no fable, check to see if there was an object passed into either of the first two\n\t\t\t// Parameters, and if so, treat it as the options object\n\t\t\tthis.options = ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t\t: (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t\tthis.UUID = `CORE-SVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\t// It's expected that the deriving class will set this\n\t\tthis.serviceType = `Unknown-${this.UUID}`;\n\n\t\t// The service hash is used to identify the specific instantiation of the service in the services map\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash \n\t\t\t\t\t: (!this.fable && (typeof(pOptions) === 'string')) ? pOptions\n\t\t\t\t\t: `${this.UUID}`;\n\t}\n\n\tconnectFable(pFable)\n\t{\n\t\tif ((typeof(pFable) !== 'object') || (!pFable.isFable))\n\t\t{\n\t\t\tlet tmpErrorMessage = `Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof(pFable)}].}`;\n\t\t\tconsole.log(tmpErrorMessage);\n\t\t\treturn new Error(tmpErrorMessage);\n\t\t}\n\n\t\tif (!this.fable)\n\t\t{\n\t\t\tthis.fable = pFable;\n\t\t}\n\n\t\tif (!this.log)\n\t\t{\n\t\t\tthis.log = this.fable.Logging;\n\t\t}\n\t\tif (!this.services)\n\t\t{\n\t\t\tthis.services = this.fable.services;\n\t\t}\n\n\t\tif (!this.servicesMap)\n\t\t{\n\t\t\tthis.servicesMap = this.fable.servicesMap;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\n// This is left here in case we want to go back to having different code/base class for \"core\" services\nmodule.exports.CoreServiceProviderBase = FableServiceProviderBase;\n},{}]},{},[1])(1)\n});\n\n","(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()","/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\t// The constructor can be used in two ways:\n\t// 1) With a fable, options object and service hash (the options object and service hash are optional)\n\t// 2) With an object or nothing as the first parameter, where it will be treated as the options object\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\t// Check if a fable was passed in; connect it if so\n\t\tif ((typeof(pFable) === 'object') && pFable.isFable)\n\t\t{\n\t\t\tthis.connectFable(pFable);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.fable = false;\n\t\t}\n\n\t\t// initialize options and UUID based on whether the fable was passed in or not.\n\t\tif (this.fable)\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// With no fable, check to see if there was an object passed into either of the first two\n\t\t\t// Parameters, and if so, treat it as the options object\n\t\t\tthis.options = ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t\t: (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t\t: {};\n\t\t\tthis.UUID = `CORE-SVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\t// It's expected that the deriving class will set this\n\t\tthis.serviceType = `Unknown-${this.UUID}`;\n\n\t\t// The service hash is used to identify the specific instantiation of the service in the services map\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash \n\t\t\t\t\t: (!this.fable && (typeof(pOptions) === 'string')) ? pOptions\n\t\t\t\t\t: `${this.UUID}`;\n\t}\n\n\tconnectFable(pFable)\n\t{\n\t\tif ((typeof(pFable) !== 'object') || (!pFable.isFable))\n\t\t{\n\t\t\tlet tmpErrorMessage = `Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof(pFable)}].}`;\n\t\t\tconsole.log(tmpErrorMessage);\n\t\t\treturn new Error(tmpErrorMessage);\n\t\t}\n\n\t\tif (!this.fable)\n\t\t{\n\t\t\tthis.fable = pFable;\n\t\t}\n\n\t\tif (!this.log)\n\t\t{\n\t\t\tthis.log = this.fable.Logging;\n\t\t}\n\t\tif (!this.services)\n\t\t{\n\t\t\tthis.services = this.fable.services;\n\t\t}\n\n\t\tif (!this.servicesMap)\n\t\t{\n\t\t\tthis.servicesMap = this.fable.servicesMap;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\n// This is left here in case we want to go back to having different code/base class for \"core\" services\nmodule.exports.CoreServiceProviderBase = FableServiceProviderBase;"]}
|
package/package.json
CHANGED
|
@@ -10,19 +10,20 @@ class FableServiceProviderBase
|
|
|
10
10
|
// 2) With an object or nothing as the first parameter, where it will be treated as the options object
|
|
11
11
|
constructor(pFable, pOptions, pServiceHash)
|
|
12
12
|
{
|
|
13
|
-
// Check if a fable was passed in
|
|
13
|
+
// Check if a fable was passed in; connect it if so
|
|
14
14
|
if ((typeof(pFable) === 'object') && pFable.isFable)
|
|
15
15
|
{
|
|
16
|
-
this.
|
|
16
|
+
this.connectFable(pFable);
|
|
17
17
|
}
|
|
18
18
|
else
|
|
19
19
|
{
|
|
20
20
|
this.fable = false;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// initialize options and UUID based on whether the fable was passed in or not.
|
|
23
24
|
if (this.fable)
|
|
24
25
|
{
|
|
25
|
-
this.
|
|
26
|
+
this.UUID = pFable.getUUID();
|
|
26
27
|
this.options = (typeof(pOptions) === 'object') ? pOptions
|
|
27
28
|
: {};
|
|
28
29
|
}
|
|
@@ -33,20 +34,11 @@ class FableServiceProviderBase
|
|
|
33
34
|
this.options = ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable
|
|
34
35
|
: (typeof(pOptions) === 'object') ? pOptions
|
|
35
36
|
: {};
|
|
37
|
+
this.UUID = `CORE-SVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
// It's expected that the deriving class will set this
|
|
39
|
-
this.serviceType =
|
|
40
|
-
|
|
41
|
-
if (this.fable)
|
|
42
|
-
{
|
|
43
|
-
this.UUID = pFable.getUUID();
|
|
44
|
-
}
|
|
45
|
-
else
|
|
46
|
-
{
|
|
47
|
-
// Without any dependencies, get a decently random UUID for the service
|
|
48
|
-
this.UUID = `CORE-SVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`
|
|
49
|
-
}
|
|
41
|
+
this.serviceType = `Unknown-${this.UUID}`;
|
|
50
42
|
|
|
51
43
|
// The service hash is used to identify the specific instantiation of the service in the services map
|
|
52
44
|
this.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash
|
|
@@ -68,9 +60,19 @@ class FableServiceProviderBase
|
|
|
68
60
|
this.fable = pFable;
|
|
69
61
|
}
|
|
70
62
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
if (!this.log)
|
|
64
|
+
{
|
|
65
|
+
this.log = this.fable.Logging;
|
|
66
|
+
}
|
|
67
|
+
if (!this.services)
|
|
68
|
+
{
|
|
69
|
+
this.services = this.fable.services;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!this.servicesMap)
|
|
73
|
+
{
|
|
74
|
+
this.servicesMap = this.fable.servicesMap;
|
|
75
|
+
}
|
|
74
76
|
|
|
75
77
|
return true;
|
|
76
78
|
}
|
|
@@ -80,5 +82,5 @@ class FableServiceProviderBase
|
|
|
80
82
|
|
|
81
83
|
module.exports = FableServiceProviderBase;
|
|
82
84
|
|
|
83
|
-
// This is left here in case we want to go back to having different code for "core" services
|
|
85
|
+
// This is left here in case we want to go back to having different code/base class for "core" services
|
|
84
86
|
module.exports.CoreServiceProviderBase = FableServiceProviderBase;
|