fable-serviceproviderbase 3.0.7 → 3.0.9
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/.babelrc +5 -0
- package/.browserslistrc +1 -0
- package/dist/fable-serviceproviderbase.compatible.js +119 -0
- package/dist/fable-serviceproviderbase.compatible.min.js +2 -0
- package/dist/fable-serviceproviderbase.compatible.min.js.map +1 -0
- package/dist/fable-serviceproviderbase.js +112 -0
- package/dist/fable-serviceproviderbase.min.js +2 -0
- package/dist/fable-serviceproviderbase.min.js.map +1 -0
- package/package.json +2 -2
- package/source/Fable-ServiceProviderBase.js +1 -1
- package/test/FableServiceProvider_tests.js +7 -7
package/.browserslistrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
> 0.01%
|
|
@@ -0,0 +1,119 @@
|
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
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 Core Pre-initialization Service Base
|
|
59
|
+
*
|
|
60
|
+
* For a couple services, we need to be able to instantiate them before the Fable object is fully initialized.
|
|
61
|
+
* This is a base class for those services.
|
|
62
|
+
*
|
|
63
|
+
* @author <steven@velozo.com>
|
|
64
|
+
*/
|
|
65
|
+
var FableCoreServiceProviderBase = /*#__PURE__*/function () {
|
|
66
|
+
function FableCoreServiceProviderBase(pOptions, pServiceHash) {
|
|
67
|
+
_classCallCheck(this, FableCoreServiceProviderBase);
|
|
68
|
+
this.fable = false;
|
|
69
|
+
this.options = _typeof(pOptions) === 'object' ? pOptions : {};
|
|
70
|
+
this.serviceType = 'Unknown';
|
|
71
|
+
|
|
72
|
+
// The hash will be a non-standard UUID ... the UUID service uses this base class!
|
|
73
|
+
this.UUID = "CORESVC-".concat(Math.floor(Math.random() * (99999 - 10000) + 10000));
|
|
74
|
+
this.Hash = typeof pServiceHash === 'string' ? pServiceHash : "".concat(this.UUID);
|
|
75
|
+
}
|
|
76
|
+
_createClass(FableCoreServiceProviderBase, [{
|
|
77
|
+
key: "connectFable",
|
|
78
|
+
value:
|
|
79
|
+
// After fable is initialized, it would be expected to be wired in as a normal service.
|
|
80
|
+
function connectFable(pFable) {
|
|
81
|
+
this.fable = pFable;
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
}]);
|
|
85
|
+
return FableCoreServiceProviderBase;
|
|
86
|
+
}();
|
|
87
|
+
_defineProperty(FableCoreServiceProviderBase, "isFableService", true);
|
|
88
|
+
module.exports = FableCoreServiceProviderBase;
|
|
89
|
+
}, {}],
|
|
90
|
+
2: [function (require, module, exports) {
|
|
91
|
+
/**
|
|
92
|
+
* Fable Service Base
|
|
93
|
+
* @author <steven@velozo.com>
|
|
94
|
+
*/
|
|
95
|
+
var FableServiceProviderBase = /*#__PURE__*/_createClass(function FableServiceProviderBase(pFable, pOptions, pServiceHash) {
|
|
96
|
+
_classCallCheck(this, FableServiceProviderBase);
|
|
97
|
+
this.fable = pFable;
|
|
98
|
+
this.options = _typeof(pOptions) === 'object' ? pOptions : _typeof(pFable) === 'object' && !pFable.isFable ? pFable : {};
|
|
99
|
+
this.serviceType = 'Unknown';
|
|
100
|
+
if (typeof pFable.getUUID == 'function') {
|
|
101
|
+
this.UUID = pFable.getUUID();
|
|
102
|
+
} else {
|
|
103
|
+
this.UUID = "NoFABLESVC-".concat(Math.floor(Math.random() * (99999 - 10000) + 10000));
|
|
104
|
+
}
|
|
105
|
+
this.Hash = typeof pServiceHash === 'string' ? pServiceHash : "".concat(this.UUID);
|
|
106
|
+
|
|
107
|
+
// Pull back a few things
|
|
108
|
+
this.log = this.fable.log;
|
|
109
|
+
this.servicesMap = this.fable.servicesMap;
|
|
110
|
+
this.services = this.fable.services;
|
|
111
|
+
});
|
|
112
|
+
_defineProperty(FableServiceProviderBase, "isFableService", true);
|
|
113
|
+
module.exports = FableServiceProviderBase;
|
|
114
|
+
module.exports.CoreServiceProviderBase = require('./Fable-ServiceProviderBase-Preinit.js');
|
|
115
|
+
}, {
|
|
116
|
+
"./Fable-ServiceProviderBase-Preinit.js": 1
|
|
117
|
+
}]
|
|
118
|
+
}, {}, [2])(2);
|
|
119
|
+
});
|
|
@@ -0,0 +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 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){_classCallCheck(this,e),this.fable=!1,this.options="object"===_typeof(t)?t:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof r?r:"".concat(this.UUID)}return _createClass(e,[{key:"connectFable",value:function(e){return this.fable=e,!0}}]),e}();_defineProperty(o,"isFableService",!0),t.exports=o},{}],2:[function(e,t,r){var o=_createClass((function e(t,r,o){_classCallCheck(this,e),this.fable=t,this.options="object"===_typeof(r)?r:"object"!==_typeof(t)||t.isFable?{}:t,this.serviceType="Unknown","function"==typeof t.getUUID?this.UUID=t.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof o?o:"".concat(this.UUID),this.log=this.fable.log,this.servicesMap=this.fable.servicesMap,this.services=this.fable.services}));_defineProperty(o,"isFableService",!0),t.exports=o,t.exports.CoreServiceProviderBase=e("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":1}]},{},[2])(2)}));
|
|
2
|
+
//# sourceMappingURL=fable-serviceproviderbase.compatible.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["fable-serviceproviderbase.compatible.min.js","node_modules/browser-pack/_prelude.js","source/Fable-ServiceProviderBase-Preinit.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","iterator","constructor","f","exports","module","define","amd","window","global","self","this","FableServiceproviderbase","r","e","n","t","o","c","require","u","a","Error","code","p","FableCoreServiceProviderBase","pOptions","pServiceHash","fable","options","serviceType","UUID","concat","Math","floor","random","Hash","pFable","FableServiceProviderBase","isFable","getUUID","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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AAA,MAAAD,KAAAE,SAAA,MAEAxB,KAAAyB,KAAA,iBAAAT,EAAAA,EAAA,GAAAK,OAAArB,KAAAoB,KACA,CAWA,OAXAlD,aAAA4C,EAAA,CAAA,CAAA7C,IAAA,eAAAO,MAMA,SAAAkD,GAIA,OAFA1B,KAAAiB,MAAAS,GAEA,CACA,KAAAZ,CAAA,CAzBA,GAyBAxC,gBAzBAwC,EAAA,kBAiBA,GAWApB,EAAAD,QAAAqB,CFGA,EAAE,CAAC,GAAG,EAAE,CAAC,SAASN,EAAQd,EAAOD,GGxCjC,IAKAkC,EAAAzD,cAEA,SAAAyD,EAAAD,EAAAX,EAAAC,GACA/D,gBAAA+C,KAAA2B,GACA3B,KAAAiB,MAAAS,EAEA1B,KAAAkB,QAAA,WAAAvC,QAAAoC,GAAAA,EACA,WAAApC,QAAA+C,IAAAA,EAAAE,QACA,CAAA,EADAF,EAGA1B,KAAAmB,YAAA,UAEA,mBAAAO,EAAAG,QAEA7B,KAAAoB,KAAAM,EAAAG,UAIA7B,KAAAoB,KAAA,cAAAC,OAAAC,KAAAC,MAAA,MAAAD,KAAAE,SAAA,MAGAxB,KAAAyB,KAAA,iBAAAT,EAAAA,EAAA,GAAAK,OAAArB,KAAAoB,MAGApB,KAAA8B,IAAA9B,KAAAiB,MAAAa,IACA9B,KAAA+B,YAAA/B,KAAAiB,MAAAc,YACA/B,KAAAgC,SAAAhC,KAAAiB,MAAAe,QACA,IAAA1D,gBA3BAqD,EAAA,kBA6BA,GAGAjC,EAAAD,QAAAkC,EAEAjC,EAAAD,QAAAwC,wBAAAzB,EAAA,yCH0CA,EAAE,CAAC,yCAAyC,KAAK,CAAC,EAAE,CAAC,GCjFrD,CDiFyD,EACzD","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 Core Pre-initialization Service Base\n*\n* For a couple services, we need to be able to instantiate them before the Fable object is fully initialized.\n* This is a base class for those services.\n*\n* @author <steven@velozo.com>\n*/\n\nclass FableCoreServiceProviderBase\n{\n\tconstructor(pOptions, pServiceHash)\n\t{\n\t\tthis.fable = false;\n\n\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions : {};\n\n\t\tthis.serviceType = 'Unknown';\n\n\t\t// The hash will be a non-standard UUID ... the UUID service uses this base class!\n\t\tthis.UUID = `CORESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`;\n\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;\n\t}\n\n\n\tstatic isFableService = true;\n\n\t// After fable is initialized, it would be expected to be wired in as a normal service.\n\tconnectFable(pFable)\n\t{\n\t\tthis.fable = pFable;\n\n\t\treturn true;\n\t}\n}\n\nmodule.exports = FableCoreServiceProviderBase;\n\n},{}],2:[function(require,module,exports){\n/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\tthis.fable = pFable;\n\n\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t: ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t: {};\n\n\t\tthis.serviceType = 'Unknown';\n\n\t\tif (typeof(pFable.getUUID) == 'function')\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.UUID = `NoFABLESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;\n\n\t\t// Pull back a few things\n\t\tthis.log = this.fable.log;\n\t\tthis.servicesMap = this.fable.servicesMap;\n\t\tthis.services = this.fable.services;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\nmodule.exports.CoreServiceProviderBase = require('./Fable-ServiceProviderBase-Preinit.js');\n},{\"./Fable-ServiceProviderBase-Preinit.js\":1}]},{},[2])(2)\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 Core Pre-initialization Service Base\n*\n* For a couple services, we need to be able to instantiate them before the Fable object is fully initialized.\n* This is a base class for those services.\n*\n* @author <steven@velozo.com>\n*/\n\nclass FableCoreServiceProviderBase\n{\n\tconstructor(pOptions, pServiceHash)\n\t{\n\t\tthis.fable = false;\n\n\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions : {};\n\n\t\tthis.serviceType = 'Unknown';\n\n\t\t// The hash will be a non-standard UUID ... the UUID service uses this base class!\n\t\tthis.UUID = `CORESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`;\n\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;\n\t}\n\n\n\tstatic isFableService = true;\n\n\t// After fable is initialized, it would be expected to be wired in as a normal service.\n\tconnectFable(pFable)\n\t{\n\t\tthis.fable = pFable;\n\n\t\treturn true;\n\t}\n}\n\nmodule.exports = FableCoreServiceProviderBase;\n","/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\tthis.fable = pFable;\n\n\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t: ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t: {};\n\n\t\tthis.serviceType = 'Unknown';\n\n\t\tif (typeof(pFable.getUUID) == 'function')\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.UUID = `NoFABLESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;\n\n\t\t// Pull back a few things\n\t\tthis.log = this.fable.log;\n\t\tthis.servicesMap = this.fable.servicesMap;\n\t\tthis.services = this.fable.services;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\nmodule.exports.CoreServiceProviderBase = require('./Fable-ServiceProviderBase-Preinit.js');"]}
|
|
@@ -0,0 +1,112 @@
|
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
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 Core Pre-initialization Service Base
|
|
55
|
+
*
|
|
56
|
+
* For a couple services, we need to be able to instantiate them before the Fable object is fully initialized.
|
|
57
|
+
* This is a base class for those services.
|
|
58
|
+
*
|
|
59
|
+
* @author <steven@velozo.com>
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
class FableCoreServiceProviderBase {
|
|
63
|
+
constructor(pOptions, pServiceHash) {
|
|
64
|
+
this.fable = false;
|
|
65
|
+
this.options = typeof pOptions === 'object' ? pOptions : {};
|
|
66
|
+
this.serviceType = 'Unknown';
|
|
67
|
+
|
|
68
|
+
// The hash will be a non-standard UUID ... the UUID service uses this base class!
|
|
69
|
+
this.UUID = "CORESVC-".concat(Math.floor(Math.random() * (99999 - 10000) + 10000));
|
|
70
|
+
this.Hash = typeof pServiceHash === 'string' ? pServiceHash : "".concat(this.UUID);
|
|
71
|
+
}
|
|
72
|
+
// After fable is initialized, it would be expected to be wired in as a normal service.
|
|
73
|
+
connectFable(pFable) {
|
|
74
|
+
this.fable = pFable;
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
_defineProperty(FableCoreServiceProviderBase, "isFableService", true);
|
|
79
|
+
module.exports = FableCoreServiceProviderBase;
|
|
80
|
+
}, {}],
|
|
81
|
+
2: [function (require, module, exports) {
|
|
82
|
+
/**
|
|
83
|
+
* Fable Service Base
|
|
84
|
+
* @author <steven@velozo.com>
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
class FableServiceProviderBase {
|
|
88
|
+
constructor(pFable, pOptions, pServiceHash) {
|
|
89
|
+
this.fable = pFable;
|
|
90
|
+
this.options = typeof pOptions === 'object' ? pOptions : typeof pFable === 'object' && !pFable.isFable ? pFable : {};
|
|
91
|
+
this.serviceType = 'Unknown';
|
|
92
|
+
if (typeof pFable.getUUID == 'function') {
|
|
93
|
+
this.UUID = pFable.getUUID();
|
|
94
|
+
} else {
|
|
95
|
+
this.UUID = "NoFABLESVC-".concat(Math.floor(Math.random() * (99999 - 10000) + 10000));
|
|
96
|
+
}
|
|
97
|
+
this.Hash = typeof pServiceHash === 'string' ? pServiceHash : "".concat(this.UUID);
|
|
98
|
+
|
|
99
|
+
// Pull back a few things
|
|
100
|
+
this.log = this.fable.log;
|
|
101
|
+
this.servicesMap = this.fable.servicesMap;
|
|
102
|
+
this.services = this.fable.services;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
_defineProperty(FableServiceProviderBase, "isFableService", true);
|
|
106
|
+
module.exports = FableServiceProviderBase;
|
|
107
|
+
module.exports.CoreServiceProviderBase = require('./Fable-ServiceProviderBase-Preinit.js');
|
|
108
|
+
}, {
|
|
109
|
+
"./Fable-ServiceProviderBase-Preinit.js": 1
|
|
110
|
+
}]
|
|
111
|
+
}, {}, [2])(2);
|
|
112
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";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 i=r.call(e,t||"default");if("object"!=typeof i)return i;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,r,i){function o(s,f){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!f&&c)return c(s,!0);if(n)return n(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var u=r[s]={exports:{}};t[s][0].call(u.exports,(function(e){return o(t[s][1][e]||e)}),u,u.exports,e,t,r,i)}return r[s].exports}for(var n="function"==typeof require&&require,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(e,t,r){class i{constructor(e,t){this.fable=!1,this.options="object"==typeof e?e:{},this.serviceType="Unknown",this.UUID="CORESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof t?t:"".concat(this.UUID)}connectFable(e){return this.fable=e,!0}}_defineProperty(i,"isFableService",!0),t.exports=i},{}],2:[function(e,t,r){class i{constructor(e,t,r){this.fable=e,this.options="object"==typeof t?t:"object"!=typeof e||e.isFable?{}:e,this.serviceType="Unknown","function"==typeof e.getUUID?this.UUID=e.getUUID():this.UUID="NoFABLESVC-".concat(Math.floor(89999*Math.random()+1e4)),this.Hash="string"==typeof r?r:"".concat(this.UUID),this.log=this.fable.log,this.servicesMap=this.fable.servicesMap,this.services=this.fable.services}}_defineProperty(i,"isFableService",!0),t.exports=i,t.exports.CoreServiceProviderBase=e("./Fable-ServiceProviderBase-Preinit.js")},{"./Fable-ServiceProviderBase-Preinit.js":1}]},{},[2])(2)}));
|
|
2
|
+
//# sourceMappingURL=fable-serviceproviderbase.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["fable-serviceproviderbase.min.js","node_modules/browser-pack/_prelude.js","source/Fable-ServiceProviderBase-Preinit.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","FableCoreServiceProviderBase","constructor","pOptions","pServiceHash","fable","options","serviceType","UUID","concat","Math","floor","random","Hash","connectFable","pFable","FableServiceProviderBase","isFable","getUUID","log","servicesMap","services","CoreServiceProviderBase"],"mappings":"AAAA,aAEA,SAASA,gBAAgBC,EAAKC,EAAKC,GAA4L,O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MAAAe,YACAnC,KAAAoC,SAAApC,KAAAoB,MAAAgB,QACA,EAGAnE,gBA9BA8D,EAAA,kBA6BA,GAGArC,EAAAD,QAAAsC,EAEArC,EAAAD,QAAA4C,wBAAA5B,EAAA,yCH0CA,EAAE,CAAC,yCAAyC,KAAK,CAAC,EAAE,CAAC,GCjFrD,CDiFyD,EACzD","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 Core Pre-initialization Service Base\n*\n* For a couple services, we need to be able to instantiate them before the Fable object is fully initialized.\n* This is a base class for those services.\n*\n* @author <steven@velozo.com>\n*/\n\nclass FableCoreServiceProviderBase\n{\n\tconstructor(pOptions, pServiceHash)\n\t{\n\t\tthis.fable = false;\n\n\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions : {};\n\n\t\tthis.serviceType = 'Unknown';\n\n\t\t// The hash will be a non-standard UUID ... the UUID service uses this base class!\n\t\tthis.UUID = `CORESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`;\n\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;\n\t}\n\n\n\tstatic isFableService = true;\n\n\t// After fable is initialized, it would be expected to be wired in as a normal service.\n\tconnectFable(pFable)\n\t{\n\t\tthis.fable = pFable;\n\n\t\treturn true;\n\t}\n}\n\nmodule.exports = FableCoreServiceProviderBase;\n\n},{}],2:[function(require,module,exports){\n/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\tthis.fable = pFable;\n\n\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t: ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t: {};\n\n\t\tthis.serviceType = 'Unknown';\n\n\t\tif (typeof(pFable.getUUID) == 'function')\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.UUID = `NoFABLESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;\n\n\t\t// Pull back a few things\n\t\tthis.log = this.fable.log;\n\t\tthis.servicesMap = this.fable.servicesMap;\n\t\tthis.services = this.fable.services;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\nmodule.exports.CoreServiceProviderBase = require('./Fable-ServiceProviderBase-Preinit.js');\n},{\"./Fable-ServiceProviderBase-Preinit.js\":1}]},{},[2])(2)\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 Core Pre-initialization Service Base\n*\n* For a couple services, we need to be able to instantiate them before the Fable object is fully initialized.\n* This is a base class for those services.\n*\n* @author <steven@velozo.com>\n*/\n\nclass FableCoreServiceProviderBase\n{\n\tconstructor(pOptions, pServiceHash)\n\t{\n\t\tthis.fable = false;\n\n\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions : {};\n\n\t\tthis.serviceType = 'Unknown';\n\n\t\t// The hash will be a non-standard UUID ... the UUID service uses this base class!\n\t\tthis.UUID = `CORESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`;\n\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;\n\t}\n\n\n\tstatic isFableService = true;\n\n\t// After fable is initialized, it would be expected to be wired in as a normal service.\n\tconnectFable(pFable)\n\t{\n\t\tthis.fable = pFable;\n\n\t\treturn true;\n\t}\n}\n\nmodule.exports = FableCoreServiceProviderBase;\n","/**\n* Fable Service Base\n* @author <steven@velozo.com>\n*/\n\nclass FableServiceProviderBase\n{\n\tconstructor(pFable, pOptions, pServiceHash)\n\t{\n\t\tthis.fable = pFable;\n\n\t\tthis.options = (typeof(pOptions) === 'object') ? pOptions\n\t\t\t\t\t\t: ((typeof(pFable) === 'object') && !pFable.isFable) ? pFable\n\t\t\t\t\t\t: {};\n\n\t\tthis.serviceType = 'Unknown';\n\n\t\tif (typeof(pFable.getUUID) == 'function')\n\t\t{\n\t\t\tthis.UUID = pFable.getUUID();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.UUID = `NoFABLESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`\n\t\t}\n\n\t\tthis.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;\n\n\t\t// Pull back a few things\n\t\tthis.log = this.fable.log;\n\t\tthis.servicesMap = this.fable.servicesMap;\n\t\tthis.services = this.fable.services;\n\t}\n\n\tstatic isFableService = true;\n}\n\nmodule.exports = FableServiceProviderBase;\n\nmodule.exports.CoreServiceProviderBase = require('./Fable-ServiceProviderBase-Preinit.js');"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fable-serviceproviderbase",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"description": "Simple base classes for fable services.",
|
|
5
5
|
"main": "source/Fable-ServiceProviderBase.js",
|
|
6
6
|
"scripts": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"homepage": "https://github.com/stevenvelozo/fable-serviceproviderbase",
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"chai": "4.3.7",
|
|
45
|
-
"fable": "^3.0.
|
|
45
|
+
"fable": "^3.0.67",
|
|
46
46
|
"mocha": "10.2.0",
|
|
47
47
|
"nyc": "^15.1.0"
|
|
48
48
|
}
|
|
@@ -105,7 +105,7 @@ suite
|
|
|
105
105
|
testFable.serviceManager.addServiceType('SimpleService');
|
|
106
106
|
testFable.serviceManager.instantiateServiceProvider('SimpleService', {SomeOption: true}, 'SimpleService-123');
|
|
107
107
|
|
|
108
|
-
Expect(testFable.serviceManager.
|
|
108
|
+
Expect(testFable.serviceManager.servicesMap['SimpleService']['SimpleService-123']).to.be.an('object');
|
|
109
109
|
}
|
|
110
110
|
);
|
|
111
111
|
test
|
|
@@ -117,12 +117,12 @@ suite
|
|
|
117
117
|
testFable.serviceManager.addServiceType('SimpleService', SimpleService);
|
|
118
118
|
let tmpSimpleService = testFable.serviceManager.instantiateServiceProvider('SimpleService', {SomeOption: true}, 'SimpleService-123');
|
|
119
119
|
|
|
120
|
-
Expect(testFable.serviceManager.
|
|
120
|
+
Expect(testFable.serviceManager.servicesMap['SimpleService']['SimpleService-123']).to.be.an('object');
|
|
121
121
|
|
|
122
122
|
// The passed-in magic stuff should work too.
|
|
123
123
|
tmpSimpleService.log.info(`There were almost ${tmpSimpleService.services.DataFormat.formatterDollars(9821229.37)} dollars just lying here!`);
|
|
124
124
|
|
|
125
|
-
Expect(testFable.serviceManager.
|
|
125
|
+
Expect(testFable.serviceManager.servicesMap['SimpleService']).to.be.an('object');
|
|
126
126
|
|
|
127
127
|
testFable.serviceManager.services.SimpleService.doSomething();
|
|
128
128
|
|
|
@@ -140,9 +140,9 @@ suite
|
|
|
140
140
|
|
|
141
141
|
testFable.serviceManager.instantiateServiceProvider('SimpleService', {SomeOption: true}, 'SimpleService-13');
|
|
142
142
|
|
|
143
|
-
testFable.serviceManager.
|
|
143
|
+
testFable.serviceManager.servicesMap['SimpleService']['SimpleService-13'].doSomething();
|
|
144
144
|
|
|
145
|
-
Expect(testFable.serviceManager.
|
|
145
|
+
Expect(testFable.serviceManager.servicesMap['SimpleService']['SimpleService-13']).to.be.an('object');
|
|
146
146
|
}
|
|
147
147
|
);
|
|
148
148
|
|
|
@@ -157,7 +157,7 @@ suite
|
|
|
157
157
|
|
|
158
158
|
let tmpService = testFable.serviceManager.instantiateServiceProviderWithoutRegistration('SimpleService', {SomeOption: true}, 'SimpleService-99');
|
|
159
159
|
|
|
160
|
-
Expect(testFable.
|
|
160
|
+
Expect(testFable.servicesMap.SimpleService['SimpleService-99']).to.be.an('undefined');
|
|
161
161
|
|
|
162
162
|
Expect(tmpService).to.be.an('object');
|
|
163
163
|
}
|
|
@@ -237,7 +237,7 @@ suite
|
|
|
237
237
|
|
|
238
238
|
testFable.serviceManager.connectPreinitServiceProviderInstance(tmpCoreService);
|
|
239
239
|
|
|
240
|
-
Expect(testFable.
|
|
240
|
+
Expect(testFable.servicesMap.MockCoreService['MockCoreService-2']).to.be.an('object');
|
|
241
241
|
Expect(testFable.services.MockCoreService).to.be.an('object');
|
|
242
242
|
|
|
243
243
|
Expect(testFable.services.MockCoreService.fable.log).to.be.an('object');
|