fable 3.0.36 → 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.
- package/.config/configstore/update-notifier-npm.json +1 -1
- package/.config/vscode-sqltools/runningInfo.json +1 -1
- package/Dockerfile_LUXURYCode +6 -8
- package/debug/Harness.js +3 -4
- package/package.json +2 -2
- package/retold-harness/bookstore-api-endpoint-exercises.paw +0 -0
- package/retold-harness/bookstore-serve-meadow-endpoint-apis-run.js +6 -0
- package/{.config/retold-harness → retold-harness}/bookstore-serve-meadow-endpoint-apis.js +4 -1
- package/{.config/retold-harness → retold-harness}/package.json +2 -0
- package/source/services/Fable-Service-RestClient.js +130 -26
- package/test/RestClient_test.js +69 -3
- package/.config/retold-harness/bookstore-api-endpoint-exercises.paw +0 -0
- /package/{.config/retold-harness → retold-harness}/Bookstore-Import-Books.sh +0 -0
- /package/{.config/retold-harness → retold-harness}/MySQL-Laden-Entry.sh +0 -0
- /package/{.config/retold-harness → retold-harness}/MySQL-Security.sql +0 -0
- /package/{.config/retold-harness → retold-harness}/bookstore-configuration.json +0 -0
- /package/{.config/retold-harness → retold-harness}/bookstore-import-books-run.js +0 -0
- /package/{.config/retold-harness → retold-harness}/bookstore-import-books.js +0 -0
- /package/{.config/retold-harness → retold-harness}/bookstore-serve-meadow-endpoint-apis-IPC.js +0 -0
- /package/{.config/retold-harness → retold-harness}/data/books.csv +0 -0
- /package/{.config/retold-harness → retold-harness}/model/ddl/BookStore.ddl +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_diagram/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_diagram/Stricture_Output.dot +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_diagram/Stricture_Output.png +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Dictionary.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Author.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Book.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-BookAuthorJoin.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-BookPrice.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Review.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/ModelChangeTracking.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/generated_documentation/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore-Extended.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore-PICT.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/json_schema/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/manual_scripts/DropTables.sql +0 -0
- /package/{.config/retold-harness → retold-harness}/model/manual_scripts/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Author.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Book.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-BookAuthorJoin.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-BookPrice.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/BookStore-MeadowSchema-Review.json +0 -0
- /package/{.config/retold-harness → retold-harness}/model/meadow_schema/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/model/sql_create/BookStore-CreateDatabase.mysql.sql +0 -0
- /package/{.config/retold-harness → retold-harness}/model/sql_create/README.md +0 -0
- /package/{.config/retold-harness → retold-harness}/test_old/Tests.js +0 -0
- /package/{.config/retold-harness → retold-harness}/test_old/untitled.js +0 -0
package/Dockerfile_LUXURYCode
CHANGED
|
@@ -56,12 +56,12 @@ RUN code-server --install-extension mtxr.sqltools-driver-mysql
|
|
|
56
56
|
|
|
57
57
|
RUN echo "...configuring mariadb (mysql) server...."
|
|
58
58
|
RUN sudo sed -i "s|bind-address|#bind-address|g" /etc/mysql/mariadb.conf.d/50-server.cnf
|
|
59
|
-
ADD
|
|
60
|
-
ADD
|
|
59
|
+
ADD ./retold-harness/MySQL-Security.sql /home/coder/MySQL-Configure-Security.sql
|
|
60
|
+
ADD ./retold-harness/MySQL-Laden-Entry.sh /usr/bin/MySQL-Laden-Entry.sh
|
|
61
61
|
RUN ( sudo mysqld_safe --skip-grant-tables --skip-networking & ) && sleep 5 && mysql -u root < /home/coder/MySQL-Configure-Security.sql
|
|
62
62
|
|
|
63
63
|
# Import the initial database
|
|
64
|
-
COPY
|
|
64
|
+
COPY ./retold-harness/model/sql_create/BookStore-CreateDatabase.mysql.sql /home/coder/MySQL-Create-Databases.sql
|
|
65
65
|
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" -e "CREATE DATABASE bookstore;"
|
|
66
66
|
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" bookstore < /home/coder/MySQL-Create-Databases.sql
|
|
67
67
|
|
|
@@ -82,11 +82,9 @@ RUN echo "...installing node version 14 as the default..."
|
|
|
82
82
|
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm install 14
|
|
83
83
|
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && nvm alias default 14
|
|
84
84
|
|
|
85
|
-
WORKDIR /home/coder/fable/.config/retold-harness
|
|
86
|
-
|
|
87
|
-
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && npm install
|
|
88
|
-
# RUN ./Bookstore-Import-Books.sh
|
|
89
|
-
|
|
90
85
|
WORKDIR /home/coder/fable
|
|
91
86
|
|
|
87
|
+
# RUN . ~/.nvm/nvm.sh && source ~/.bashrc && npm install
|
|
88
|
+
# RUN . /home/coder/fable/retold-harness/Bookstore-Import-Books.sh
|
|
89
|
+
|
|
92
90
|
ENTRYPOINT ["/usr/bin/MySQL-Laden-Entry.sh"]
|
package/debug/Harness.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
let libBookstore = require('../retold-harness/bookstore-serve-meadow-endpoint-apis-run.js');
|
|
2
|
+
/*
|
|
1
3
|
const libFable = require('../source/Fable.js');
|
|
2
4
|
|
|
3
5
|
class SimpleService extends libFable.ServiceProviderBase
|
|
@@ -39,7 +41,4 @@ tmpRestClient.getJSON('https://en.wiktionary.org/w/api.php?action=parse&prop=wik
|
|
|
39
41
|
{
|
|
40
42
|
testFable.log.info('Response received!');
|
|
41
43
|
});
|
|
42
|
-
|
|
43
|
-
var fable = new libFable();
|
|
44
|
-
|
|
45
|
-
fable.log.info('What are you doing, Dave?', {SomeColorSetting: 'Red', CurrentFolder: __dirname });
|
|
44
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fable",
|
|
3
|
-
"version": "3.0.
|
|
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,
|
|
Binary file
|
|
@@ -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.
|
|
86
|
+
_MeadowEndpoints.Book.behaviorModifications.setBehavior('Read-PostOperation',
|
|
84
87
|
(pRequest, pRequestState, fComplete) =>
|
|
85
88
|
{
|
|
86
89
|
// Get the join records
|
|
@@ -4,6 +4,7 @@
|
|
|
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": "",
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
"meadow-endpoints": "^3.0.7",
|
|
16
17
|
"mysql2": "^3.3.0",
|
|
17
18
|
"orator": "^3.0.11",
|
|
19
|
+
"orator-serviceserver-restify": "^1.0.4",
|
|
18
20
|
"papaparse": "^5.4.1"
|
|
19
21
|
}
|
|
20
22
|
}
|
|
@@ -19,64 +19,88 @@ class FableServiceRestClient extends libFableServiceBase
|
|
|
19
19
|
this.serviceType = 'RestClient';
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
executeChunkedRequest(pOptions, fCallback)
|
|
23
23
|
{
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
36
|
+
return fCallback(pError, pResponse);
|
|
30
37
|
}
|
|
31
38
|
|
|
32
|
-
if (
|
|
39
|
+
if (this.TraceLog)
|
|
33
40
|
{
|
|
34
|
-
|
|
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
|
-
|
|
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
|
-
|
|
70
|
+
executeJSONRequest(pOptions, fCallback)
|
|
42
71
|
{
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
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
|
|
81
|
+
return libSimpleGet(pOptions,
|
|
57
82
|
(pError, pResponse)=>
|
|
58
83
|
{
|
|
59
84
|
if (pError)
|
|
60
85
|
{
|
|
61
|
-
return fCallback(pError, pResponse
|
|
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(`-->
|
|
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
|
-
|
|
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(`-->
|
|
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
|
-
|
|
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(`==>
|
|
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;
|
package/test/RestClient_test.js
CHANGED
|
@@ -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('
|
|
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('
|
|
46
|
-
Expect(pBody.
|
|
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
|
}
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/bookstore-serve-meadow-endpoint-apis-IPC.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/model/generated_diagram/Stricture_Output.dot
RENAMED
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/model/generated_diagram/Stricture_Output.png
RENAMED
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/model/generated_documentation/Dictionary.md
RENAMED
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Author.md
RENAMED
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Book.md
RENAMED
|
File without changes
|
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-BookPrice.md
RENAMED
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/model/generated_documentation/Model-Review.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{.config/retold-harness → retold-harness}/model/json_schema/BookStore-Extended.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|