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.
- package/.claude/launch.json +11 -0
- package/.dockerignore +8 -0
- package/.quackage.json +19 -0
- package/Dockerfile +26 -0
- package/bin/retold-facto.js +909 -0
- package/examples/facto-government-data.sqlite +0 -0
- package/examples/government-data-catalog.json +137 -0
- package/examples/government-data-loader.js +1432 -0
- package/package.json +91 -0
- package/scripts/facto-download.js +425 -0
- package/source/Retold-Facto.js +1042 -0
- package/source/services/Retold-Facto-BeaconProvider.js +511 -0
- package/source/services/Retold-Facto-CatalogManager.js +1252 -0
- package/source/services/Retold-Facto-DataLakeService.js +1642 -0
- package/source/services/Retold-Facto-DatasetManager.js +417 -0
- package/source/services/Retold-Facto-IngestEngine.js +1315 -0
- package/source/services/Retold-Facto-ProjectionEngine.js +3960 -0
- package/source/services/Retold-Facto-RecordManager.js +360 -0
- package/source/services/Retold-Facto-SchemaManager.js +1110 -0
- package/source/services/Retold-Facto-SourceFolderScanner.js +2243 -0
- package/source/services/Retold-Facto-SourceManager.js +730 -0
- package/source/services/Retold-Facto-StoreConnectionManager.js +441 -0
- package/source/services/Retold-Facto-ThroughputMonitor.js +478 -0
- package/source/services/web-app/codemirror-entry.js +7 -0
- package/source/services/web-app/pict-app/Pict-Application-Facto-Configuration.json +9 -0
- package/source/services/web-app/pict-app/Pict-Application-Facto.js +70 -0
- package/source/services/web-app/pict-app/Pict-Facto-Bundle.js +11 -0
- package/source/services/web-app/pict-app/providers/Pict-Provider-Facto-UI.js +66 -0
- package/source/services/web-app/pict-app/providers/Pict-Provider-Facto.js +69 -0
- package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Catalog.js +93 -0
- package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Connections.js +42 -0
- package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Datasets.js +605 -0
- package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Projections.js +188 -0
- package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Scanner.js +80 -0
- package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Schema.js +116 -0
- package/source/services/web-app/pict-app/providers/facto-api/Facto-API-Sources.js +104 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Catalog.js +526 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Datasets.js +173 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Ingest.js +259 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Layout.js +191 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Projections.js +231 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Records.js +326 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Scanner.js +624 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Sources.js +201 -0
- package/source/services/web-app/pict-app/views/PictView-Facto-Throughput.js +456 -0
- package/source/services/web-app/pict-app-full/Pict-Application-Facto-Full-Configuration.json +14 -0
- package/source/services/web-app/pict-app-full/Pict-Application-Facto-Full.js +391 -0
- package/source/services/web-app/pict-app-full/providers/PictRouter-Facto-Configuration.json +56 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-BottomBar.js +68 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Connections.js +340 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Dashboard.js +149 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Dashboards.js +819 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Datasets.js +178 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-IngestJobs.js +99 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Layout.js +62 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-MappingEditor.js +158 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-ProjectionDetail.js +1120 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Projections.js +172 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-QueryPanel.js +119 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-RecordViewer.js +663 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Records.js +648 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Scanner.js +1017 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SchemaDetail.js +1404 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SchemaDocEditor.js +1036 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SchemaEditor.js +636 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SchemaResearch.js +357 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SourceDetail.js +822 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SourceEditor.js +1036 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-SourceResearch.js +487 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Sources.js +165 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-Throughput.js +439 -0
- package/source/services/web-app/pict-app-full/views/PictView-Facto-Full-TopBar.js +335 -0
- package/source/services/web-app/pict-app-full/views/projections/Facto-Projections-Constants.js +71 -0
- package/source/services/web-app/web/chart.min.js +20 -0
- package/source/services/web-app/web/codemirror-bundle.js +30099 -0
- package/source/services/web-app/web/css/facto-themes.css +467 -0
- package/source/services/web-app/web/css/facto.css +502 -0
- package/source/services/web-app/web/index.html +28 -0
- package/source/services/web-app/web/retold-facto.js +12138 -0
- package/source/services/web-app/web/retold-facto.js.map +1 -0
- package/source/services/web-app/web/retold-facto.min.js +2 -0
- package/source/services/web-app/web/retold-facto.min.js.map +1 -0
- package/source/services/web-app/web/simple/index.html +17 -0
- package/test/Facto_Browser_Integration_tests.js +798 -0
- package/test/RetoldFacto_tests.js +4117 -0
- package/test/fixtures/weather-readings.csv +17 -0
- package/test/fixtures/weather-stations.csv +9 -0
- package/test/model/MeadowModel-Extended.json +8497 -0
- package/test/model/MeadowModel-PICT.json +1 -0
- package/test/model/MeadowModel.json +1355 -0
- package/test/model/ddl/Facto.ddl +225 -0
- 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
|
+
};
|