fable 3.0.35 → 3.0.37

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.
Files changed (59) hide show
  1. package/.config/configstore/update-notifier-npm.json +1 -1
  2. package/.config/vscode-sqltools/runningInfo.json +1 -1
  3. package/Dockerfile_LUXURYCode +7 -4
  4. package/debug/Harness.js +3 -4
  5. package/dist/fable.compatible.js +14 -14
  6. package/dist/fable.compatible.min.js +2 -2
  7. package/dist/fable.compatible.min.js.map +1 -1
  8. package/dist/fable.js +6 -6
  9. package/dist/fable.min.js +2 -2
  10. package/dist/fable.min.js.map +1 -1
  11. package/package.json +5 -2
  12. package/retold-harness/Bookstore-Import-Books.sh +4 -0
  13. package/retold-harness/bookstore-api-endpoint-exercises.paw +0 -0
  14. package/retold-harness/bookstore-import-books-run.js +9 -0
  15. package/retold-harness/bookstore-serve-meadow-endpoint-apis-run.js +6 -0
  16. package/{.config/retold-harness → retold-harness}/bookstore-serve-meadow-endpoint-apis.js +4 -1
  17. package/{.config/retold-harness → retold-harness}/package.json +5 -2
  18. package/source/Fable.js +2 -0
  19. package/source/services/Fable-Service-EnvironmentData-Web.js +15 -0
  20. package/source/services/Fable-Service-EnvironmentData.js +15 -0
  21. package/source/services/Fable-Service-RestClient.js +130 -26
  22. package/test/Fable_tests.js +2 -0
  23. package/test/RestClient_test.js +69 -3
  24. package/.config/retold-harness/bookstore-api-endpoint-exercises.paw +0 -0
  25. package/.config/retold-harness/bookstore-import-books-run.js +0 -1
  26. /package/{.config/retold-harness → retold-harness}/MySQL-Laden-Entry.sh +0 -0
  27. /package/{.config/retold-harness → retold-harness}/MySQL-Security.sql +0 -0
  28. /package/{.config/retold-harness → retold-harness}/bookstore-configuration.json +0 -0
  29. /package/{.config/retold-harness → retold-harness}/bookstore-import-books.js +0 -0
  30. /package/{.config/retold-harness → retold-harness}/bookstore-serve-meadow-endpoint-apis-IPC.js +0 -0
  31. /package/{.config/retold-harness → retold-harness}/data/books.csv +0 -0
  32. /package/{.config/retold-harness → retold-harness}/model/ddl/BookStore.ddl +0 -0
  33. /package/{.config/retold-harness → retold-harness}/model/generated_diagram/README.md +0 -0
  34. /package/{.config/retold-harness → retold-harness}/model/generated_diagram/Stricture_Output.dot +0 -0
  35. /package/{.config/retold-harness → retold-harness}/model/generated_diagram/Stricture_Output.png +0 -0
  36. /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Dictionary.md +0 -0
  37. /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Author.md +0 -0
  38. /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Book.md +0 -0
  39. /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-BookAuthorJoin.md +0 -0
  40. /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-BookPrice.md +0 -0
  41. /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Review.md +0 -0
  42. /package/{.config/retold-harness → retold-harness}/model/generated_documentation/ModelChangeTracking.md +0 -0
  43. /package/{.config/retold-harness → retold-harness}/model/generated_documentation/README.md +0 -0
  44. /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore-Extended.json +0 -0
  45. /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore-PICT.json +0 -0
  46. /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore.json +0 -0
  47. /package/{.config/retold-harness → retold-harness}/model/json_schema/README.md +0 -0
  48. /package/{.config/retold-harness → retold-harness}/model/manual_scripts/DropTables.sql +0 -0
  49. /package/{.config/retold-harness → retold-harness}/model/manual_scripts/README.md +0 -0
  50. /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Author.json +0 -0
  51. /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Book.json +0 -0
  52. /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-BookAuthorJoin.json +0 -0
  53. /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-BookPrice.json +0 -0
  54. /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Review.json +0 -0
  55. /package/{.config/retold-harness → retold-harness}/model/meadow_schema/README.md +0 -0
  56. /package/{.config/retold-harness → retold-harness}/model/sql_create/BookStore-CreateDatabase.mysql.sql +0 -0
  57. /package/{.config/retold-harness → retold-harness}/model/sql_create/README.md +0 -0
  58. /package/{.config/retold-harness → retold-harness}/test_old/Tests.js +0 -0
  59. /package/{.config/retold-harness → retold-harness}/test_old/untitled.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fable",
