fable 3.0.65 → 3.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fable.compatible.js +27 -28
- package/dist/fable.compatible.min.js +2 -2
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +25 -26
- package/dist/fable.min.js +2 -2
- package/dist/fable.min.js.map +1 -1
- package/package.json +5 -5
- package/source/Fable-ServiceManager.js +11 -11
- package/source/Fable.js +2 -2
- package/test/FableOperation_tests.js +5 -5
- package/test/FableServiceManager_tests.js +8 -8
- package/test/Utility_tests.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fable",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.67",
|
|
4
4
|
"description": "An entity behavior management and API bundling library.",
|
|
5
5
|
"main": "source/Fable.js",
|
|
6
6
|
"scripts": {
|
|
@@ -49,19 +49,19 @@
|
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://github.com/stevenvelozo/fable",
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"quackage": "^1.0.
|
|
52
|
+
"quackage": "^1.0.14"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"async.eachlimit": "^0.5.2",
|
|
56
56
|
"async.waterfall": "^0.5.2",
|
|
57
|
-
"cachetrax": "^1.0.
|
|
57
|
+
"cachetrax": "^1.0.4",
|
|
58
58
|
"cookie": "^0.5.0",
|
|
59
59
|
"data-arithmatic": "^1.0.7",
|
|
60
60
|
"fable-log": "^3.0.10",
|
|
61
|
-
"fable-serviceproviderbase": "^3.0.
|
|
61
|
+
"fable-serviceproviderbase": "^3.0.8",
|
|
62
62
|
"fable-settings": "^3.0.6",
|
|
63
63
|
"fable-uuid": "^3.0.5",
|
|
64
|
-
"manyfest": "^1.0.
|
|
64
|
+
"manyfest": "^1.0.25",
|
|
65
65
|
"simple-get": "^4.0.1"
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -16,7 +16,7 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
|
|
|
16
16
|
this.serviceTypes = [];
|
|
17
17
|
|
|
18
18
|
// A map of instantiated services
|
|
19
|
-
this.
|
|
19
|
+
this.servicesMap = {};
|
|
20
20
|
|
|
21
21
|
// A map of the default instantiated service by type
|
|
22
22
|
this.services = {};
|
|
@@ -30,7 +30,7 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
|
|
|
30
30
|
|
|
31
31
|
addServiceType(pServiceType, pServiceClass)
|
|
32
32
|
{
|
|
33
|
-
if (this.
|
|
33
|
+
if (this.servicesMap.hasOwnProperty(pServiceType))
|
|
34
34
|
{
|
|
35
35
|
// TODO: Check if any services are running?
|
|
36
36
|
this.fable.log.warn(`Adding a service type [${pServiceType}] that already exists.`);
|
|
@@ -38,7 +38,7 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
|
|
|
38
38
|
else
|
|
39
39
|
{
|
|
40
40
|
// Add the container for instantiated services to go in
|
|
41
|
-
this.
|
|
41
|
+
this.servicesMap[pServiceType] = {};
|
|
42
42
|
|
|
43
43
|
// Add the type to the list of types
|
|
44
44
|
this.serviceTypes.push(pServiceType);
|
|
@@ -77,7 +77,7 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// Add the service to the service map
|
|
80
|
-
this.
|
|
80
|
+
this.servicesMap[pServiceType][tmpService.Hash] = tmpService;
|
|
81
81
|
|
|
82
82
|
// If this is the first service of this type, make it the default
|
|
83
83
|
if (!this.services.hasOwnProperty(pServiceType))
|
|
@@ -95,7 +95,7 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
|
|
|
95
95
|
let tmpService = this.instantiateServiceProviderWithoutRegistration(pServiceType, pOptions, pCustomServiceHash);
|
|
96
96
|
|
|
97
97
|
// Add the service to the service map
|
|
98
|
-
this.
|
|
98
|
+
this.servicesMap[pServiceType][tmpService.Hash] = tmpService;
|
|
99
99
|
|
|
100
100
|
// If this is the first service of this type, make it the default
|
|
101
101
|
if (!this.services.hasOwnProperty(pServiceType))
|
|
@@ -127,14 +127,14 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
|
|
|
127
127
|
// The service should already be instantiated, so just connect it to fable
|
|
128
128
|
pServiceInstance.connectFable(this.fable);
|
|
129
129
|
|
|
130
|
-
if (!this.
|
|
130
|
+
if (!this.servicesMap.hasOwnProperty(tmpServiceType))
|
|
131
131
|
{
|
|
132
132
|
// If the core service hasn't registered itself yet, create the service container for it.
|
|
133
133
|
// This means you couldn't register another with this type unless it was later registered with a constructor class.
|
|
134
|
-
this.
|
|
134
|
+
this.servicesMap[tmpServiceType] = {};
|
|
135
135
|
}
|
|
136
136
|
// Add the service to the service map
|
|
137
|
-
this.
|
|
137
|
+
this.servicesMap[tmpServiceType][tmpServiceHash] = pServiceInstance;
|
|
138
138
|
|
|
139
139
|
// If this is the first service of this type, make it the default
|
|
140
140
|
if (!this.services.hasOwnProperty(tmpServiceType))
|
|
@@ -147,10 +147,10 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
|
|
|
147
147
|
|
|
148
148
|
setDefaultServiceInstantiation(pServiceType, pServiceHash)
|
|
149
149
|
{
|
|
150
|
-
if (this.
|
|
150
|
+
if (this.servicesMap[pServiceType].hasOwnProperty(pServiceHash))
|
|
151
151
|
{
|
|
152
|
-
this.fable[pServiceType] = this.
|
|
153
|
-
this.services[pServiceType] = this.
|
|
152
|
+
this.fable[pServiceType] = this.servicesMap[pServiceType][pServiceHash];
|
|
153
|
+
this.services[pServiceType] = this.servicesMap[pServiceType][pServiceHash];
|
|
154
154
|
return true;
|
|
155
155
|
}
|
|
156
156
|
|
package/source/Fable.js
CHANGED
|
@@ -82,9 +82,9 @@ class Fable
|
|
|
82
82
|
return this._coreServices.ServiceManager.services;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
get
|
|
85
|
+
get servicesMap()
|
|
86
86
|
{
|
|
87
|
-
return this._coreServices.ServiceManager.
|
|
87
|
+
return this._coreServices.ServiceManager.servicesMap;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
getUUID()
|
|
@@ -29,9 +29,9 @@ suite
|
|
|
29
29
|
let testFable = new libFable();
|
|
30
30
|
let tmpOperation = testFable.serviceManager.instantiateServiceProvider('Operation', {Name: 'Big Complex Integration Operation'}, 'INTEGRATION-123');
|
|
31
31
|
Expect(tmpOperation).to.be.an('object');
|
|
32
|
-
Expect(testFable.
|
|
33
|
-
Expect(testFable.
|
|
34
|
-
Expect(testFable.
|
|
32
|
+
Expect(testFable.servicesMap.Operation['INTEGRATION-123']).to.equal(tmpOperation);
|
|
33
|
+
Expect(testFable.servicesMap.Operation['BADHASH']).to.be.undefined;
|
|
34
|
+
Expect(testFable.servicesMap.Operation.hasOwnProperty('INTEGRATION-123')).to.equal(true);
|
|
35
35
|
tmpOperation.log.info(`Operation GUID ${tmpOperation.GUID} ---- Test 123`);
|
|
36
36
|
Expect(tmpOperation.state.Log.length).to.equal(1);
|
|
37
37
|
Expect(tmpOperation.state.Log[0]).to.contain('Test 123');
|
|
@@ -51,7 +51,7 @@ suite
|
|
|
51
51
|
Expect(tmpCollisionOperation).to.be.an('object');
|
|
52
52
|
Expect(tmpCollisionOperation.name).to.equal('Another Big Complex Integration Operation with Colliding Name');
|
|
53
53
|
|
|
54
|
-
Expect(testFable.
|
|
54
|
+
Expect(testFable.servicesMap.Operation['INTEGRATION-123']).to.equal(tmpCollisionOperation);
|
|
55
55
|
|
|
56
56
|
}
|
|
57
57
|
);
|
|
@@ -63,7 +63,7 @@ suite
|
|
|
63
63
|
let testFable = new libFable();
|
|
64
64
|
let tmpOperation = testFable.serviceManager.instantiateServiceProvider('Operation', {Name:'Another Big Complex Integration Operation'});
|
|
65
65
|
Expect(tmpOperation).to.be.an('object');
|
|
66
|
-
Expect(testFable.
|
|
66
|
+
Expect(testFable.servicesMap.Operation.hasOwnProperty(tmpOperation.Hash)).to.equal(true);
|
|
67
67
|
Expect(tmpOperation.state.Log.length).to.equal(0);
|
|
68
68
|
let tmpText = `Operation ${tmpOperation.Hash} starting up...`;
|
|
69
69
|
tmpOperation.log.info(tmpText);
|
|
@@ -90,7 +90,7 @@ suite
|
|
|
90
90
|
testFable.serviceManager.addServiceType('SimpleService');
|
|
91
91
|
testFable.serviceManager.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'SimpleService-123');
|
|
92
92
|
|
|
93
|
-
Expect(testFable.serviceManager.
|
|
93
|
+
Expect(testFable.serviceManager.servicesMap['SimpleService']['SimpleService-123']).to.be.an('object');
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
test
|
|
@@ -109,7 +109,7 @@ suite
|
|
|
109
109
|
|
|
110
110
|
Expect(testFable.serviceManager.services.SimpleService).to.be.an('object');
|
|
111
111
|
Expect(testFable.serviceManager.services.SimpleService.MyFancyProperty).to.equal('Fancy');
|
|
112
|
-
Expect(testFable.serviceManager.
|
|
112
|
+
Expect(testFable.serviceManager.servicesMap.SimpleService.TheBestOne.MyFancyProperty).to.equal('Fancy');
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
115
|
test
|
|
@@ -121,7 +121,7 @@ suite
|
|
|
121
121
|
testFable.serviceManager.addServiceType('SimpleService', SimpleService);
|
|
122
122
|
testFable.serviceManager.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'SimpleService-123');
|
|
123
123
|
|
|
124
|
-
Expect(testFable.serviceManager.
|
|
124
|
+
Expect(testFable.serviceManager.servicesMap['SimpleService']['SimpleService-123']).to.be.an('object');
|
|
125
125
|
|
|
126
126
|
Expect(testFable.serviceManager.services['SimpleService']).to.be.an('object');
|
|
127
127
|
|
|
@@ -141,9 +141,9 @@ suite
|
|
|
141
141
|
|
|
142
142
|
testFable.serviceManager.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'SimpleService-13');
|
|
143
143
|
|
|
144
|
-
testFable.serviceManager.
|
|
144
|
+
testFable.serviceManager.servicesMap['SimpleService']['SimpleService-13'].doSomething();
|
|
145
145
|
|
|
146
|
-
Expect(testFable.serviceManager.
|
|
146
|
+
Expect(testFable.serviceManager.servicesMap['SimpleService']['SimpleService-13']).to.be.an('object');
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
149
|
|
|
@@ -159,8 +159,8 @@ suite
|
|
|
159
159
|
let tmpService = testFable.serviceManager.instantiateServiceProviderWithoutRegistration('SimpleService', { SomeOption: true }, 'SimpleService-99');
|
|
160
160
|
let tmpServiceFromPrototype = testFable.serviceManager.instantiateServiceProviderFromPrototype('SimpleService', { SomeOption: true }, 'SimpleService-100', SimpleService);
|
|
161
161
|
|
|
162
|
-
Expect(testFable.
|
|
163
|
-
Expect(testFable.
|
|
162
|
+
Expect(testFable.servicesMap.SimpleService['SimpleService-99']).to.be.an('undefined');
|
|
163
|
+
Expect(testFable.servicesMap.SimpleService['SimpleService-100']).to.be.an('object');
|
|
164
164
|
Expect(tmpServiceFromPrototype).to.be.an('object');
|
|
165
165
|
|
|
166
166
|
Expect(tmpService).to.be.an('object');
|
|
@@ -241,7 +241,7 @@ suite
|
|
|
241
241
|
|
|
242
242
|
testFable.serviceManager.connectPreinitServiceProviderInstance(tmpCoreService);
|
|
243
243
|
|
|
244
|
-
Expect(testFable.
|
|
244
|
+
Expect(testFable.servicesMap.MockCoreService['MockCoreService-2']).to.be.an('object');
|
|
245
245
|
Expect(testFable.services.MockCoreService).to.be.an('object');
|
|
246
246
|
|
|
247
247
|
Expect(testFable.services.MockCoreService.fable.log).to.be.an('object');
|
package/test/Utility_tests.js
CHANGED
|
@@ -87,8 +87,8 @@ suite
|
|
|
87
87
|
testFable.services.Utility.buildHashedTemplate('Slogan', '<p>Some people, like <%= Name %>, have all the fun.</p>');
|
|
88
88
|
|
|
89
89
|
// Access the low level service render function
|
|
90
|
-
Expect(testFable.
|
|
91
|
-
Expect(testFable.
|
|
90
|
+
Expect(testFable.servicesMap.Template.HeadLine.renderFunction({TitleText:'Test'})).to.equal('<h1>Test Page</h1>');
|
|
91
|
+
Expect(testFable.servicesMap.Template.Slogan.renderFunction({Name:'Jim'})).to.equal('<p>Some people, like Jim, have all the fun.</p>');
|
|
92
92
|
|
|
93
93
|
// Use the high level simpler one
|
|
94
94
|
Expect(testFable.services.Utility.templates.HeadLine({TitleText:'A New'})).to.equal('<h1>A New Page</h1>');
|