fable 3.0.62 → 3.0.64

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fable",
3
- "version": "3.0.62",
3
+ "version": "3.0.64",
4
4
  "description": "An entity behavior management and API bundling library.",
5
5
  "main": "source/Fable.js",
6
6
  "scripts": {
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "homepage": "https://github.com/stevenvelozo/fable",
51
51
  "devDependencies": {
52
- "quackage": "^1.0.11"
52
+ "quackage": "^1.0.13"
53
53
  },
54
54
  "dependencies": {
55
55
  "async.eachlimit": "^0.5.2",
@@ -58,7 +58,7 @@
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.5",
61
+ "fable-serviceproviderbase": "^3.0.6",
62
62
  "fable-settings": "^3.0.6",
63
63
  "fable-uuid": "^3.0.5",
64
64
  "manyfest": "^1.0.24",
@@ -16,10 +16,10 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
16
16
  this.serviceTypes = [];
17
17
 
18
18
  // A map of instantiated services
19
- this.services = {};
19
+ this.serviceMap = {};
20
20
 
21
21
  // A map of the default instantiated service by type
22
- this.defaultServices = {};
22
+ this.services = {};
23
23
 
24
24
  // A map of class constructors for services
25
25
  this.serviceClasses = {};
@@ -30,11 +30,19 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
30
30
 
31
31
  addServiceType(pServiceType, pServiceClass)
32
32
  {
33
- // Add the type to the list of types
34
- this.serviceTypes.push(pServiceType);
33
+ if (this.serviceMap.hasOwnProperty(pServiceType))
34
+ {
35
+ // TODO: Check if any services are running?
36
+ this.fable.log.warn(`Adding a service type [${pServiceType}] that already exists.`);
37
+ }
38
+ else
39
+ {
40
+ // Add the container for instantiated services to go in
41
+ this.serviceMap[pServiceType] = {};
35
42
 
36
- // Add the container for instantiated services to go in
37
- this.services[pServiceType] = {};
43
+ // Add the type to the list of types
44
+ this.serviceTypes.push(pServiceType);
45
+ }
38
46
 
39
47
  // Using the static member of the class is a much more reliable way to check if it is a service class than instanceof
40
48
  if ((typeof(pServiceClass) == 'function') && (pServiceClass.isFableService))
@@ -54,7 +62,7 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
54
62
  addAndInstantiateServiceType(pServiceType, pServiceClass)
55
63
  {
56
64
  this.addServiceType(pServiceType, pServiceClass);
57
- this.instantiateServiceProvider(pServiceType, {}, `${pServiceType}-Default`);
65
+ return this.instantiateServiceProvider(pServiceType, {}, `${pServiceType}-Default`);
58
66
  }
59
67
 
60
68
  // Some services expect to be overloaded / customized class.
@@ -69,10 +77,10 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
69
77
  }
70
78
 
71
79
  // Add the service to the service map
72
- this.services[pServiceType][tmpService.Hash] = tmpService;
80
+ this.serviceMap[pServiceType][tmpService.Hash] = tmpService;
73
81
 
74
82
  // If this is the first service of this type, make it the default
75
- if (!this.defaultServices.hasOwnProperty(pServiceType))
83
+ if (!this.services.hasOwnProperty(pServiceType))
76
84
  {
77
85
  this.setDefaultServiceInstantiation(pServiceType, tmpService.Hash)
78
86
  }
@@ -87,10 +95,10 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
87
95
  let tmpService = this.instantiateServiceProviderWithoutRegistration(pServiceType, pOptions, pCustomServiceHash);
88
96
 
89
97
  // Add the service to the service map
90
- this.services[pServiceType][tmpService.Hash] = tmpService;
98
+ this.serviceMap[pServiceType][tmpService.Hash] = tmpService;
91
99
 
92
100
  // If this is the first service of this type, make it the default
93
- if (!this.defaultServices.hasOwnProperty(pServiceType))
101
+ if (!this.services.hasOwnProperty(pServiceType))
94
102
  {
95
103
  this.setDefaultServiceInstantiation(pServiceType, tmpService.Hash)
96
104
  }
@@ -119,17 +127,17 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
119
127
  // The service should already be instantiated, so just connect it to fable
120
128
  pServiceInstance.connectFable(this.fable);
121
129
 
122
- if (!this.services.hasOwnProperty(tmpServiceType))
130
+ if (!this.serviceMap.hasOwnProperty(tmpServiceType))
123
131
  {
124
132
  // If the core service hasn't registered itself yet, create the service container for it.
125
133
  // This means you couldn't register another with this type unless it was later registered with a constructor class.
126
- this.services[tmpServiceType] = {};
134
+ this.serviceMap[tmpServiceType] = {};
127
135
  }
128
136
  // Add the service to the service map
129
- this.services[tmpServiceType][tmpServiceHash] = pServiceInstance;
137
+ this.serviceMap[tmpServiceType][tmpServiceHash] = pServiceInstance;
130
138
 
131
139
  // If this is the first service of this type, make it the default
132
- if (!this.defaultServices.hasOwnProperty(tmpServiceType))
140
+ if (!this.services.hasOwnProperty(tmpServiceType))
133
141
  {
134
142
  this.setDefaultServiceInstantiation(tmpServiceType, tmpServiceHash)
135
143
  }
@@ -139,10 +147,10 @@ class FableService extends libFableServiceBase.CoreServiceProviderBase
139
147
 
140
148
  setDefaultServiceInstantiation(pServiceType, pServiceHash)
141
149
  {
142
- if (this.services[pServiceType].hasOwnProperty(pServiceHash))
150
+ if (this.serviceMap[pServiceType].hasOwnProperty(pServiceHash))
143
151
  {
144
- this.fable[pServiceType] = this.services[pServiceType][pServiceHash];
145
- this.defaultServices[pServiceType] = this.services[pServiceType][pServiceHash];
152
+ this.fable[pServiceType] = this.serviceMap[pServiceType][pServiceHash];
153
+ this.services[pServiceType] = this.serviceMap[pServiceType][pServiceHash];
146
154
  return true;
147
155
  }
148
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 defaultServices()
85
+ get serviceMap()
86
86
  {
87
- return this._coreServices.ServiceManager.defaultServices;
87
+ return this._coreServices.ServiceManager.serviceMap;
88
88
  }
89
89
 
90
90
  getUUID()
@@ -33,7 +33,7 @@ class FableServiceDataGeneration extends libFableServiceBase
33
33
  let tmpLength = (typeof(pLength) === 'undefined') ? 10 : pLength;
34
34
  let tmpMaxNumber = (typeof(pMaxNumber) === 'undefined') ? ((10 ** tmpLength) - 1) : pMaxNumber;
35
35
 
36
- return this.defaultServices.DataFormat.stringPadStart(this.randomIntegerUpTo(tmpMaxNumber), pLength, '0');
36
+ return this.services.DataFormat.stringPadStart(this.randomIntegerUpTo(tmpMaxNumber), pLength, '0');
37
37
  }
38
38
 
39
39
 
@@ -20,7 +20,7 @@ class FableServiceMetaTemplate extends libFableServiceBase
20
20
  this.WordTree = new libWordTree();
21
21
 
22
22
  // In order to allow asynchronous template processing we need to use the async.eachLimit function
23
- this.StringParser = new libStringParser(this.fable.defaultServices.Utility.eachLimit);
23
+ this.StringParser = new libStringParser(this.fable.services.Utility.eachLimit);
24
24
 
25
25
  this.ParseTree = this.WordTree.ParseTree;
26
26
  }
@@ -15,7 +15,7 @@ class FableServiceRestClient extends libFableServiceBase
15
15
  this.TraceLog = true;
16
16
  }
