meadow 1.1.1 → 2.0.1
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/code-server/config.yaml +4 -0
- package/.config/configstore/update-notifier-npm-check-updates.json +4 -0
- package/.config/configstore/update-notifier-npm.json +4 -0
- package/.config/luxury-extras/.vscode/launch.json +46 -0
- package/.config/luxury-extras/Dockerfile +32 -0
- package/.config/luxury-extras/MySQL/Dockerfile +51 -0
- package/.config/luxury-extras/MySQL/MySQL-Laden-Entry.sh +17 -0
- package/.config/luxury-extras/MySQL/MySQL-Security.sql +5 -0
- package/.config/luxury-extras/model/ddl/BookStore.ddl +66 -0
- package/.config/luxury-extras/model/documentation/Dictionary.md +18 -0
- package/.config/luxury-extras/model/documentation/Model-Author.md +20 -0
- package/.config/luxury-extras/model/documentation/Model-Book.md +26 -0
- package/.config/luxury-extras/model/documentation/Model-BookAuthorJoin.md +14 -0
- package/.config/luxury-extras/model/documentation/Model-BookPrice.md +25 -0
- package/.config/luxury-extras/model/documentation/Model-Review.md +22 -0
- package/.config/luxury-extras/model/documentation/ModelChangeTracking.md +17 -0
- package/.config/luxury-extras/model/documentation/README.md +1 -0
- package/.config/luxury-extras/model/documentation/diagram/README.md +1 -0
- package/.config/luxury-extras/model/documentation/diagram/Stricture_Output.dot +13 -0
- package/.config/luxury-extras/model/documentation/diagram/Stricture_Output.png +0 -0
- package/.config/luxury-extras/model/generated_diagram/README.md +1 -0
- package/.config/luxury-extras/model/generated_diagram/Stricture_Output.dot +13 -0
- package/.config/luxury-extras/model/generated_diagram/Stricture_Output.png +0 -0
- package/.config/luxury-extras/model/generated_documentation/Dictionary.md +18 -0
- package/.config/luxury-extras/model/generated_documentation/Model-Author.md +20 -0
- package/.config/luxury-extras/model/generated_documentation/Model-Book.md +26 -0
- package/.config/luxury-extras/model/generated_documentation/Model-BookAuthorJoin.md +14 -0
- package/.config/luxury-extras/model/generated_documentation/Model-BookPrice.md +25 -0
- package/.config/luxury-extras/model/generated_documentation/Model-Review.md +22 -0
- package/.config/luxury-extras/model/generated_documentation/ModelChangeTracking.md +17 -0
- package/.config/luxury-extras/model/generated_documentation/README.md +1 -0
- package/.config/luxury-extras/model/json_schema/BookStore-Extended.json +915 -0
- package/.config/luxury-extras/model/json_schema/BookStore-PICT.json +1 -0
- package/.config/luxury-extras/model/json_schema/BookStore.json +280 -0
- package/.config/luxury-extras/model/json_schema/README.md +1 -0
- package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-Author.json +220 -0
- package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-Book.json +268 -0
- package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-BookAuthorJoin.json +172 -0
- package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-BookPrice.json +260 -0
- package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-Review.json +236 -0
- package/.config/luxury-extras/model/json_schema_entities/README.md +1 -0
- package/.config/luxury-extras/model/json_schema_model/BookStore-Extended.json +915 -0
- package/.config/luxury-extras/model/json_schema_model/BookStore-PICT.json +1 -0
- package/.config/luxury-extras/model/json_schema_model/BookStore.json +280 -0
- package/.config/luxury-extras/model/json_schema_model/README.md +1 -0
- package/.config/luxury-extras/model/manual_scripts/DropTables.sql +5 -0
- package/.config/luxury-extras/model/manual_scripts/README.md +2 -0
- package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-Author.json +220 -0
- package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-Book.json +268 -0
- package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-BookAuthorJoin.json +172 -0
- package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-BookPrice.json +260 -0
- package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-Review.json +236 -0
- package/.config/luxury-extras/model/meadow_schema/README.md +1 -0
- package/.config/luxury-extras/model/mysql_create/BookStore-CreateDatabase.mysql.sql +116 -0
- package/.config/luxury-extras/model/mysql_create/README.md +1 -0
- package/.config/luxury-extras/model/sql_create/BookStore-CreateDatabase.mysql.sql +116 -0
- package/.config/luxury-extras/model/sql_create/README.md +1 -0
- package/.vscode/launch.json +46 -0
- package/Dockerfile_LUXURYCode +65 -0
- package/README.md +19 -5
- package/debug/Harness.js +69 -84
- package/dist/meadow.js +1669 -0
- package/dist/meadow.min.js +65 -0
- package/dist/meadow.min.js.map +1 -0
- package/gulpfile.js +83 -0
- package/package.json +42 -20
- package/source/Meadow-Browser-Shim.js +14 -0
- package/source/{Meadow-PackageLoader.js → Meadow-PackageFileLoader.js} +3 -3
- package/source/Meadow-PackageObjectLoader.js +62 -0
- package/source/Meadow.js +21 -3
- package/source/behaviors/Meadow-Count.js +2 -2
- package/source/behaviors/Meadow-Create.js +3 -4
- package/source/behaviors/Meadow-Delete.js +2 -2
- package/source/behaviors/Meadow-Read.js +5 -4
- package/source/behaviors/Meadow-Reads.js +4 -3
- package/source/behaviors/Meadow-Undelete.js +42 -0
- package/source/behaviors/Meadow-Update.js +2 -2
- package/source/providers/Meadow-Provider-ALASQL.js +33 -0
- package/source/providers/Meadow-Provider-MeadowEndpoints.js +3 -4
- package/source/providers/Meadow-Provider-MySQL.js +40 -0
- package/source/providers/Meadow-Provider-None.js +8 -0
- package/test/Meadow-Provider-ALASQL.js +38 -14
- package/test/Meadow-Provider-MeadowEndpoints_tests.js +2 -819
- package/test/Meadow-Provider-MySQL_tests.js +49 -13
- package/test/Meadow-Provider-None_tests.js +19 -16
- package/test/Meadow_tests.js +59 -2
package/debug/Harness.js
CHANGED
|
@@ -1,94 +1,79 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
const _AnimalJsonSchema = (
|
|
3
|
+
{
|
|
4
|
+
title: "Animal",
|
|
5
|
+
description: "A creature that lives in a meadow.",
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
IDAnimal: {
|
|
9
|
+
description: "The unique identifier for an animal",
|
|
10
|
+
type: "integer"
|
|
11
|
+
},
|
|
12
|
+
Name: {
|
|
13
|
+
description: "The animal's name",
|
|
14
|
+
type: "string"
|
|
15
|
+
},
|
|
16
|
+
Type: {
|
|
17
|
+
description: "The type of the animal",
|
|
18
|
+
type: "string"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
required: ["IDAnimal", "Name", "CreatingIDUser"]
|
|
22
|
+
});
|
|
23
|
+
const _AnimalSchema = (
|
|
24
|
+
[
|
|
25
|
+
{ Column: "IDAnimal", Type:"AutoIdentity" },
|
|
26
|
+
{ Column: "GUIDAnimal", Type:"AutoGUID" },
|
|
27
|
+
{ Column: "CreateDate", Type:"CreateDate" },
|
|
28
|
+
{ Column: "CreatingIDUser", Type:"CreateIDUser" },
|
|
29
|
+
{ Column: "UpdateDate", Type:"UpdateDate" },
|
|
30
|
+
{ Column: "UpdatingIDUser", Type:"UpdateIDUser" },
|
|
31
|
+
{ Column: "Deleted", Type:"Deleted" },
|
|
32
|
+
{ Column: "DeletingIDUser", Type:"DeleteIDUser" },
|
|
33
|
+
{ Column: "DeleteDate", Type:"DeleteDate" },
|
|
34
|
+
{ "Column": "Name", "Type":"String" },
|
|
35
|
+
{ "Column": "Type", "Type":"String" }
|
|
36
|
+
]);
|
|
37
|
+
const _AnimalDefault = (
|
|
38
|
+
{
|
|
39
|
+
IDAnimal: null,
|
|
40
|
+
GUIDAnimal: '',
|
|
41
|
+
|
|
42
|
+
CreateDate: false,
|
|
43
|
+
CreatingIDUser: 0,
|
|
44
|
+
UpdateDate: false,
|
|
45
|
+
UpdatingIDUser: 0,
|
|
46
|
+
Deleted: 0,
|
|
47
|
+
DeleteDate: false,
|
|
48
|
+
DeletingIDUser: 0,
|
|
49
|
+
|
|
50
|
+
Name: 'Unknown',
|
|
51
|
+
Type: 'Unclassified'
|
|
52
|
+
});
|
|
53
|
+
var libALASQL = require('alasql');
|
|
3
54
|
|
|
4
|
-
|
|
5
|
-
{
|
|
55
|
+
const libFable = new (require('fable'))({
|
|
6
56
|
LogStreams:
|
|
7
57
|
[
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
58
|
+
{
|
|
59
|
+
streamtype:'default',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
streamtype: 'simpleflatfile',
|
|
63
|
+
path: __dirname+'/Harness.log'
|
|
64
|
+
}
|
|
16
65
|
]
|
|
17
66
|
});
|
|
18
67
|
|
|
19
|
-
|
|
20
|
-
var libMeadow = require('../source/Meadow.js').new(libFable);
|
|
21
|
-
|
|
22
|
-
var _BookSchemaLocation = '../test/schemas/BookStore-MeadowSchema-Book.json';
|
|
23
|
-
|
|
24
|
-
var newMeadow = function()
|
|
25
|
-
{
|
|
26
|
-
return libMeadow.loadFromPackage(_BookSchemaLocation)
|
|
27
|
-
.setProvider('MeadowEndpoints');
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
var testMeadow = newMeadow();
|
|
31
|
-
|
|
32
|
-
testMeadow.fable.settings.QueryThresholdWarnTime = 1;
|
|
33
|
-
|
|
34
|
-
/* READ
|
|
35
|
-
var tmpQuery = testMeadow.setProvider('MeadowEndpoints').query.addFilter('IDBook', 1);
|
|
36
|
-
tmpQuery.addFilter('PublicationYear',2008);
|
|
37
|
-
testMeadow.doRead(tmpQuery,
|
|
38
|
-
function(pError, pQuery, pRecord)
|
|
39
|
-
{
|
|
40
|
-
console.log(JSON.stringify(pRecord));
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/* CREATE
|
|
46
|
-
var testMeadow = newMeadow();
|
|
47
|
-
var tmpQuery = testMeadow.query.clone().setLogLevel(5)
|
|
48
|
-
.addRecord({Title:'Blastoise', Type:'Pokemon'});
|
|
49
|
-
|
|
50
|
-
testMeadow.doCreate(tmpQuery,
|
|
51
|
-
function(pError, pQuery, pQueryRead, pRecord)
|
|
52
|
-
{
|
|
53
|
-
libFable.log.info('Record returned from Create:',pRecord);
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
/* UPDATE
|
|
59
|
-
var testMeadow = newMeadow();
|
|
60
|
-
var tmpQuery = testMeadow.query.setLogLevel(5)
|
|
61
|
-
.addRecord({IDBook:10001, Type:'Novella'});
|
|
62
|
-
|
|
63
|
-
testMeadow.doUpdate(tmpQuery,
|
|
64
|
-
function(pError, pQuery, pQueryRead, pRecord)
|
|
65
|
-
{
|
|
66
|
-
libFable.log.info('Record returned:',pRecord);
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
/* DELETE
|
|
72
|
-
var testMeadow = newMeadow();
|
|
73
|
-
var tmpQuery = testMeadow.query.clone().setLogLevel(5)
|
|
74
|
-
.addFilter('IDBook',10005);
|
|
68
|
+
libFable.ALASQL = libALASQL;
|
|
75
69
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
)
|
|
82
|
-
|
|
70
|
+
const tmpDAL = require('../source/Meadow.js')
|
|
71
|
+
.new(libFable, 'Animal')
|
|
72
|
+
.setProvider('ALASQL')
|
|
73
|
+
.setSchema(_AnimalSchema)
|
|
74
|
+
.setJsonSchema(_AnimalJsonSchema)
|
|
75
|
+
.setDefaultIdentifier('IDAnimal')
|
|
76
|
+
.setDefault(_AnimalDefault);
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
*/
|
|
78
|
+
tmpDAL.fable.settings.QueryThresholdWarnTime = 1;
|
|
86
79
|
|
|
87
|
-
var testMeadow = newMeadow();
|
|
88
|
-
var tmpQuery = testMeadow.query.clone().addFilter('Type','Pokemon');
|
|
89
|
-
testMeadow.doCount(tmpQuery,
|
|
90
|
-
function(pError, pQuery, pResponse)
|
|
91
|
-
{
|
|
92
|
-
libFable.log.info('Record count returned:', pResponse);
|
|
93
|
-
}
|
|
94
|
-
)
|