retold-facto 0.0.4

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 (92) hide show
  1. package/.claude/launch.json +11 -0
  2. package/.dockerignore +8 -0
  3. package/.quackage.json +19 -0
  4. package/Dockerfile +26 -0
  5. package/bin/retold-facto.js +909 -0
  6. package/examples/facto-government-data.sqlite +0 -0
  7. package/examples/government-data-catalog.json +137 -0
  8. package/examples/government-data-loader.js +1432 -0
  9. package/package.json +91 -0
  10. package/scripts/facto-download.js +425 -0
  11. package/source/Retold-Facto.js +1042 -0
  12. package/source/services/Retold-Facto-BeaconProvider.js +511 -0
  13. package/source/services/Retold-Facto-CatalogManager.js +1252 -0
  14. package/source/services/Retold-Facto-DataLakeService.js +1642 -0
  15. package/source/services/Retold-Facto-DatasetManager.js +417 -0
  16. package/source/services/Retold-Facto-IngestEngine.js +1315 -0
  17. package/source/services/Retold-Facto-ProjectionEngine.js +3960 -0
  18. package/source/services/Retold-Facto-RecordManager.js +360 -0
  19. package/source/services/Retold-Facto-SchemaManager.js +1110 -0
  20. package/source/services/Retold-Facto-SourceFolderScanner.js +2243 -0
  21. package/source/services/Retold-Facto-SourceManager.js +730 -0
  22. package/source/services/Retold-Facto-StoreConnectionManager.js +441 -0
  23. package/source/services/Retold-Facto-ThroughputMonitor.js +478 -0
  24. package/source/services/web-app/codemirror-entry.js +7 -0
  25. package/source/services/web-app/pict-app/Pict-Application-Facto-Configuration.json +9 -0
  26. package/source/services/web-app/pict-app/Pict-Application-Facto.js +70 -0
  27. package/source/services/web-app/pict-app/Pict-Facto-Bundle.js +11 -0
  28. package/source/services/web-app/pict-app/providers/Pict-Provider-Facto-UI.js +66 -0
  29. package/source/services/web-app/pict-app/providers/Pict-Provider-Facto.js +69 -0
  30. package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Catalog.js +93 -0
  31. package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Connections.js +42 -0
  32. package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Datasets.js +605 -0
  33. package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Projections.js +188 -0
  34. package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Scanner.js +80 -0
  35. package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Schema.js +116 -0
  36. package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Sources.js +104 -0
  37. package/source/services/web-app/pict-app/views/PictView-Facto-Catalog.js +526 -0
  38. package/source/services/web-app/pict-app/views/PictView-Facto-Datasets.js +173 -0
  39. package/source/services/web-app/pict-app/views/PictView-Facto-Ingest.js +259 -0
  40. package/source/services/web-app/pict-app/views/PictView-Facto-Layout.js +191 -0
  41. package/source/services/web-app/pict-app/views/PictView-Facto-Projections.js +231 -0
  42. package/source/services/web-app/pict-app/views/PictView-Facto-Records.js +326 -0
  43. package/source/services/web-app/pict-app/views/PictView-Facto-Scanner.js +624 -0
  44. package/source/services/web-app/pict-app/views/PictView-Facto-Sources.js +201 -0
  45. package/source/services/web-app/pict-app/views/PictView-Facto-Throughput.js +456 -0
  46. package/source/services/web-app/pict-app-full/Pict-Application-Facto-Full-Configuration.json +14 -0
  47. package/source/services/web-app/pict-app-full/Pict-Application-Facto-Full.js +391 -0
  48. package/source/services/web-app/pict-app-full/providers/PictRouter-Facto-Configuration.json +56 -0
  49. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-BottomBar.js +68 -0
  50. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Connections.js +340 -0
  51. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Dashboard.js +149 -0
  52. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Dashboards.js +819 -0
  53. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Datasets.js +178 -0
  54. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-IngestJobs.js +99 -0
  55. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Layout.js +62 -0
  56. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-MappingEditor.js +158 -0
  57. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-ProjectionDetail.js +1120 -0
  58. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Projections.js +172 -0
  59. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-QueryPanel.js +119 -0
  60. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-RecordViewer.js +663 -0
  61. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Records.js +648 -0
  62. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Scanner.js +1017 -0
  63. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SchemaDetail.js +1404 -0
  64. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SchemaDocEditor.js +1036 -0
  65. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SchemaEditor.js +636 -0
  66. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SchemaResearch.js +357 -0
  67. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SourceDetail.js +822 -0
  68. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SourceEditor.js +1036 -0
  69. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SourceResearch.js +487 -0
  70. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Sources.js +165 -0
  71. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Throughput.js +439 -0
  72. package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-TopBar.js +335 -0
  73. package/source/services/web-app/pict-app-full/views/projections/Facto-Projections-Constants.js +71 -0
  74. package/source/services/web-app/web/chart.min.js +20 -0
  75. package/source/services/web-app/web/codemirror-bundle.js +30099 -0
  76. package/source/services/web-app/web/css/facto-themes.css +467 -0
  77. package/source/services/web-app/web/css/facto.css +502 -0
  78. package/source/services/web-app/web/index.html +28 -0
  79. package/source/services/web-app/web/retold-facto.js +12138 -0
  80. package/source/services/web-app/web/retold-facto.js.map +1 -0
  81. package/source/services/web-app/web/retold-facto.min.js +2 -0
  82. package/source/services/web-app/web/retold-facto.min.js.map +1 -0
  83. package/source/services/web-app/web/simple/index.html +17 -0
  84. package/test/Facto_Browser_Integration_tests.js +798 -0
  85. package/test/RetoldFacto_tests.js +4117 -0
  86. package/test/fixtures/weather-readings.csv +17 -0
  87. package/test/fixtures/weather-stations.csv +9 -0
  88. package/test/model/MeadowModel-Extended.json +8497 -0
  89. package/test/model/MeadowModel-PICT.json +1 -0
  90. package/test/model/MeadowModel.json +1355 -0
  91. package/test/model/ddl/Facto.ddl +225 -0
  92. package/test/model/fable-configuration.json +14 -0
