fable-serviceproviderbase 3.0.13 → 3.0.14
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/package.json +3 -3
- package/source/Fable-ServiceProviderBase.js +3 -0
- package/test/FableServiceProvider_tests.js +4 -0
- package/dist/fable-serviceproviderbase.compatible.js +0 -122
- package/dist/fable-serviceproviderbase.compatible.min.js +0 -2
- package/dist/fable-serviceproviderbase.compatible.min.js.map +0 -1
- package/dist/fable-serviceproviderbase.js +0 -115
- package/dist/fable-serviceproviderbase.min.js +0 -2
- package/dist/fable-serviceproviderbase.min.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fable-serviceproviderbase",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.14",
|
|
4
4
|
"description": "Simple base classes for fable services.",
|
|
5
5
|
"main": "source/Fable-ServiceProviderBase.js",
|
|
6
6
|
"scripts": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://github.com/stevenvelozo/fable-serviceproviderbase",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"fable": "^3.0.
|
|
47
|
-
"quackage": "^1.0.
|
|
46
|
+
"fable": "^3.0.143",
|
|
47
|
+
"quackage": "^1.0.33"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -20,6 +20,9 @@ class FableServiceProviderBase
|
|
|
20
20
|
this.fable = false;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// Initialize the services map if it wasn't passed in
|
|
24
|
+
this._PackageFableServiceProvider = require('../package.json');
|
|
25
|
+
|
|
23
26
|
// initialize options and UUID based on whether the fable was passed in or not.
|
|
24
27
|
if (this.fable)
|
|
25
28
|
{
|
|
@@ -94,6 +94,10 @@ suite
|
|
|
94
94
|
tmpSimpleService.doSomething();
|
|
95
95
|
|
|
96
96
|
Expect(tmpSimpleService.Hash).to.be.a('string');
|
|
97
|
+
|
|
98
|
+
Expect(tmpSimpleService._PackageFableServiceProvider).to.be.an('object');
|
|
99
|
+
Expect(tmpSimpleService._PackageFableServiceProvider.name).to.equal('fable-serviceproviderbase');
|
|
100
|
+
Expect(tmpSimpleService._PackageFableServiceProvider.version)
|
|
97
101
|
}
|
|
98
102
|
);
|
|
99
103
|
test
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
-
(function (f) {
|
|
11
|
-
if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") {
|
|
12
|
-
module.exports = f();
|
|
13
|
-
} else if (typeof define === "function" && define.amd) {
|
|
14
|
-
define([], f);
|
|
15
|
-
} else {
|
|
16
|
-
var g;
|
|
17
|
-
if (typeof window !== "undefined") {
|
|
18
|
-
g = window;
|
|
19
|
-
} else if (typeof global !== "undefined") {
|
|
20
|
-
g = global;
|
|
21
|
-
} else if (typeof self !== "undefined") {
|
|
22
|
-
g = self;
|
|
23
|
-
} else {
|
|
24
|
-
g = this;
|
|
25
|
-
}
|
|
26
|
-
g.FableServiceproviderbase = f();
|
|
27
|
-
}
|
|
28
|
-
})(function () {
|
|
29
|
-
var define, module, exports;
|
|
30
|
-
return function () {
|
|
31
|
-
function r(e, n, t) {
|
|
32
|
-
function o(i, f) {
|
|
33
|
-
if (!n[i]) {
|
|
34
|
-
if (!e[i]) {
|
|
35
|
-
var c = "function" == typeof require && require;
|
|
36
|
-
if (!f && c) return c(i, !0);
|
|
37
|
-
if (u) return u(i, !0);
|
|
38
|
-
var a = new Error("Cannot find module '" + i + "'");
|
|
39
|
-
throw a.code = "MODULE_NOT_FOUND", a;
|
|
40
|
-
}
|
|
41
|
-
var p = n[i] = {
|
|
42
|
-
exports: {}
|
|
43
|
-
};
|
|
44
|
-
e[i][0].call(p.exports, function (r) {
|
|
45
|
-
var n = e[i][1][r];
|
|
46
|
-
return o(n || r);
|
|
47
|
-
}, p, p.exports, r, e, n, t);
|
|
48
|
-
}
|
|
49
|
-
return n[i].exports;
|
|
50
|
-
}
|
|
51
|
-
for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]);
|
|
52
|
-
return o;
|
|
53
|
-
}
|
|
54
|
-
return r;
|
|
55
|
-
}()({
|
|
56
|
-
1: [function (require, module, exports) {
|
|
57
|
-
/**
|
|
58
|
-
* Fable Service Base
|
|
59
|
-
* @author <steven@velozo.com>
|
|
60
|
-
*/
|
|
61
|
-
var FableServiceProviderBase = /*#__PURE__*/function () {
|
|
62
|
-
// The constructor can be used in two ways:
|
|
63
|
-
// 1) With a fable, options object and service hash (the options object and service hash are optional)
|
|
64
|
-
// 2) With an object or nothing as the first parameter, where it will be treated as the options object
|
|
65
|
-
function FableServiceProviderBase(pFable, pOptions, pServiceHash) {
|
|
66
|
-
_classCallCheck(this, FableServiceProviderBase);
|
|
67
|
-
// Check if a fable was passed in; connect it if so
|
|
68
|
-
if (_typeof(pFable) === 'object' && pFable.isFable) {
|
|
69
|
-
this.connectFable(pFable);
|
|
70
|
-
} else {
|
|
71
|
-
this.fable = false;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// initialize options and UUID based on whether the fable was passed in or not.
|
|
75
|
-
if (this.fable) {
|
|
76
|
-
this.UUID = pFable.getUUID();
|
|
77
|
-
this.options = _typeof(pOptions) === 'object' ? pOptions : {};
|
|
78
|
-
} else {
|
|
79
|
-
// With no fable, check to see if there was an object passed into either of the first two
|
|
80
|
-
// Parameters, and if so, treat it as the options object
|
|
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));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// It's expected that the deriving class will set this
|
|
86
|
-
this.serviceType = "Unknown-".concat(this.UUID);
|
|
87
|
-
|
|
88
|
-
// The service hash is used to identify the specific instantiation of the service in the services map
|
|
89
|
-
this.Hash = typeof pServiceHash === 'string' ? pServiceHash : !this.fable && typeof pOptions === 'string' ? pOptions : "".concat(this.UUID);
|
|
90
|
-
}
|
|
91
|
-
return _createClass(FableServiceProviderBase, [{
|
|
92
|
-
key: "connectFable",
|
|
93
|
-
value: function connectFable(pFable) {
|
|
94
|
-
if (_typeof(pFable) !== 'object' || !pFable.isFable) {
|
|
95
|
-
var tmpErrorMessage = "Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(_typeof(pFable), "].}");
|
|
96
|
-
console.log(tmpErrorMessage);
|
|
97
|
-
return new Error(tmpErrorMessage);
|
|
98
|
-
}
|
|
99
|
-
if (!this.fable) {
|
|
100
|
-
this.fable = pFable;
|
|
101
|
-
}
|
|
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
|
-
}
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
}]);
|
|
114
|
-
}();
|
|
115
|
-
_defineProperty(FableServiceProviderBase, "isFableService", true);
|
|
116
|
-
module.exports = FableServiceProviderBase;
|
|
117
|
-
|
|
118
|
-
// This is left here in case we want to go back to having different code/base class for "core" services
|
|
119
|
-
module.exports.CoreServiceProviderBase = FableServiceProviderBase;
|
|
120
|
-
}, {}]
|
|
121
|
-
}, {}, [1])(1);
|
|
122
|
-
});
|
|
@@ -1,2 +0,0 @@
|
|
|
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 o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,o){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.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 _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,o,r){function i(f,s){if(!o[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=o[f]={exports:{}};t[f][0].call(l.exports,(function(e){return i(t[f][1][e]||e)}),l,l.exports,e,t,o,r)}return o[f].exports}for(var n="function"==typeof require&&require,f=0;f<r.length;f++)i(r[f]);return i}({1:[function(e,t,o){var r=function(){return _createClass((function e(t,o,r){_classCallCheck(this,e),"object"===_typeof(t)&&t.isFable?this.connectFable(t):this.fable=!1,this.fable?(this.UUID=t.getUUID(),this.options="object"===_typeof(o)?o:{}):(this.options="object"!==_typeof(t)||t.isFable?"object"===_typeof(o)?o:{}:t,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof r?r:this.fable||"string"!=typeof o?"".concat(this.UUID):o}),[{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}}])}();_defineProperty(r,"isFableService",!0),t.exports=r,t.exports.CoreServiceProviderBase=r},{}]},{},[1])(1)}));
|
|
2
|
-
//# sourceMappingURL=fable-serviceproviderbase.compatible.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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","t","_toPrimitive","_typeof","r","e","Symbol","toPrimitive","call","String","Number","o","iterator","constructor","f","exports","module","define","amd","window","global","self","this","FableServiceproviderbase","n","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,E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A,iBAAAJ,EAAA,GAAAQ,OACApB,KAAAiB,MADAL,CAEA,GAAA,CAAA,CAAAzC,IAAA,eAAAO,MAEA,SAAAiC,GAEA,GAAA,WAAA9B,QAAA8B,KAAAA,EAAAG,QACA,CACA,IAAAY,EAAA,sHAAAN,OAAAvC,QAAA8B,GAAA,OAEA,OADAgB,QAAAC,IAAAF,GACA,IAAAnB,MAAAmB,EACA,CAqBA,OAnBA1B,KAAAgB,QAEAhB,KAAAgB,MAAAL,GAGAX,KAAA4B,MAEA5B,KAAA4B,IAAA5B,KAAAgB,MAAAa,SAEA7B,KAAA8B,WAEA9B,KAAA8B,SAAA9B,KAAAgB,MAAAc,UAGA9B,KAAA+B,cAEA/B,KAAA+B,YAAA/B,KAAAgB,MAAAe,cAGA,CACA,IAAA,CAxEA,GAwEAvD,gBAxEAkC,EAAA,kBA0EA,GAGAhB,EAAAD,QAAAiB,EAGAhB,EAAAD,QAAAuC,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;"]}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
5
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
-
(function (f) {
|
|
7
|
-
if (typeof exports === "object" && typeof module !== "undefined") {
|
|
8
|
-
module.exports = f();
|
|
9
|
-
} else if (typeof define === "function" && define.amd) {
|
|
10
|
-
define([], f);
|
|
11
|
-
} else {
|
|
12
|
-
var g;
|
|
13
|
-
if (typeof window !== "undefined") {
|
|
14
|
-
g = window;
|
|
15
|
-
} else if (typeof global !== "undefined") {
|
|
16
|
-
g = global;
|
|
17
|
-
} else if (typeof self !== "undefined") {
|
|
18
|
-
g = self;
|
|
19
|
-
} else {
|
|
20
|
-
g = this;
|
|
21
|
-
}
|
|
22
|
-
g.FableServiceproviderbase = f();
|
|
23
|
-
}
|
|
24
|
-
})(function () {
|
|
25
|
-
var define, module, exports;
|
|
26
|
-
return function () {
|
|
27
|
-
function r(e, n, t) {
|
|
28
|
-
function o(i, f) {
|
|
29
|
-
if (!n[i]) {
|
|
30
|
-
if (!e[i]) {
|
|
31
|
-
var c = "function" == typeof require && require;
|
|
32
|
-
if (!f && c) return c(i, !0);
|
|
33
|
-
if (u) return u(i, !0);
|
|
34
|
-
var a = new Error("Cannot find module '" + i + "'");
|
|
35
|
-
throw a.code = "MODULE_NOT_FOUND", a;
|
|
36
|
-
}
|
|
37
|
-
var p = n[i] = {
|
|
38
|
-
exports: {}
|
|
39
|
-
};
|
|
40
|
-
e[i][0].call(p.exports, function (r) {
|
|
41
|
-
var n = e[i][1][r];
|
|
42
|
-
return o(n || r);
|
|
43
|
-
}, p, p.exports, r, e, n, t);
|
|
44
|
-
}
|
|
45
|
-
return n[i].exports;
|
|
46
|
-
}
|
|
47
|
-
for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]);
|
|
48
|
-
return o;
|
|
49
|
-
}
|
|
50
|
-
return r;
|
|
51
|
-
}()({
|
|
52
|
-
1: [function (require, module, exports) {
|
|
53
|
-
/**
|
|
54
|
-
* Fable Service Base
|
|
55
|
-
* @author <steven@velozo.com>
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
class FableServiceProviderBase {
|
|
59
|
-
// The constructor can be used in two ways:
|
|
60
|
-
// 1) With a fable, options object and service hash (the options object and service hash are optional)
|
|
61
|
-
// 2) With an object or nothing as the first parameter, where it will be treated as the options object
|
|
62
|
-
constructor(pFable, pOptions, pServiceHash) {
|
|
63
|
-
// Check if a fable was passed in; connect it if so
|
|
64
|
-
if (typeof pFable === 'object' && pFable.isFable) {
|
|
65
|
-
this.connectFable(pFable);
|
|
66
|
-
} else {
|
|
67
|
-
this.fable = false;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// initialize options and UUID based on whether the fable was passed in or not.
|
|
71
|
-
if (this.fable) {
|
|
72
|
-
this.UUID = pFable.getUUID();
|
|
73
|
-
this.options = typeof pOptions === 'object' ? pOptions : {};
|
|
74
|
-
} else {
|
|
75
|
-
// With no fable, check to see if there was an object passed into either of the first two
|
|
76
|
-
// Parameters, and if so, treat it as the options object
|
|
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));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// It's expected that the deriving class will set this
|
|
82
|
-
this.serviceType = "Unknown-".concat(this.UUID);
|
|
83
|
-
|
|
84
|
-
// The service hash is used to identify the specific instantiation of the service in the services map
|
|
85
|
-
this.Hash = typeof pServiceHash === 'string' ? pServiceHash : !this.fable && typeof pOptions === 'string' ? pOptions : "".concat(this.UUID);
|
|
86
|
-
}
|
|
87
|
-
connectFable(pFable) {
|
|
88
|
-
if (typeof pFable !== 'object' || !pFable.isFable) {
|
|
89
|
-
let tmpErrorMessage = "Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(typeof pFable, "].}");
|
|
90
|
-
console.log(tmpErrorMessage);
|
|
91
|
-
return new Error(tmpErrorMessage);
|
|
92
|
-
}
|
|
93
|
-
if (!this.fable) {
|
|
94
|
-
this.fable = pFable;
|
|
95
|
-
}
|
|
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
|
-
}
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
_defineProperty(FableServiceProviderBase, "isFableService", true);
|
|
109
|
-
module.exports = FableServiceProviderBase;
|
|
110
|
-
|
|
111
|
-
// This is left here in case we want to go back to having different code/base class for "core" services
|
|
112
|
-
module.exports.CoreServiceProviderBase = FableServiceProviderBase;
|
|
113
|
-
}, {}]
|
|
114
|
-
}, {}, [1])(1);
|
|
115
|
-
});
|
|
@@ -1,2 +0,0 @@
|
|
|
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:t+""}function _toPrimitive(e,t){if("object"!=typeof e||!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
|
-
//# sourceMappingURL=fable-serviceproviderbase.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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","t","i","_toPrimitive","r","e","Symbol","toPrimitive","call","TypeError","String","Number","f","exports","module","define","amd","window","global","self","this","FableServiceproviderbase","n","o","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,GAAK,IAAIC,EAAIC,aAAaF,EAAG,UAAW,MAAO,iBAAmBC,EAAIA,EAAIA,EAAI,EAAI,CAC1G,SAASC,aAAaF,EAAGG,GAAK,GAAI,iBAAmBH,IAAMA,EAAG,OAAOA,EAAG,IAAII,EAAIJ,EAAEK,OAAOC,aAAc,QAAI,IAAWF,EAAG,CAAE,IAAIH,EAAIG,EAAEG,KAAKP,EAAGG,GAAK,WAAY,GAAI,iBAAmBF,EAAG,OAAOA,EAAG,MAAM,IAAIO,UAAU,+CAAiD,CAAE,OAAQ,WAAaL,EAAIM,OAASC,QAAQV,EAAI,ECJvT,SAAAW,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,SAAAR,EAAAC,EAAAiB,EAAArB,GAAA,SAAAsB,EAAArB,EAAAU,GAAA,IAAAU,EAAApB,GAAA,CAAA,IAAAG,EAAAH,GAAA,CAAA,IAAAsB,EAAA,mBAAAC,SAAAA,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AY,EAAA,sHAAAN,cAAAT,EAAA,OAEA,OADAgB,QAAAC,IAAAF,GACA,IAAArB,MAAAqB,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,EAGA/D,gBA3EAyC,EAAA,kBA0EA,GAGAlB,EAAAD,QAAAmB,EAGAlB,EAAAD,QAAA0C,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;"]}
|