fable 3.0.97 → 3.0.98
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 +12 -12
- package/dist/fable.compatible.min.js +2 -2
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +11 -11
- package/dist/fable.min.js +2 -2
- package/dist/fable.min.js.map +1 -1
- package/package.json +3 -3
- package/source/services/Fable-Service-Anticipate.js +2 -0
- package/source/services/Fable-Service-MetaTemplate/MetaTemplate-StringParser.js +19 -12
- package/source/services/Fable-Service-MetaTemplate.js +1 -1
- package/retold-harness/bookstore-serve-api.js +0 -41
- package/retold-harness/configuration-bookstore-serve-api.js +0 -30
- package/retold-harness/docker_scripts/MySQL-Laden-Entry.sh +0 -17
- package/retold-harness/model/Model-Extended.json +0 -915
- package/retold-harness/model/Model-PICT.json +0 -1
- package/retold-harness/model/Model.json +0 -280
- package/retold-harness/model/bookstore-api-endpoint-exercises.paw +0 -0
- package/retold-harness/model/ddl/BookStore.ddl +0 -66
- package/retold-harness/model/generated_diagram/README.md +0 -1
- package/retold-harness/model/generated_diagram/Stricture_Output.dot +0 -13
- package/retold-harness/model/generated_diagram/Stricture_Output.png +0 -0
- package/retold-harness/model/generated_documentation/Dictionary.md +0 -18
- package/retold-harness/model/generated_documentation/Model-Author.md +0 -20
- package/retold-harness/model/generated_documentation/Model-Book.md +0 -26
- package/retold-harness/model/generated_documentation/Model-BookAuthorJoin.md +0 -14
- package/retold-harness/model/generated_documentation/Model-BookPrice.md +0 -25
- package/retold-harness/model/generated_documentation/Model-Review.md +0 -22
- package/retold-harness/model/generated_documentation/ModelChangeTracking.md +0 -17
- package/retold-harness/model/generated_documentation/README.md +0 -1
- package/retold-harness/model/manual_scripts/DropTables.sql +0 -5
- package/retold-harness/model/manual_scripts/MySQL-Laden-Entry.sh +0 -17
- package/retold-harness/model/manual_scripts/MySQL-Security.sql +0 -5
- package/retold-harness/model/manual_scripts/README.md +0 -2
- package/retold-harness/model/manual_scripts/my.cnf +0 -4
- package/retold-harness/model/meadow/Model-MeadowSchema-Author.json +0 -220
- package/retold-harness/model/meadow/Model-MeadowSchema-Book.json +0 -268
- package/retold-harness/model/meadow/Model-MeadowSchema-BookAuthorJoin.json +0 -172
- package/retold-harness/model/meadow/Model-MeadowSchema-BookPrice.json +0 -260
- package/retold-harness/model/meadow/Model-MeadowSchema-Review.json +0 -236
- package/retold-harness/model/meadow/README.md +0 -1
- package/retold-harness/model/sql_create/BookStore-CreateDatabase.mysql.sql +0 -116
- package/retold-harness/model/sql_create/BookStore-DeleteAndRepopulateTables.sql +0 -194
- package/retold-harness/model/sql_create/MySQL-Security.sql +0 -5
- package/retold-harness/model/sql_create/README.md +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fable",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.98",
|
|
4
4
|
"description": "An entity behavior management and API bundling library.",
|
|
5
5
|
"main": "source/Fable.js",
|
|
6
6
|
"scripts": {
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://github.com/stevenvelozo/fable",
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"quackage": "^1.0.
|
|
53
|
+
"quackage": "^1.0.25"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"async.eachlimit": "^0.5.2",
|
|
57
57
|
"async.waterfall": "^0.5.2",
|
|
58
58
|
"big.js": "^6.2.1",
|
|
59
59
|
"cachetrax": "^1.0.4",
|
|
60
|
-
"cookie": "^0.
|
|
60
|
+
"cookie": "^0.6.0",
|
|
61
61
|
"data-arithmatic": "^1.0.7",
|
|
62
62
|
"dayjs": "^1.11.10",
|
|
63
63
|
"fable-log": "^3.0.13",
|
|
@@ -35,6 +35,7 @@ class FableServiceAnticipate extends libFableServiceBase
|
|
|
35
35
|
// If there are no operations left, and we have waiting functions, call them.
|
|
36
36
|
for (let i = 0; i < this.waitingFunctions.length; i++)
|
|
37
37
|
{
|
|
38
|
+
this.log.trace('Calling waiting function.')
|
|
38
39
|
this.waitingFunctions[i](this.lastError);
|
|
39
40
|
}
|
|
40
41
|
// Reset our state
|
|
@@ -46,6 +47,7 @@ class FableServiceAnticipate extends libFableServiceBase
|
|
|
46
47
|
// Expects a function fAsynchronousFunction(fCallback)
|
|
47
48
|
anticipate(fAsynchronousFunction)
|
|
48
49
|
{
|
|
50
|
+
this.log.trace('Adding a function...')
|
|
49
51
|
this.operationQueue.push(fAsynchronousFunction);
|
|
50
52
|
this.checkQueue();
|
|
51
53
|
}
|
|
@@ -9,9 +9,9 @@ class StringParser
|
|
|
9
9
|
/**
|
|
10
10
|
* StringParser Constructor
|
|
11
11
|
*/
|
|
12
|
-
constructor(
|
|
12
|
+
constructor(pFable)
|
|
13
13
|
{
|
|
14
|
-
this.
|
|
14
|
+
this.fable = pFable;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -206,7 +206,7 @@ class StringParser
|
|
|
206
206
|
|
|
207
207
|
pParserState.OutputBuffer = pAsyncOutput;
|
|
208
208
|
this.resetOutputBuffer(pParserState);
|
|
209
|
-
return
|
|
209
|
+
return fCallback();
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
212
|
else if (pParserState.Pattern.isAsync && pParserState.Pattern.isBoth)
|
|
@@ -222,7 +222,7 @@ class StringParser
|
|
|
222
222
|
|
|
223
223
|
pParserState.OutputBuffer = pAsyncOutput;
|
|
224
224
|
this.resetOutputBuffer(pParserState);
|
|
225
|
-
return
|
|
225
|
+
return fCallback();
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
else
|
|
@@ -230,7 +230,7 @@ class StringParser
|
|
|
230
230
|
// Run the t*mplate function
|
|
231
231
|
pParserState.OutputBuffer = pParserState.Pattern.Parse(pParserState.OutputBuffer.substr(pParserState.Pattern.PatternStartString.length, pParserState.OutputBuffer.length - (pParserState.Pattern.PatternStartString.length+pParserState.Pattern.PatternEndString.length)), pData);
|
|
232
232
|
this.resetOutputBuffer(pParserState);
|
|
233
|
-
return
|
|
233
|
+
return fCallback();
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -360,18 +360,25 @@ class StringParser
|
|
|
360
360
|
let tmpParserState = this.newParserState(pParseTree);
|
|
361
361
|
tmpParserState.Asynchronous = true;
|
|
362
362
|
|
|
363
|
-
this.
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
363
|
+
let tmpAnticipate = this.fable.instantiateServiceProviderWithoutRegistration('Anticipate');
|
|
364
|
+
|
|
365
|
+
for (let i = 0; i < pString.length; i++)
|
|
366
|
+
{
|
|
367
|
+
tmpAnticipate.anticipate(
|
|
368
|
+
(fCallback) =>
|
|
369
|
+
{
|
|
370
|
+
console.log(`Running template for character [${pString[i]}] index ${i}`);
|
|
371
|
+
this.parseCharacterAsync(pString[i], tmpParserState, pData, fCallback);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
tmpAnticipate.wait(
|
|
368
376
|
(pError) =>
|
|
369
377
|
{
|
|
370
378
|
// Flush the remaining data
|
|
371
379
|
this.flushOutputBuffer(tmpParserState);
|
|
372
|
-
fCallback(pError, tmpParserState.Output);
|
|
380
|
+
return fCallback(pError, tmpParserState.Output);
|
|
373
381
|
});
|
|
374
|
-
|
|
375
382
|
}
|
|
376
383
|
}
|
|
377
384
|
}
|
|
@@ -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
|
|
23
|
+
this.StringParser = new libStringParser(this.fable);
|
|
24
24
|
|
|
25
25
|
this.ParseTree = this.WordTree.ParseTree;
|
|
26
26
|
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const _Settings = require('./configuration-bookstore-serve-api.js');
|
|
2
|
-
|
|
3
|
-
const libFable = require('fable');
|
|
4
|
-
|
|
5
|
-
_Fable = new libFable(_Settings);
|
|
6
|
-
_Fable.addServiceType('RetoldDataService', require('retold-data-service'));
|
|
7
|
-
// The RetoldDataService defaults to process.cwd() but we want to run this from wherever.
|
|
8
|
-
_Fable.instantiateServiceProvider('RetoldDataService',
|
|
9
|
-
{
|
|
10
|
-
"FullMeadowSchemaPath": `${__dirname}/model/`,
|
|
11
|
-
"DALMeadowSchemaPath": `${__dirname}/model/meadow/`
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
_Fable.MeadowEndpoints.Book.controller.BehaviorInjection.setBehavior('Read-PostOperation',
|
|
15
|
-
(pRequest, pRequestState, fComplete) =>
|
|
16
|
-
{
|
|
17
|
-
// Get the join records
|
|
18
|
-
_Fable.DAL.BookAuthorJoin.doReads(_Fable.DAL.BookAuthorJoin.query.addFilter('IDBook', pRequestState.Record.IDBook),
|
|
19
|
-
(pJoinReadError, pJoinReadQuery, pJoinRecords)=>
|
|
20
|
-
{
|
|
21
|
-
let tmpAuthorList = [];
|
|
22
|
-
for (let j = 0; j < pJoinRecords.length; j++)
|
|
23
|
-
{
|
|
24
|
-
tmpAuthorList.push(pJoinRecords[j].IDAuthor);
|
|
25
|
-
}
|
|
26
|
-
if (tmpAuthorList.length < 1)
|
|
27
|
-
{
|
|
28
|
-
pRequestState.Record.Authors = [];
|
|
29
|
-
return fComplete();
|
|
30
|
-
}
|
|
31
|
-
else
|
|
32
|
-
{
|
|
33
|
-
_Fable.DAL.Author.doReads(_Fable.DAL.Author.query.addFilter('IDAuthor', tmpAuthorList, 'IN'),
|
|
34
|
-
(pReadsError, pReadsQuery, pAuthors)=>
|
|
35
|
-
{
|
|
36
|
-
pRequestState.Record.Authors = pAuthors;
|
|
37
|
-
return fComplete();
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports = (
|
|
2
|
-
{
|
|
3
|
-
"Product": "MeadowEndpointsTestBookStore",
|
|
4
|
-
"ProductVersion": "1.0.0",
|
|
5
|
-
|
|
6
|
-
"UUID":
|
|
7
|
-
{
|
|
8
|
-
"DataCenter": 0,
|
|
9
|
-
"Worker": 0
|
|
10
|
-
},
|
|
11
|
-
"LogStreams":
|
|
12
|
-
[
|
|
13
|
-
{
|
|
14
|
-
"streamtype": "console"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
|
|
18
|
-
"APIServerPort": 8086,
|
|
19
|
-
|
|
20
|
-
"MySQL":
|
|
21
|
-
{
|
|
22
|
-
"Server": "127.0.0.1",
|
|
23
|
-
"Port": 3306,
|
|
24
|
-
"User": "root",
|
|
25
|
-
"Password": "123456789",
|
|
26
|
-
"Database": "bookstore",
|
|
27
|
-
"ConnectionPoolLimit": 20
|
|
28
|
-
},
|
|
29
|
-
"MeadowConnectionMySQLAutoConnect": true
|
|
30
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
trap 'kill -TERM $PID' TERM INT
|
|
4
|
-
|
|
5
|
-
/usr/bin/entrypoint.sh --bind-addr "0.0.0.0:8080" . &
|
|
6
|
-
|
|
7
|
-
PID=$!
|
|
8
|
-
|
|
9
|
-
sleep 2
|
|
10
|
-
|
|
11
|
-
sudo service mariadb restart
|
|
12
|
-
|
|
13
|
-
wait $PID
|
|
14
|
-
trap - TERM INT
|
|
15
|
-
wait $PID
|
|
16
|
-
EXIT_STATUS=$?
|
|
17
|
-
echo "Service exited with status ${EXIT_STATUS}"
|