3
- "version": "3.0.35",
3
+ "version": "3.0.37",
4
4
  "description": "An entity behavior management and API bundling library.",
5
5
  "main": "source/Fable.js",
6
6
  "scripts": {
@@ -10,7 +10,7 @@
10
10
  "build": "./node_modules/.bin/gulp build",
11
11
  "build-compatible": "GULP_CUSTOM_BUILD_TARGET=compatible ./node_modules/.bin/gulp build",
12
12
  "docker-dev-build-image": "docker build ./ -f Dockerfile_LUXURYCode -t retold/fable:local",
13
- "docker-dev-run": "docker run -it -d --name retold-fable-dev -p 30001:8080 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" retold/fable:local"
13
+ "docker-dev-run": "docker run -it -d --name retold-fable-dev -p 30001:8080 -p 8086:8086 -v \"$PWD/.config:/home/coder/.config\" -v \"$PWD:/home/coder/fable\" -u \"$(id -u):$(id -g)\" -e \"DOCKER_USER=$USER\" retold/fable:local"
14
14
  },
15
15
  "mocha": {
16
16
  "diff": true,
@@ -30,6 +30,9 @@
30
30
  "lib/vendor"
31
31
  ]
32
32
  },
33
+ "browser": {
34
+ "./source/service/Fable-Service-EnvironmentData.js": "./source/service/Fable-Service-EnvironmentData-Web.js"
35
+ },
33
36
  "repository": {
34
37
  "type": "git",
35
38
  "url": "https://github.com/stevenvelozo/fable.git"
@@ -0,0 +1,4 @@
1
+ #/bin/bash
2
+
3
+ # Eventually this will delete the database too!
4
+ node ./bookstore-import-books-run.js
@@ -0,0 +1,9 @@
1
+ let tmpRun = require('./bookstore-import-books.js')(
2
+ (pError)=>
3
+ {
4
+ if (pError)
5
+ {
6
+ console.log(`ERROR: ${pError}`, pError);
7
+ }
8
+ process.exit();
9
+ });
@@ -0,0 +1,6 @@
1
+ const libServer = require('./bookstore-serve-meadow-endpoint-apis.js');
2
+ let _Orator = libServer(
3
+ ()=>
4
+ {
5
+ console.log('API service is started!');
6
+ });
@@ -74,13 +74,16 @@ let fStartServiceServer = (fInitializeCallback) =>
74
74
  _MeadowEndpoints[tmpDALEntityName].connectRoutes(_Orator.webServer);
75
75
  }
76
76
 
77
+ let tmpNames = Object.keys(_MeadowEndpoints.Book);
78
+ console.log(JSON.stringify(tmpNames));
79
+
77
80
  // 100. Add a post processing hook to the Book DAL on single reads
78
81
  /*
79
82
  This post processing step will look for all book author joins then
80
83
  load all appropriate authors and stuff them in the book record before
81
84
  returning it.
82
85
  */