@@ -0,0 +1,69 @@
1
+ const libPictProvider = require('pict-provider');
2
+
3
+ class FactoProvider extends libPictProvider
4
+ {
5
+ constructor(pFable, pOptions, pServiceHash)
6
+ {
7
+ super(pFable, pOptions, pServiceHash);
8
+ }
9
+
10
+ // ================================================================
11
+ // API Helper
12
+ // ================================================================
13
+
14
+ api(pMethod, pPath, pBody)
15
+ {
16
+ let tmpOpts = { method: pMethod, headers: {} };
17
+ if (pBody)
18
+ {
19
+ tmpOpts.headers['Content-Type'] = 'application/json';
20
+ tmpOpts.body = JSON.stringify(pBody);
21
+ }
22
+ return fetch(pPath, tmpOpts).then(
23
+ function(pResponse)
24
+ {
25
+ return pResponse.text().then(
26
+ function(pText)
27
+ {
28
+ let tmpData;
29
+ try
30
+ {
31
+ tmpData = JSON.parse(pText);
32
+ }
33
+ catch (pParseError)
34
+ {
35
+ return { Error: 'HTTP ' + pResponse.status + ' (non-JSON): ' + pText.substring(0, 200) };
36
+ }
37
+ // Translate Restify error format {code, message} to {Error}
38
+ if (!pResponse.ok && tmpData && tmpData.code && !tmpData.Error)
39
+ {
40
+ tmpData.Error = tmpData.code + ': ' + (tmpData.message || 'HTTP ' + pResponse.status);
41
+ }
42
+ return tmpData;
43
+ });
44
+ }).catch(
45
+ function(pError)
46
+ {
47
+ return { Error: pError.message || 'Network error' };
48
+ });
49
+ }
50
+
51
+
52
+ }
53
+
54
+ // Mix in domain-specific API methods
55
+ Object.assign(FactoProvider.prototype, require('./facto-api/Facto-API-Catalog.js'));
56
+ Object.assign(FactoProvider.prototype, require('./facto-api/Facto-API-Sources.js'));
57
+ Object.assign(FactoProvider.prototype, require('./facto-api/Facto-API-Datasets.js'));
58
+ Object.assign(FactoProvider.prototype, require('./facto-api/Facto-API-Projections.js'));
59
+ Object.assign(FactoProvider.prototype, require('./facto-api/Facto-API-Scanner.js'));
60
+ Object.assign(FactoProvider.prototype, require('./facto-api/Facto-API-Connections.js'));
61
+ Object.assign(FactoProvider.prototype, require('./facto-api/Facto-API-Schema.js'));
62
+
63
+ module.exports = FactoProvider;
64
+
65
+ module.exports.default_configuration =
66
+ {
67
+ ProviderIdentifier: 'Facto',
68
+ AutoInitialize: true
69
+ };
@@ -0,0 +1,93 @@
1
+ module.exports =
2
+ {
3
+ loadCatalogEntries: function()
4
+ {
5
+ return this.api('GET', '/facto/catalog/entries').then(
6
+ (pResponse) =>
7
+ {
8
+ this.pict.AppData.Facto.CatalogEntries = (pResponse && pResponse.Entries) ? pResponse.Entries : [];
9
+ });
10
+ },
11
+
12
+ searchCatalog: function(pQuery)
13
+ {
14
+ return this.api('GET', '/facto/catalog/search?q=' + encodeURIComponent(pQuery)).then(
15
+ (pResponse) =>
16
+ {
17
+ this.pict.AppData.Facto.CatalogEntries = (pResponse && pResponse.Entries) ? pResponse.Entries : [];
18
+ return pResponse;
19
+ });
20
+ },
21
+
22
+ createCatalogEntry: function(pData)
23
+ {
24
+ return this.api('POST', '/facto/catalog/entry', pData).then(
25
+ (pResponse) =>
26
+ {
27
+ return pResponse;
28
+ });
29
+ },
30
+
31
+ deleteCatalogEntry: function(pIDEntry)
32
+ {
33
+ return this.api('DELETE', '/facto/catalog/entry/' + pIDEntry).then(
34
+ (pResponse) =>
35
+ {
36
+ return pResponse;
37
+ });
38
+ },
39
+
40
+ loadCatalogEntryDatasets: function(pIDEntry)
41
+ {
42
+ return this.api('GET', '/facto/catalog/entry/' + pIDEntry + '/datasets').then(
43
+ (pResponse) =>
44
+ {
45
+ return pResponse;
46
+ });
47
+ },
48
+
49
+ addCatalogDataset: function(pIDEntry, pData)
50
+ {
51
+ return this.api('POST', '/facto/catalog/entry/' + pIDEntry + '/dataset', pData).then(
52
+ (pResponse) =>
53
+ {
54
+ return pResponse;
55
+ });
56
+ },
57
+
58
+ provisionCatalogDataset: function(pIDCatalogDataset)
59
+ {
60
+ return this.api('POST', '/facto/catalog/dataset/' + pIDCatalogDataset + '/provision').then(
61
+ (pResponse) =>
62
+ {
63
+ return pResponse;
64
+ });
65
+ },
66
+
67
+ fetchCatalogDataset: function(pIDCatalogDataset)
68
+ {
69
+ return this.api('POST', '/facto/catalog/dataset/' + pIDCatalogDataset + '/fetch').then(
70
+ (pResponse) =>
71
+ {
72
+ return pResponse;
73
+ });
74
+ },
75
+
76
+ importCatalog: function(pEntries)
77
+ {
78
+ return this.api('POST', '/facto/catalog/import', pEntries).then(
79
+ (pResponse) =>
80
+ {
81
+ return pResponse;
82
+ });
83
+ },
84
+
85
+ exportCatalog: function()
86
+ {
87
+ return this.api('GET', '/facto/catalog/export').then(
88
+ (pResponse) =>
89
+ {
90
+ return pResponse;
91
+ });
92
+ }
93
+ };
@@ -0,0 +1,42 @@
1
+ module.exports =
2
+ {
3
+ loadStoreConnections: function()
4
+ {
5
+ return this.api('GET', '/facto/connections').then(
6
+ (pResult) =>
7
+ {
8
+ this.pict.AppData.Facto.StoreConnections = (pResult && pResult.Connections) ? pResult.Connections : [];
9
+ return pResult;
10
+ });
11
+ },
12
+
13
+ createStoreConnection: function(pData)
14
+ {
15
+ return this.api('POST', '/facto/connection', pData);
16
+ },
17
+
18
+ updateStoreConnection: function(pID, pData)
19
+ {
20
+ return this.api('PUT', `/facto/connection/${pID}`, pData);
21
+ },
22
+
23
+ deleteStoreConnection: function(pID)
24
+ {
25
+ return this.api('DELETE', `/facto/connection/${pID}`);
26
+ },
27
+
28
+ testStoreConnection: function(pID)
29
+ {
30
+ return this.api('POST', `/facto/connection/${pID}/test`);
31
+ },
32
+
33
+ testAdHocConnection: function(pType, pConfig)
34
+ {
35
+ return this.api('POST', '/facto/connection/test', { Type: pType, Config: pConfig });
36
+ },
37
+
38
+ loadAvailableConnectionTypes: function()
39
+ {
40
+ return this.api('GET', '/facto/connection/available-types');
41
+ }
42
+ };