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.
Files changed (86) hide show
  1. package/.config/code-server/config.yaml +4 -0
  2. package/.config/configstore/update-notifier-npm-check-updates.json +4 -0
  3. package/.config/configstore/update-notifier-npm.json +4 -0
  4. package/.config/luxury-extras/.vscode/launch.json +46 -0
  5. package/.config/luxury-extras/Dockerfile +32 -0
  6. package/.config/luxury-extras/MySQL/Dockerfile +51 -0
  7. package/.config/luxury-extras/MySQL/MySQL-Laden-Entry.sh +17 -0
  8. package/.config/luxury-extras/MySQL/MySQL-Security.sql +5 -0
  9. package/.config/luxury-extras/model/ddl/BookStore.ddl +66 -0
  10. package/.config/luxury-extras/model/documentation/Dictionary.md +18 -0
  11. package/.config/luxury-extras/model/documentation/Model-Author.md +20 -0
  12. package/.config/luxury-extras/model/documentation/Model-Book.md +26 -0
  13. package/.config/luxury-extras/model/documentation/Model-BookAuthorJoin.md +14 -0
  14. package/.config/luxury-extras/model/documentation/Model-BookPrice.md +25 -0
  15. package/.config/luxury-extras/model/documentation/Model-Review.md +22 -0
  16. package/.config/luxury-extras/model/documentation/ModelChangeTracking.md +17 -0
  17. package/.config/luxury-extras/model/documentation/README.md +1 -0
  18. package/.config/luxury-extras/model/documentation/diagram/README.md +1 -0
  19. package/.config/luxury-extras/model/documentation/diagram/Stricture_Output.dot +13 -0
  20. package/.config/luxury-extras/model/documentation/diagram/Stricture_Output.png +0 -0
  21. package/.config/luxury-extras/model/generated_diagram/README.md +1 -0
  22. package/.config/luxury-extras/model/generated_diagram/Stricture_Output.dot +13 -0
  23. package/.config/luxury-extras/model/generated_diagram/Stricture_Output.png +0 -0
  24. package/.config/luxury-extras/model/generated_documentation/Dictionary.md +18 -0
  25. package/.config/luxury-extras/model/generated_documentation/Model-Author.md +20 -0
  26. package/.config/luxury-extras/model/generated_documentation/Model-Book.md +26 -0
  27. package/.config/luxury-extras/model/generated_documentation/Model-BookAuthorJoin.md +14 -0
  28. package/.config/luxury-extras/model/generated_documentation/Model-BookPrice.md +25 -0
  29. package/.config/luxury-extras/model/generated_documentation/Model-Review.md +22 -0
  30. package/.config/luxury-extras/model/generated_documentation/ModelChangeTracking.md +17 -0
  31. package/.config/luxury-extras/model/generated_documentation/README.md +1 -0
  32. package/.config/luxury-extras/model/json_schema/BookStore-Extended.json +915 -0
  33. package/.config/luxury-extras/model/json_schema/BookStore-PICT.json +1 -0
  34. package/.config/luxury-extras/model/json_schema/BookStore.json +280 -0
  35. package/.config/luxury-extras/model/json_schema/README.md +1 -0
  36. package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-Author.json +220 -0
  37. package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-Book.json +268 -0
  38. package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-BookAuthorJoin.json +172 -0
  39. package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-BookPrice.json +260 -0
  40. package/.config/luxury-extras/model/json_schema_entities/BookStore-MeadowSchema-Review.json +236 -0
  41. package/.config/luxury-extras/model/json_schema_entities/README.md +1 -0
  42. package/.config/luxury-extras/model/json_schema_model/BookStore-Extended.json +915 -0
  43. package/.config/luxury-extras/model/json_schema_model/BookStore-PICT.json +1 -0
  44. package/.config/luxury-extras/model/json_schema_model/BookStore.json +280 -0
  45. package/.config/luxury-extras/model/json_schema_model/README.md +1 -0
  46. package/.config/luxury-extras/model/manual_scripts/DropTables.sql +5 -0
  47. package/.config/luxury-extras/model/manual_scripts/README.md +2 -0
  48. package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-Author.json +220 -0
  49. package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-Book.json +268 -0
  50. package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-BookAuthorJoin.json +172 -0
  51. package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-BookPrice.json +260 -0
  52. package/.config/luxury-extras/model/meadow_schema/BookStore-MeadowSchema-Review.json +236 -0
  53. package/.config/luxury-extras/model/meadow_schema/README.md +1 -0
  54. package/.config/luxury-extras/model/mysql_create/BookStore-CreateDatabase.mysql.sql +116 -0
  55. package/.config/luxury-extras/model/mysql_create/README.md +1 -0
  56. package/.config/luxury-extras/model/sql_create/BookStore-CreateDatabase.mysql.sql +116 -0
  57. package/.config/luxury-extras/model/sql_create/README.md +1 -0
  58. package/.vscode/launch.json +46 -0
  59. package/Dockerfile_LUXURYCode +65 -0
  60. package/README.md +19 -5
  61. package/debug/Harness.js +69 -84
  62. package/dist/meadow.js +1669 -0
  63. package/dist/meadow.min.js +65 -0
  64. package/dist/meadow.min.js.map +1 -0
  65. package/gulpfile.js +83 -0
  66. package/package.json +42 -20
  67. package/source/Meadow-Browser-Shim.js +14 -0
  68. package/source/{Meadow-PackageLoader.js → Meadow-PackageFileLoader.js} +3 -3
  69. package/source/Meadow-PackageObjectLoader.js +62 -0
  70. package/source/Meadow.js +21 -3
  71. package/source/behaviors/Meadow-Count.js +2 -2
  72. package/source/behaviors/Meadow-Create.js +3 -4
  73. package/source/behaviors/Meadow-Delete.js +2 -2
  74. package/source/behaviors/Meadow-Read.js +5 -4
  75. package/source/behaviors/Meadow-Reads.js +4 -3
  76. package/source/behaviors/Meadow-Undelete.js +42 -0
  77. package/source/behaviors/Meadow-Update.js +2 -2
  78. package/source/providers/Meadow-Provider-ALASQL.js +33 -0
  79. package/source/providers/Meadow-Provider-MeadowEndpoints.js +3 -4
  80. package/source/providers/Meadow-Provider-MySQL.js +40 -0
  81. package/source/providers/Meadow-Provider-None.js +8 -0
  82. package/test/Meadow-Provider-ALASQL.js +38 -14
  83. package/test/Meadow-Provider-MeadowEndpoints_tests.js +2 -819
  84. package/test/Meadow-Provider-MySQL_tests.js +49 -13
  85. package/test/Meadow-Provider-None_tests.js +19 -16
  86. package/test/Meadow_tests.js +59 -2
package/debug/Harness.js CHANGED
@@ -1,94 +1,79 @@
1
1
 
2
- var libMeadow = require('../source/Meadow.js');
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
- var tmpFableSettings = (
5
- {
55
+ const libFable = new (require('fable'))({
6
56
  LogStreams:
7
57
  [
8
- {
9
- level: 'trace',
10
- streamtype:'process.stdout',
11
- },
12
- {
13
- level: 'trace',
14
- path: __dirname+'/../tests.log'
15
- }
58
+ {
59
+ streamtype:'default',
60
+ },
61
+ {
62
+ streamtype: 'simpleflatfile',
63
+ path: __dirname+'/Harness.log'
64
+ }
16
65
  ]
17
66
  });
18
67
 
19
- var libFable = require('fable').new(tmpFableSettings);
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
- testMeadow.doDelete(tmpQuery,
77
- function(pError, pQuery, pResponse)
78
- {
79
- libFable.log.info('Affected record count returned:',pResponse);
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
- /* COUNT
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
- )