17
17
 
18
- this.dataFormat = this.fable.defaultServices.DataFormat;
18
+ this.dataFormat = this.fable.services.DataFormat;
19
19
 
20
20
  this.serviceType = 'RestClient';
21
21
 
@@ -29,7 +29,7 @@ suite
29
29
  (fTestComplete)=>
30
30
  {
31
31
  let testFable = new libFable({LogStreams: false});
32
- let _DataFormat = testFable.defaultServices.DataFormat;
32
+ let _DataFormat = testFable.services.DataFormat;
33
33
  Expect(_DataFormat
34
34
  .formatTimeSpan(1000))
35
35
  .to.equal('00:00:01.000');
@@ -51,7 +51,7 @@ suite
51
51
  (fTestComplete) =>
52
52
  {
53
53
  let testFable = new libFable({LogStreams: false});
54
- let _DataFormat = testFable.defaultServices.DataFormat;
54
+ let _DataFormat = testFable.services.DataFormat;
55
55
  Expect(_DataFormat
56
56
  .formatTimeDelta(1000, 2000))
57
57
  .to.equal('00:00:01.000');
@@ -73,7 +73,7 @@ suite
73
73
  (fTestComplete) =>
74
74
  {
75
75
  let testFable = new libFable();
76
- let _DataFormat = testFable.defaultServices.DataFormat;
76
+ let _DataFormat = testFable.services.DataFormat;
77
77
  Expect(_DataFormat
78
78
  .getMonthFromDate(new Date('10/20/1988')))
79
79
  .to.equal('October');
@@ -96,7 +96,7 @@ suite
96
96
  (fTestComplete) =>
97
97
  {
98
98
  let testFable = new libFable();
99
- let _DataFormat = testFable.defaultServices.DataFormat;
99
+ let _DataFormat = testFable.services.DataFormat;
100
100
  Expect(_DataFormat
101
101
  .formatSortableStringFromDate(new Date('10/20/1986')))
102
102
  .to.equal('19860920');
@@ -29,7 +29,7 @@ suite
29
29
  (fTestComplete)=>
30
30
  {
31
31
  let testFable = new libFable({LogStreams: false});
32
- let _DataFormat = testFable.defaultServices.DataFormat;
32
+ let _DataFormat = testFable.services.DataFormat;
33
33
  Expect(_DataFormat
34
34
  .stringReverse('Dogs'))
35
35
  .to.equal('sgoD');
@@ -45,7 +45,7 @@ suite
45
45
  (fTestComplete)=>
46
46
  {
47
47
  let testFable = new libFable({LogStreams: false});
48
- let _DataFormat = testFable.defaultServices.DataFormat;
48
+ let _DataFormat = testFable.services.DataFormat;
49
49
  Expect(_DataFormat
50
50
  .insecureStringHash('Dogs'))
51
51
  .to.equal('HSH2135767');
@@ -68,7 +68,7 @@ suite
68
68
  (fTestComplete)=>
69
69
  {
70
70
  let testFable = new libFable({LogStreams: false});
71
- let _DataFormat = testFable.defaultServices.DataFormat;
71
+ let _DataFormat = testFable.services.DataFormat;
72
72
  Expect(_DataFormat.cleanNonAlphaCharacters('Dogs'))
73
73
  .to.equal('Dogs');
74
74
  Expect(_DataFormat.cleanNonAlphaCharacters('Dogs1'))
@@ -84,7 +84,7 @@ suite
84
84
  (fTestComplete)=>
85
85
  {
86
86
  let testFable = new libFable({LogStreams: false});
87
- let _DataFormat = testFable.defaultServices.DataFormat;
87
+ let _DataFormat = testFable.services.DataFormat;
88
88
  Expect(_DataFormat.capitalizeEachWord('Dogs-with-guns 12321'))
89
89
  .to.equal('Dogs-With-Guns 12321');
90
90
  Expect(_DataFormat.cleanNonAlphaCharacters(_DataFormat.capitalizeEachWord('meadow-endpoints')))
@@ -99,7 +99,7 @@ suite
99
99
  (fTestComplete)=>
100
100
  {
101
101
  let testFable = new libFable({LogStreams: false});
102
- let _DataFormat = testFable.defaultServices.DataFormat;
102
+ let _DataFormat = testFable.services.DataFormat;
103
103
  // Test the enclosure cleaning function
104
104
  Expect(_DataFormat
105
105
  .cleanEnclosureWrapCharacters('`', '`Dogs`'))
@@ -133,7 +133,7 @@ suite
133
133
  (fTestComplete)=>
134
134
  {
135
135
  let testFable = new libFable({LogStreams: false});
136
- let _DataFormat = testFable.defaultServices.DataFormat;
136
+ let _DataFormat = testFable.services.DataFormat;
137
137
  Expect(_DataFormat
138
138
  .stringStartsWith('Dogs', 'Do'))
139
139
  .to.equal(true);
@@ -155,7 +155,7 @@ suite
155
155
  (fTestComplete)=>
156
156
  {
157
157
  let testFable = new libFable({LogStreams: false});
158
- let _DataFormat = testFable.defaultServices.DataFormat;
158
+ let _DataFormat = testFable.services.DataFormat;
159
159
  _DataFormat._UseEngineStringStartsWith = false;
160
160
  Expect(_DataFormat
161
161
  .stringStartsWith('Dogs', 'Do'))
@@ -178,7 +178,7 @@ suite
178
178
  (fTestComplete)=>
179
179
  {
180
180
  let testFable = new libFable({LogStreams: false});
181
- let _DataFormat = testFable.defaultServices.DataFormat;
181
+ let _DataFormat = testFable.services.DataFormat;
182
182
  Expect(_DataFormat
183
183
  .stringEndsWith('Dogs', 'gs'))
184
184
  .to.equal(true);
@@ -200,7 +200,7 @@ suite
200
200
  (fTestComplete)=>
201
201
  {
202
202
  let testFable = new libFable({LogStreams: false});
203
- let _DataFormat = testFable.defaultServices.DataFormat;
203
+ let _DataFormat = testFable.services.DataFormat;
204
204
  _DataFormat._UseEngineStringEndsWith = false;
205
205
  Expect(_DataFormat
206
206
  .stringEndsWith('Dogs', 'gs'))
@@ -230,7 +230,7 @@ suite
230
230
  (fTestComplete)=>
231
231
  {
232
232
  let testFable = new libFable({LogStreams: false});
233
- let _DataFormat = testFable.defaultServices.DataFormat;
233
+ let _DataFormat = testFable.services.DataFormat;
234
234
  Expect(_DataFormat
235
235
  .cleanNonAlphaCharacters('Dogs'))
236
236
  .to.equal('Dogs');
@@ -254,7 +254,7 @@ suite
254
254
  (fTestComplete)=>
255
255
  {
256
256
  let testFable = new libFable({LogStreams: false});
257
- let _DataFormat = testFable.defaultServices.DataFormat;
257
+ let _DataFormat = testFable.services.DataFormat;
258
258
  // The usual use case (e.g. for zero padding dates)
259
259
  Expect(_DataFormat.stringPadStart('9', 2, '0'))
260
260
  .to.equal('09');
@@ -282,7 +282,7 @@ suite
282
282
  (fTestComplete)=>
283
283
  {
284
284
  let testFable = new libFable({LogStreams: false});
285
- let _DataFormat = testFable.defaultServices.DataFormat;
285
+ let _DataFormat = testFable.services.DataFormat;
286
286
  // The usual use case (e.g. for left justifying text in fixed-width scenarios)
287
287
  Expect(_DataFormat.stringPadEnd('Bob', 10, ' '))
288
288
  .to.equal('Bob ');
@@ -29,7 +29,7 @@ suite
29
29
  (fTestComplete)=>
30
30
  {
31
31
  let testFable = new libFable({LogStreams: false});
32
- let _DataFormat = testFable.defaultServices.DataFormat;
32
+ let _DataFormat = testFable.services.DataFormat;
33
33
  Expect(_DataFormat
34
34
  .formatterAddCommasToNumber(1000))
35
35
  .to.equal('1,000');
@@ -54,7 +54,7 @@ suite
54
54
  (fTestComplete)=>
55
55
  {
56
56
  let testFable = new libFable({LogStreams: false});
57
- let _DataFormat = testFable.defaultServices.DataFormat;
57
+ let _DataFormat = testFable.services.DataFormat;
58
58
  Expect(_DataFormat
59
59
  .formatterDollars(1000))
60
60
  .to.equal('$1,000.00');
@@ -82,7 +82,7 @@ suite
82
82
  (fTestComplete)=>
83
83
  {
84
84
  let testFable = new libFable({LogStreams: false});
85
- let _DataFormat = testFable.defaultServices.DataFormat;
85
+ let _DataFormat = testFable.services.DataFormat;
86
86
  Expect(_DataFormat
87
87
  .formatterRoundNumber(1000, 2))
88
88
  .to.equal('1000.00');
@@ -29,7 +29,7 @@ suite
29
29
  (fTestComplete)=>
30
30
  {
31
31
  let testFable = new libFable({LogStreams: false});
32
- let _DataFormat = testFable.defaultServices.DataFormat;
32
+ let _DataFormat = testFable.services.DataFormat;
33
33
  Expect(_DataFormat
34
34
  .stringBeforeMatch('Dogs are cool', 'are'))
35
35
  .to.equal('Dogs ');
@@ -48,7 +48,7 @@ suite
48
48
  (fTestComplete)=>
49
49
  {
50
50
  let testFable = new libFable({LogStreams: false});
51
- let _DataFormat = testFable.defaultServices.DataFormat;
51
+ let _DataFormat = testFable.services.DataFormat;
52
52
  Expect(_DataFormat
53
53
  .stringAfterMatch('Dogs are cool', 'are'))
54
54
  .to.equal(' cool');
@@ -67,7 +67,7 @@ suite
67
67
  (fTestComplete)=>
68
68
  {
69
69
  let testFable = new libFable({LogStreams: false});
70
- let _DataFormat = testFable.defaultServices.DataFormat;
70
+ let _DataFormat = testFable.services.DataFormat;
71
71
  Expect(_DataFormat
72
72
  .stringCountEnclosures('Dogs (are) cool'))
73
73
  .to.equal(1);
@@ -100,7 +100,7 @@ suite
100
100
  (fTestComplete)=>
101
101
  {
102
102
  let testFable = new libFable({LogStreams: false});
103
- let _DataFormat = testFable.defaultServices.DataFormat;
103
+ let _DataFormat = testFable.services.DataFormat;
104
104
  Expect(_DataFormat
105
105
  .stringGetEnclosureValueByIndex('Dogs (are) cool', 0))
106
106
  .to.equal('are');
@@ -135,7 +135,7 @@ suite
135
135
  (fTestComplete)=>
136
136
  {
137
137
  let testFable = new libFable({LogStreams: false});
138
- let _DataFormat = testFable.defaultServices.DataFormat;
138
+ let _DataFormat = testFable.services.DataFormat;
139
139
  Expect(_DataFormat
140
140
  .stringRemoveEnclosureByIndex('Dogs (are) cool', 0))
141
141
  .to.equal('Dogs cool');
@@ -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.services.Operation['INTEGRATION-123']).to.equal(tmpOperation);
33
- Expect(testFable.services.Operation['BADHASH']).to.be.undefined;
34
- Expect(testFable.services.Operation.hasOwnProperty('INTEGRATION-123')).to.equal(true);
32
+ Expect(testFable.serviceMap.Operation['INTEGRATION-123']).to.equal(tmpOperation);
33
+ Expect(testFable.serviceMap.Operation['BADHASH']).to.be.undefined;
34
+ Expect(testFable.serviceMap.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.services.Operation['INTEGRATION-123']).to.equal(tmpCollisionOperation);
54
+ Expect(testFable.serviceMap.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.services.Operation.hasOwnProperty(tmpOperation.Hash)).to.equal(true);
66
+ Expect(testFable.serviceMap.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.services['SimpleService']['SimpleService-123']).to.be.an('object');
93
+ Expect(testFable.serviceManager.serviceMap['SimpleService']['SimpleService-123']).to.be.an('object');
94
94
  }
95
95
  );
96
96
  test
@@ -107,9 +107,9 @@ suite
107
107
  }
108
108
  testFable.serviceManager.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'TheBestOne');
109
109
 
110
- Expect(testFable.serviceManager.defaultServices.SimpleService).to.be.an('object');
111
- Expect(testFable.serviceManager.defaultServices.SimpleService.MyFancyProperty).to.equal('Fancy');
112
- Expect(testFable.serviceManager.services.SimpleService.TheBestOne.MyFancyProperty).to.equal('Fancy');
110
+ Expect(testFable.serviceManager.services.SimpleService).to.be.an('object');
111
+ Expect(testFable.serviceManager.services.SimpleService.MyFancyProperty).to.equal('Fancy');
112
+ Expect(testFable.serviceManager.serviceMap.SimpleService.TheBestOne.MyFancyProperty).to.equal('Fancy');
113
113
  }
114
114
  );
115
115
  test
@@ -121,13 +121,13 @@ suite
121
121
  testFable.serviceManager.addServiceType('SimpleService', SimpleService);
122
122
  testFable.serviceManager.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'SimpleService-123');
123
123
 
124
- Expect(testFable.serviceManager.services['SimpleService']['SimpleService-123']).to.be.an('object');
124
+ Expect(testFable.serviceManager.serviceMap['SimpleService']['SimpleService-123']).to.be.an('object');
125
125
 
126
- Expect(testFable.serviceManager.defaultServices['SimpleService']).to.be.an('object');
126
+ Expect(testFable.serviceManager.services['SimpleService']).to.be.an('object');
127
127
 
128
- testFable.serviceManager.defaultServices.SimpleService.doSomething();
128
+ testFable.serviceManager.services.SimpleService.doSomething();
129
129
 
130
- Expect(testFable.serviceManager.defaultServices['SimpleService'].Hash).to.equal('SimpleService-123');
130
+ Expect(testFable.serviceManager.services['SimpleService'].Hash).to.equal('SimpleService-123');
131
131
  }
132
132
  );
133
133
  test
@@ -141,9 +141,9 @@ suite
141
141
 
142
142
  testFable.serviceManager.instantiateServiceProvider('SimpleService', { SomeOption: true }, 'SimpleService-13');
143
143
 
144
- testFable.serviceManager.services['SimpleService']['SimpleService-13'].doSomething();
144
+ testFable.serviceManager.serviceMap['SimpleService']['SimpleService-13'].doSomething();
145
145
 
146
- Expect(testFable.serviceManager.services['SimpleService']['SimpleService-13']).to.be.an('object');
146
+ Expect(testFable.serviceManager.serviceMap['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.services.SimpleService['SimpleService-99']).to.be.an('undefined');
163
- Expect(testFable.services.SimpleService['SimpleService-100']).to.be.an('object');
162
+ Expect(testFable.serviceMap.SimpleService['SimpleService-99']).to.be.an('undefined');
163
+ Expect(testFable.serviceMap.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');
@@ -178,25 +178,25 @@ suite
178
178
  testFable.serviceManager.addServiceType('DatabaseService', MockDatabaseService);
179
179
 
180
180
  testFable.serviceManager.instantiateServiceProvider('SimpleService', { SomeOption: true });
181
- testFable.serviceManager.defaultServices.SimpleService.doSomething();
181
+ testFable.serviceManager.services.SimpleService.doSomething();
182
182
 
183
183
  testFable.serviceManager.instantiateServiceProvider('DatabaseService', { ConnectionString: 'mongodb://localhost:27017/test' }, 'PrimaryConnection');
184
184
 
185
- Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection');
185
+ Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection');
186
186
 
187
187
  testFable.serviceManager.instantiateServiceProvider('DatabaseService', { ConnectionString: 'mongodb://localhost:27017/test' }, 'SecondaryConnection');
188
188
 
189
- Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection');
189
+ Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection');
190
190
 
191
- testFable.serviceManager.defaultServices.DatabaseService.connect();
192
- testFable.serviceManager.defaultServices.DatabaseService.commit('Test Record');
191
+ testFable.serviceManager.services.DatabaseService.connect();
192
+ testFable.serviceManager.services.DatabaseService.commit('Test Record');
193
193
 
194
194
  testFable.serviceManager.setDefaultServiceInstantiation('DatabaseService', 'SecondaryConnection');
195
195
 
196
- testFable.serviceManager.defaultServices.DatabaseService.connect();
197
- testFable.serviceManager.defaultServices.DatabaseService.commit('Another Test Record');
196
+ testFable.serviceManager.services.DatabaseService.connect();
197
+ testFable.serviceManager.services.DatabaseService.commit('Another Test Record');
198
198
 
199
- Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('SecondaryConnection');
199
+ Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('SecondaryConnection');
200
200
  }
201
201
  );
202
202
 
@@ -241,10 +241,10 @@ suite
241
241
 
242
242
  testFable.serviceManager.connectPreinitServiceProviderInstance(tmpCoreService);
243
243
 
244
- Expect(testFable.services.MockCoreService['MockCoreService-2']).to.be.an('object');
245
- Expect(testFable.defaultServices.MockCoreService).to.be.an('object');
244
+ Expect(testFable.serviceMap.MockCoreService['MockCoreService-2']).to.be.an('object');
245
+ Expect(testFable.services.MockCoreService).to.be.an('object');
246
246
 
247
- Expect(testFable.defaultServices.MockCoreService.fable.log).to.be.an('object');
247
+ Expect(testFable.services.MockCoreService.fable.log).to.be.an('object');
248
248
  }
249
249
  )
250
250
 
@@ -259,25 +259,25 @@ suite
259
259
  testFable.serviceManager.addServiceType('DatabaseService', MockDatabaseService);
260
260
 
261
261
  testFable.serviceManager.instantiateServiceProvider('SimpleService', { SomeOption: true });
262
- testFable.serviceManager.defaultServices.SimpleService.doSomething();
262
+ testFable.serviceManager.services.SimpleService.doSomething();
263
263
 
264
264
  testFable.serviceManager.instantiateServiceProvider('DatabaseService', { ConnectionString: 'mongodb://localhost:27017/test' }, 'PrimaryConnection');
265
265
 
266
- Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection');
266
+ Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection');
267
267
 
268
268
  testFable.serviceManager.instantiateServiceProvider('DatabaseService', { ConnectionString: 'mongodb://localhost:27017/test' }, 'SecondaryConnection');
269
269
 
270
- Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection');
270
+ Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection');
271
271
 
272
- testFable.serviceManager.defaultServices.DatabaseService.connect();
273
- testFable.serviceManager.defaultServices.DatabaseService.commit('Test Record');
272
+ testFable.serviceManager.services.DatabaseService.connect();
273
+ testFable.serviceManager.services.DatabaseService.commit('Test Record');
274
274
 
275
275
  Expect(testFable.serviceManager.setDefaultServiceInstantiation('DatabaseService', 'TertiaryConnection')).to.be.false;
276
276
 
277
- testFable.serviceManager.defaultServices.DatabaseService.connect();
278
- testFable.serviceManager.defaultServices.DatabaseService.commit('Another Test Record');
277
+ testFable.serviceManager.services.DatabaseService.connect();
278
+ testFable.serviceManager.services.DatabaseService.commit('Another Test Record');
279
279
 
280
- Expect(testFable.serviceManager.defaultServices.DatabaseService.Hash).to.equal('PrimaryConnection');
280
+ Expect(testFable.serviceManager.services.DatabaseService.Hash).to.equal('PrimaryConnection');
281
281
  }
282
282
  );
283
283
  }
@@ -106,7 +106,7 @@ suite
106
106
  .to.equal('ApplicationNameHere');
107
107
  Expect(testFable.settings.ProductVersion)
108
108
  .to.equal('0.0.0');
109
- testFable.defaultServices.SettingsManager.merge({Product:'TestProduct'});
109
+ testFable.services.SettingsManager.merge({Product:'TestProduct'});
110
110
  Expect(testFable.settings.Product)
111
111
  .to.equal('TestProduct');
112
112
  Expect(testFable.settings.ProductVersion)
@@ -36,7 +36,7 @@ suite
36
36
  function()
37
37
  {
38
38
  testFable = new libFable();
39
- let tmpTemplate = testFable.defaultServices.Utility.template('Something');
39
+ let tmpTemplate = testFable.services.Utility.template('Something');
40
40
  Expect(tmpTemplate).to.be.a('function');
41
41
  }
42
42
  );
@@ -46,7 +46,7 @@ suite
46
46
  function()
47
47
  {
48
48
  testFable = new libFable();
49
- let tmpTemplate = testFable.defaultServices.Utility.template('Something');
49
+ let tmpTemplate = testFable.services.Utility.template('Something');
50
50
  Expect(tmpTemplate).to.be.a('function');
51
51
  Expect(tmpTemplate()).to.equal('Something');
52
52
  }
@@ -57,7 +57,7 @@ suite
57
57
  function()
58
58
  {
59
59
  testFable = new libFable();
60
- let tmpTemplate = testFable.defaultServices.Utility.template('There // %> are \\ */ /* <%= Count %> things....');
60
+ let tmpTemplate = testFable.services.Utility.template('There // %> are \\ */ /* <%= Count %> things....');
61
61
  Expect(tmpTemplate).to.be.a('function');
62
62
  Expect(tmpTemplate({Count:1000})).to.equal('There // %> are \\ */ /* 1000 things....');
63
63
  }
@@ -68,10 +68,10 @@ suite
68
68
  function()
69
69
  {
70
70
  testFable = new libFable();
71
- let tmpTemplate = testFable.defaultServices.Utility.template('There are so many of these things (<%= Count %> to be exact)....');
71
+ let tmpTemplate = testFable.services.Utility.template('There are so many of these things (<%= Count %> to be exact)....');
72
72
  Expect(tmpTemplate).to.be.a('function');
73
73
  Expect(tmpTemplate({Count:1000})).to.equal('There are so many of these things (1000 to be exact)....');
74
- let tmpOtherTemplate = testFable.defaultServices.Utility.template('Things count: <%= Count %>');
74
+ let tmpOtherTemplate = testFable.services.Utility.template('Things count: <%= Count %>');
75
75
  Expect(tmpOtherTemplate).to.be.a('function');
76
76
  Expect(tmpOtherTemplate({Count:600})).to.equal('Things count: 600');
77
77
  Expect(tmpTemplate({Count:256})).to.equal('There are so many of these things (256 to be exact)....');
@@ -83,16 +83,16 @@ suite
83
83
  function()
84
84
  {
85
85
  testFable = new libFable();
86
- testFable.defaultServices.Utility.buildHashedTemplate('HeadLine', '<h1><%= TitleText %> Page</h1>');
87
- testFable.defaultServices.Utility.buildHashedTemplate('Slogan', '<p>Some people, like <%= Name %>, have all the fun.</p>');
86
+ testFable.services.Utility.buildHashedTemplate('HeadLine', '<h1><%= TitleText %> Page</h1>');
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.services.Template.HeadLine.renderFunction({TitleText:'Test'})).to.equal('<h1>Test Page</h1>');
91
- Expect(testFable.services.Template.Slogan.renderFunction({Name:'Jim'})).to.equal('<p>Some people, like Jim, have all the fun.</p>');
90
+ Expect(testFable.serviceMap.Template.HeadLine.renderFunction({TitleText:'Test'})).to.equal('<h1>Test Page</h1>');
91
+ Expect(testFable.serviceMap.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
- Expect(testFable.defaultServices.Utility.templates.HeadLine({TitleText:'A New'})).to.equal('<h1>A New Page</h1>');
95
- Expect(testFable.defaultServices.Utility.templates.Slogan({Name:'Bob'})).to.equal('<p>Some people, like Bob, have all the fun.</p>');
94
+ Expect(testFable.services.Utility.templates.HeadLine({TitleText:'A New'})).to.equal('<h1>A New Page</h1>');
95
+ Expect(testFable.services.Utility.templates.Slogan({Name:'Bob'})).to.equal('<p>Some people, like Bob, have all the fun.</p>');
96
96
  }
97
97
  );
98
98
  test
@@ -101,7 +101,7 @@ suite
101
101
  function()
102
102
  {
103
103
  testFable = new libFable();
104
- let tmpTemplate = testFable.defaultServices.Utility.template('There are <%= Count %> things....', {Count:1000});
104
+ let tmpTemplate = testFable.services.Utility.template('There are <%= Count %> things....', {Count:1000});
105
105
  Expect(tmpTemplate).to.equal('There are 1000 things....');
106
106
  }
107
107
  );
@@ -111,7 +111,7 @@ suite
111
111
  function()
112
112
  {
113
113
  testFable = new libFable();
114
- let tmpResult = testFable.defaultServices.Utility.extend({SomeValue:'here'});
114
+ let tmpResult = testFable.services.Utility.extend({SomeValue:'here'});
115
115
  Expect(tmpResult).to.have.a.property('SomeValue')
116
116
  .that.is.a('string');
117
117
  Expect(tmpResult.SomeValue).to.equal('here')
@@ -123,7 +123,7 @@ suite
123
123
  function()
124
124
  {
125
125
  testFable = new libFable();
126
- let tmpResult = testFable.defaultServices.Utility.extend({SomeValue:'here',Size:10},{Color:'Red',Size:20});
126
+ let tmpResult = testFable.services.Utility.extend({SomeValue:'here',Size:10},{Color:'Red',Size:20});
127
127
  Expect(tmpResult).to.have.a.property('SomeValue')
128
128
  .that.is.a('string');
129
129
  Expect(tmpResult.SomeValue).to.equal('here');
@@ -137,7 +137,7 @@ suite
137
137
  function()
138
138
  {
139
139
  testFable = new libFable();
140
- let tmpResult = testFable.defaultServices.Utility.extend(
140
+ let tmpResult = testFable.services.Utility.extend(
141
141
  {SomeValue:'here',Size:10, Race:'Human'},
142
142
  {Color:'Red',Size:20, Band:'Metalocalypse'},
143
143
  {Name:'Bilbo', Size:15, Race:'Hobbit', Band:'The dead hobbitz'});
@@ -165,20 +165,20 @@ suite
165
165
  */
166
166
  // Regular Expressions for easy conversion of underscore tests:
167
167
  // S: assert.deepEqual\(_.chunk\((.*)\), (.*), '
168
- // R: Expect(testFable.defaultServices.Utility.chunk($1)).to.deep.equal($2); // $3
169
- Expect(testFable.defaultServices.Utility.chunk([], 2)).to.deep.equal([]); // chunk for empty array returns an empty array');
168
+ // R: Expect(testFable.services.Utility.chunk($1)).to.deep.equal($2); // $3
169
+ Expect(testFable.services.Utility.chunk([], 2)).to.deep.equal([]); // chunk for empty array returns an empty array');
170
170
 
171
- Expect(testFable.defaultServices.Utility.chunk([1, 2, 3], 0)).to.deep.equal([]); // chunk into parts of 0 elements returns empty array');
172
- Expect(testFable.defaultServices.Utility.chunk([1, 2, 3], -1)).to.deep.equal([]); // chunk into parts of negative amount of elements returns an empty array');
173
- Expect(testFable.defaultServices.Utility.chunk([1, 2, 3])).to.deep.equal([]); // defaults to empty array (chunk size 0)');
171
+ Expect(testFable.services.Utility.chunk([1, 2, 3], 0)).to.deep.equal([]); // chunk into parts of 0 elements returns empty array');
172
+ Expect(testFable.services.Utility.chunk([1, 2, 3], -1)).to.deep.equal([]); // chunk into parts of negative amount of elements returns an empty array');
173
+ Expect(testFable.services.Utility.chunk([1, 2, 3])).to.deep.equal([]); // defaults to empty array (chunk size 0)');
174
174
 
175
- Expect(testFable.defaultServices.Utility.chunk([1, 2, 3], 1)).to.deep.equal([[1], [2], [3]]); // chunk into parts of 1 elements returns original array');
175
+ Expect(testFable.services.Utility.chunk([1, 2, 3], 1)).to.deep.equal([[1], [2], [3]]); // chunk into parts of 1 elements returns original array');
176
176
 
177
- Expect(testFable.defaultServices.Utility.chunk([1, 2, 3], 3)).to.deep.equal([[1, 2, 3]]); // chunk into parts of current array length elements returns the original array');
178
- Expect(testFable.defaultServices.Utility.chunk([1, 2, 3], 5)).to.deep.equal([[1, 2, 3]]); // chunk into parts of more then current array length elements returns the original array');
177
+ Expect(testFable.services.Utility.chunk([1, 2, 3], 3)).to.deep.equal([[1, 2, 3]]); // chunk into parts of current array length elements returns the original array');
178
+ Expect(testFable.services.Utility.chunk([1, 2, 3], 5)).to.deep.equal([[1, 2, 3]]); // chunk into parts of more then current array length elements returns the original array');
179
179
 
180
- Expect(testFable.defaultServices.Utility.chunk([10, 20, 30, 40, 50, 60, 70], 2)).to.deep.equal([[10, 20], [30, 40], [50, 60], [70]]); // chunk into parts of less then current array length elements');
181
- Expect(testFable.defaultServices.Utility.chunk([10, 20, 30, 40, 50, 60, 70], 3)).to.deep.equal([[10, 20, 30], [40, 50, 60], [70]]); // chunk into parts of less then current array length elements');
180
+ Expect(testFable.services.Utility.chunk([10, 20, 30, 40, 50, 60, 70], 2)).to.deep.equal([[10, 20], [30, 40], [50, 60], [70]]); // chunk into parts of less then current array length elements');
181
+ Expect(testFable.services.Utility.chunk([10, 20, 30, 40, 50, 60, 70], 3)).to.deep.equal([[10, 20, 30], [40, 50, 60], [70]]); // chunk into parts of less then current array length elements');
182
182
  }
183
183
  );
184
184
  test
@@ -187,12 +187,12 @@ suite
187
187
  function(fDone)
188
188
  {
189
189
  testFable = new libFable();
190
- Expect(testFable.defaultServices.Utility.isoStringToDate('1986-06-11T09:34:46.012Z').getTime()).to.equal(518866486012);
191
- Expect(testFable.defaultServices.Utility.isoStringToDate('2022-11-04T11:34:46.000Z').getTime()).to.equal(1667561686000);
192
- Expect(testFable.defaultServices.Utility.isoStringToDate('2022-11-04T11:34:45.000Z').getTime()).to.equal(1667561685000);
193
- Expect(testFable.defaultServices.Utility.isoStringToDate('1986-06-11T09:34:46.012Z').getTime()).to.equal(518866486012);
194
- Expect(testFable.defaultServices.Utility.isoStringToDate('1986-06-11T09:34:46.012Z+0200').getTime()).to.equal(519586486012);
195
- Expect(testFable.defaultServices.Utility.isoStringToDate('1986-06-11T09:34:46.012Z+0200').getTime()).to.equal(519586486012);
190
+ Expect(testFable.services.Utility.isoStringToDate('1986-06-11T09:34:46.012Z').getTime()).to.equal(518866486012);
191
+ Expect(testFable.services.Utility.isoStringToDate('2022-11-04T11:34:46.000Z').getTime()).to.equal(1667561686000);
192
+ Expect(testFable.services.Utility.isoStringToDate('2022-11-04T11:34:45.000Z').getTime()).to.equal(1667561685000);
193
+ Expect(testFable.services.Utility.isoStringToDate('1986-06-11T09:34:46.012Z').getTime()).to.equal(518866486012);
194
+ Expect(testFable.services.Utility.isoStringToDate('1986-06-11T09:34:46.012Z+0200').getTime()).to.equal(519586486012);
195
+ Expect(testFable.services.Utility.isoStringToDate('1986-06-11T09:34:46.012Z+0200').getTime()).to.equal(519586486012);
196
196
  fDone();
197
197
  }
198
198
  )
@@ -205,7 +205,7 @@ suite
205
205
 
206
206
  let tmpState = {};
207
207
 
208
- testFable.defaultServices.Utility.waterfall([
208
+ testFable.services.Utility.waterfall([
209
209
  (fStageComplete)=>
210
210
  {
211
211
  tmpState.Name = 'The Pixies';
@@ -235,7 +235,7 @@ suite
235
235
 
236
236
  let tmpData = ['a','b','c','d','e'];
237
237
 
238
- testFable.defaultServices.Utility.eachLimit(tmpData, 2,
238
+ testFable.services.Utility.eachLimit(tmpData, 2,
239
239
  (pItem, fCallback)=>
240
240
  {
241
241
  tmpState[pItem] = pItem;