83
- _MeadowEndpoints.Book.controller.BehaviorInjection.setBehavior('Read-PostOperation',
86
+ _MeadowEndpoints.Book.behaviorModifications.setBehavior('Read-PostOperation',
84
87
  (pRequest, pRequestState, fComplete) =>
85
88
  {
86
89
  // Get the join records
@@ -4,16 +4,19 @@
4
4
  "description": "Harness data import and server.",
5
5
  "main": "bookstore-serve-meadow-endpoints-apis.js",
6
6
  "scripts": {
7
+ "start": "node bookstore-serve-meadow-endpoint-apis-run.js",
7
8
  "test": "echo \"Error: no test specified\" && exit 1"
8
9
  },
9
10
  "author": "",
10
11
  "license": "MIT",
11
12
  "dependencies": {
12
13
  "async": "^3.2.4",
13
- "fable": "^3.0.33",
14
+ "fable": "^3.0.35",
14
15
  "meadow": "^2.0.4",
15
16
  "meadow-endpoints": "^3.0.7",
16
17
  "mysql2": "^3.3.0",
17
- "orator": "^3.0.11"
18
+ "orator": "^3.0.11",
19
+ "orator-serviceserver-restify": "^1.0.4",
20
+ "papaparse": "^5.4.1"
18
21
  }
19
22
  }
package/source/Fable.js CHANGED
@@ -10,6 +10,7 @@ const libFableLog = require('fable-log');
10
10
  const libFableServiceManager = require('./Fable-ServiceManager.js');
11
11
 
12
12
  // Default Services
13
+ const libFableServiceEnvironmentData = require('./services/Fable-Service-EnvironmentData.js');
13
14
  const libFableServiceDataFormat = require('./services/Fable-Service-DataFormat.js');
14
15
  const libFableServiceMetaTemplate = require('./services/Fable-Service-MetaTemplate.js');
15
16
  const libFableServiceOperation = require('./services/Fable-Service-Operation.js');
@@ -50,6 +51,7 @@ class Fable
50
51
  this.serviceManager.connectPreinitServiceProviderInstance(this._coreServices.SettingsManager);
51
52
 
52
53
  // Initialize and instantiate the default baked-in Data Arithmatic service
54
+ this.serviceManager.addAndInstantiateServiceType('EnvironmentData', libFableServiceEnvironmentData);
53
55
  this.serviceManager.addServiceType('Template', libFableServiceTemplate);
54
56
  this.serviceManager.addServiceType('MetaTemplate', libFableServiceMetaTemplate);
55
57
  this.serviceManager.addAndInstantiateServiceType('DataFormat', libFableServiceDataFormat);
@@ -0,0 +1,15 @@
1
+ const libFableServiceBase = require('../Fable-ServiceManager.js').ServiceProviderBase;
2
+
3
+ class FableServiceEnvironmentData extends libFableServiceBase
4
+ {
5
+ constructor(pFable, pOptions, pServiceHash)
6
+ {
7
+ super(pFable, pOptions, pServiceHash);
8
+
9
+ this.serviceType = 'EnvironmentData';
10
+
11
+ this.Environment = `web`;
12
+ }
13
+ }
14
+
15
+ module.exports = FableServiceEnvironmentData;
@@ -0,0 +1,15 @@
1
+ const libFableServiceBase = require('../Fable-ServiceManager.js').ServiceProviderBase;
2
+
3
+ class FableServiceEnvironmentData extends libFableServiceBase
4
+ {
5
+ constructor(pFable, pOptions, pServiceHash)
6
+ {
7
+ super(pFable, pOptions, pServiceHash);
8
+
9
+ this.serviceType = 'EnvironmentData';
10
+
11
+ this.Environment = `node.js`;
12
+ }
13
+ }
14
+
15
+ module.exports = FableServiceEnvironmentData;
@@ -19,64 +19,88 @@ class FableServiceRestClient extends libFableServiceBase
19
19
  this.serviceType = 'RestClient';
20
20
  }
21
21
 
22
- getJSON(pOptionsOrURL, fCallback)
22
+ executeChunkedRequest(pOptions, fCallback)
23
23
  {
24
- return this.getRaw(pOptionsOrURL,
25
- (pError, pResponse, pResult) =>
24
+ pOptions.RequestStartTime = this.fable.log.getTimeStamp();
25
+
26
+ if (this.TraceLog)
27
+ {
28
+ this.fable.log.debug(`Beginning ${pOptions.method} request to ${pOptions.url} at ${pOptions.RequestStartTime}`);
29
+ }
30
+
31
+ return libSimpleGet(pOptions,
32
+ (pError, pResponse)=>
26
33
  {
27
34
  if (pError)
28
35
  {
29
- return fCallback(pError, pResponse, pResult);
36
+ return fCallback(pError, pResponse);
30
37
  }
31
38
 
32
- if (pResponse.statusCode != 200)
39
+ if (this.TraceLog)
33
40
  {
34
- return fCallback(new Error(`Invalid status code ${pResponse.statusCode}`), pResponse, pResult);
41
+ let tmpConnectTime = this.fable.log.getTimeStamp();
42
+ this.fable.log.debug(`--> ${pOptions.method} connected in ${this.dataFormat.formatTimeDelta(pOptions.RequestStartTime, tmpConnectTime)}ms code ${pResponse.statusCode}`);
35
43
  }
36
44
 
37
- return fCallback(pError, pResponse, JSON.parse(pResult));
45
+ let tmpData = '';
46
+
47
+ pResponse.on('data', (pChunk) =>
48
+ {
49
+ // For JSON, the chunk is the serialized object.
50
+ if (this.TraceLog)
51
+ {
52
+ let tmpChunkTime = this.fable.log.getTimeStamp();
53
+ this.fable.log.debug(`--> ${pOptions.method} data chunk size ${pChunk.length}b received in ${this.dataFormat.formatTimeDelta(pOptions.RequestStartTime, tmpChunkTime)}ms`);
54
+ }
55
+ tmpData += pChunk;
56
+ });
57
+
58
+ pResponse.on('end', ()=>
59
+ {
60
+ if (this.TraceLog)
61
+ {
62
+ let tmpCompletionTime = this.fable.log.getTimeStamp();
63
+ this.fable.log.debug(`==> ${pOptions.method} completed data size ${tmpData.length}b received in ${this.dataFormat.formatTimeDelta(pOptions.RequestStartTime, tmpCompletionTime)}ms`);
64
+ }
65
+ return fCallback(pError, pResponse, tmpData);
66
+ });
38
67
  });
39
68
  }
40
69
 
41
- getRaw(pOptionsOrURL, fCallback)
70
+ executeJSONRequest(pOptions, fCallback)
42
71
  {
43
- let tmpRequestOptions = (typeof(pOptions) == 'object') ? pOptions : {};
44
- if (typeof(pOptionsOrURL) == 'string')
45
- {
46
- tmpRequestOptions.url = pOptionsOrURL;
47
- }
72
+ pOptions.json = true;
73
+
74
+ pOptions.RequestStartTime = this.fable.log.getTimeStamp();
48
75
 
49
- let tmpRequestStartTime = this.fable.log.getTimeStamp();
50
76
  if (this.TraceLog)
51
77
  {
52
- let tmpConnectTime = this.fable.log.getTimeStamp();
53
- this.fable.log.debug(`Beginning GET request to ${tmpRequestOptions.url} at ${tmpRequestStartTime}`);
78
+ this.fable.log.debug(`Beginning ${pOptions.method} JSON request to ${pOptions.url} at ${pOptions.RequestStartTime}`);
54
79
  }
55
80
 
56
- libSimpleGet.get(tmpRequestOptions,
81
+ return libSimpleGet(pOptions,
57
82
  (pError, pResponse)=>
58
83
  {
59
84
  if (pError)
60
85
  {
61
- return fCallback(pError, pResponse, tmpRequestOptions);
86
+ return fCallback(pError, pResponse);
62
87
  }
63
88
 
64
89
  if (this.TraceLog)
65
90
  {
66
91
  let tmpConnectTime = this.fable.log.getTimeStamp();
67
- this.fable.log.debug(`--> GET connected in ${this.dataFormat.formatTimeDelta(tmpRequestStartTime, tmpConnectTime)}ms code ${pResponse.statusCode}`);
92
+ this.fable.log.debug(`--> JSON ${pOptions.method} connected in ${this.dataFormat.formatTimeDelta(pOptions.RequestStartTime, tmpConnectTime)}ms code ${pResponse.statusCode}`);
68
93
  }
69
94
 
70
- let tmpData = '';
71
-
72
- pResponse.on('data', (pChunk)=>
95
+ pResponse.on('data', (pChunk) =>
73
96
  {
74
97
  if (this.TraceLog)
75
98
  {
76
99
  let tmpChunkTime = this.fable.log.getTimeStamp();
77
- this.fable.log.debug(`--> GET data chunk size ${pChunk.length}b received in ${this.dataFormat.formatTimeDelta(tmpRequestStartTime, tmpChunkTime)}ms`);
100
+ this.fable.log.debug(`--> JSON ${pOptions.method} data chunk size ${pChunk.length}b received in ${this.dataFormat.formatTimeDelta(pOptions.RequestStartTime, tmpChunkTime)}ms`);
78
101
  }
79
- tmpData += pChunk;
102
+ // In a JSON request, the chunk is the serialized method.
103
+ return fCallback(pError, pResponse, JSON.parse(pChunk));
80
104
  });
81
105
 
82
106
  pResponse.on('end', ()=>
@@ -84,12 +108,92 @@ class FableServiceRestClient extends libFableServiceBase
84
108
  if (this.TraceLog)
85
109
  {
86
110
  let tmpCompletionTime = this.fable.log.getTimeStamp();
87
- this.fable.log.debug(`==> GET completed data size ${tmpData.length}b received in ${this.dataFormat.formatTimeDelta(tmpRequestStartTime, tmpCompletionTime)}ms`);
111
+ this.fable.log.debug(`==> JSON ${pOptions.method} completed - received in ${this.dataFormat.formatTimeDelta(pOptions.RequestStartTime, tmpCompletionTime)}ms`);
88
112
  }
89
- return fCallback(pError, pResponse, tmpData);
90
113
  });
91
114
  });
92
115
  }
116
+
117
+ getJSON(pOptionsOrURL, fCallback)
118
+ {
119
+ let tmpRequestOptions = (typeof(pOptions) == 'object') ? pOptions : {};
120
+ if (typeof(pOptionsOrURL) == 'string')
121
+ {
122
+ tmpRequestOptions.url = pOptionsOrURL;
123
+ }
124
+
125
+ tmpRequestOptions.method = 'GET';
126
+
127
+ return this.executeJSONRequest(tmpRequestOptions, fCallback);
128
+ }
129
+
130
+ putJSON(pOptions, fCallback)
131
+ {
132
+ if (typeof(pOptions.body) != 'object')
133
+ {
134
+ return fCallback(new Error(`PUT JSON Error Invalid options object`));
135
+ }
136
+
137
+ pOptions.method = 'PUT';
138
+
139
+ return this.executeJSONRequest(pOptions, fCallback);
140
+ }
141
+
142
+ postJSON(pOptions, fCallback)
143
+ {
144
+ if (typeof(pOptions.body) != 'object')
145
+ {
146
+ return fCallback(new Error(`POST JSON Error Invalid options object`));
147
+ }
148
+
149
+ pOptions.method = 'POST';
150
+
151
+ return this.executeJSONRequest(pOptions, fCallback);
152
+ }
153
+
154
+ patchJSON(pOptions, fCallback)
155
+ {
156
+ if (typeof(pOptions.body) != 'object')
157
+ {
158
+ return fCallback(new Error(`PATCH JSON Error Invalid options object`));
159
+ }
160
+
161
+ pOptions.method = 'PATCH';
162
+
163
+ return this.executeJSONRequest(pOptions, fCallback);
164
+ }
165
+
166
+ headJSON(pOptions, fCallback)
167
+ {
168
+ if (typeof(pOptions.body) != 'object')
169
+ {
170
+ return fCallback(new Error(`HEAD JSON Error Invalid options object`));
171
+ }
172
+
173
+ pOptions.method = 'HEAD';
174
+
175
+ return this.executeJSONRequest(pOptions, fCallback);
176
+ }
177
+
178
+ delJSON(pOptions, fCallback)
179
+ {
180
+ pOptions.method = 'DELETE';
181
+
182
+ return this.executeJSONRequest(pOptions, fCallback);
183
+ }
184
+
185
+ getRawText(pOptionsOrURL, fCallback)
186
+ {
187
+ let tmpRequestOptions = (typeof(pOptions) == 'object') ? pOptions : {};
188
+ if (typeof(pOptionsOrURL) == 'string')
189
+ {
190
+ tmpRequestOptions.url = pOptionsOrURL;
191
+ }
192
+
193
+ tmpRequestOptions.method = 'GET';
194
+
195
+ return this.executeChunkedRequest(tmpRequestOptions, fCallback);
196
+ }
93
197
  }
94
198
 
95
199
  module.exports = FableServiceRestClient;
@@ -62,6 +62,8 @@ suite
62
62
  .that.is.a('object');
63
63
  Expect(testFable.settings.Product)
64
64
  .to.equal('LegacyApplicationNameHere')
65
+ Expect(testFable.EnvironmentData.Environment)
66
+ .to.equal('node.js');
65
67
  }
66
68
  );
67
69
  test
@@ -38,16 +38,82 @@ suite
38
38
  let tmpRestClient = testFable.serviceManager.instantiateServiceProvider('RestClient', {TraceLog: true}, 'RestClient-99');
39
39
 
40
40
  // Download the wiktionary entry for dog!
41
- tmpRestClient.getJSON('https://en.wiktionary.org/w/api.php?action=parse&prop=wikitext&format=json&page=dog',
41
+ tmpRestClient.getJSON('http://localhost:8086/1.0/Author/1',
42
42
  (pError, pResponse, pBody)=>
43
43
  {
44
44
  Expect(pBody).to.be.an('object');
45
- Expect(pBody.hasOwnProperty('parse')).to.equal(true);
46
- Expect(pBody.parse.title).to.equal('dog');
45
+ Expect(pBody.hasOwnProperty('Name')).to.equal(true);
46
+ Expect(pBody.Name).to.equal('J.K. Rowling');
47
47
  fTestComplete();
48
48
  });
49
49
  }
50
50
  );
51
+ test
52
+ (
53
+ 'Perform a POST request.',
54
+ function(fTestComplete)
55
+ {
56
+ let testFable = new libFable();
57
+ // Instantiate the RestClient Service Provider
58
+ let tmpRestClient = testFable.serviceManager.instantiateServiceProvider('RestClient', {TraceLog: true}, 'RestClient-99');
59
+
60
+ // Download the wiktionary entry for dog!
61
+ tmpRestClient.postJSON({url: 'http://localhost:8086/1.0/Author', body:{Name:'Test Author'}},
62
+ (pError, pResponse, pBody)=>
63
+ {
64
+ Expect(pBody).to.be.an('object');
65
+ Expect(pBody.hasOwnProperty('Name')).to.equal(true);
66
+ Expect(pBody.Name).to.equal('Test Author');
67
+ fTestComplete();
68
+ });
69
+ }
70
+ );
71
+ test
72
+ (
73
+ 'Perform a PUT request.',
74
+ function(fTestComplete)
75
+ {
76
+ let testFable = new libFable();
77
+ // Instantiate the RestClient Service Provider
78
+ let tmpRestClient = testFable.serviceManager.instantiateServiceProvider('RestClient', {TraceLog: true}, 'RestClient-99');
79
+
80
+ // Download the wiktionary entry for dog!
81
+ tmpRestClient.putJSON({url: 'http://localhost:8086/1.0/Author/Upsert', body:{GUIDAuthor:'TestAuthor', Name:'Test Author 2'}},
82
+ (pError, pResponse, pBody)=>
83
+ {
84
+ Expect(pBody).to.be.an('object');
85
+ Expect(pBody.hasOwnProperty('Name')).to.equal(true);
86
+ Expect(pBody.Name).to.equal('Test Author 2');
87
+ fTestComplete();
88
+ });
89
+ }
90
+ );
91
+ test
92
+ (
93
+ 'Perform an UPSERT request then a DELETE.',
94
+ function(fTestComplete)
95
+ {
96
+ let testFable = new libFable();
97
+ // Instantiate the RestClient Service Provider
98
+ let tmpRestClient = testFable.serviceManager.instantiateServiceProvider('RestClient', {TraceLog: true}, 'RestClient-99');
99
+
100
+ // Download the wiktionary entry for dog!
101
+ tmpRestClient.putJSON({url: 'http://localhost:8086/1.0/Author/Upsert', body:{Name:'Test Author 2 DELETE'}},
102
+ (pError, pResponse, pBody)=>
103
+ {
104
+ Expect(pBody).to.be.an('object');
105
+ Expect(pBody.hasOwnProperty('Name')).to.equal(true);
106
+ Expect(pBody.Name).to.equal('Test Author 2 DELETE');
107
+ tmpRestClient.delJSON({url: `http://localhost:8086/1.0/Author/${pBody.IDAuthor}`},
108
+ (pDeleteError, pDeleteResponse, pDeleteBody) =>
109
+ {
110
+ Expect(pDeleteBody.Count)
111
+ .to.equal(1);
112
+ fTestComplete();
113
+ });
114
+ });
115
+ }
116
+ );
51
117
  }
52
118
  );
53
119
  }
@@ -1 +0,0 @@
1
- let tmpRun = require('./bookstore-import-books.js')();