retold-data-service 2.0.13 → 2.0.14
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/example_applications/data-cloner/data/cloned.sqlite +0 -0
- package/example_applications/data-cloner/data/cloned.sqlite-shm +0 -0
- package/example_applications/data-cloner/data/cloned.sqlite-wal +0 -0
- package/example_applications/data-cloner/data-cloner-web.html +935 -0
- package/example_applications/data-cloner/data-cloner.js +1047 -0
- package/example_applications/data-cloner/package.json +19 -0
- package/package.json +13 -9
- package/source/Retold-Data-Service.js +225 -73
- package/source/services/Retold-Data-Service-ConnectionManager.js +277 -0
- package/source/services/Retold-Data-Service-MeadowEndpoints.js +217 -0
- package/source/services/Retold-Data-Service-ModelManager.js +335 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-CSVCheck.js +85 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-CSVTransform.js +180 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-ComprehensionIntersect.js +153 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-ComprehensionPush.js +190 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-ComprehensionToArray.js +113 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-ComprehensionToCSV.js +211 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-EntityFromTabularFolder.js +244 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-JSONArrayTransform.js +213 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-TSVCheck.js +80 -0
- package/source/services/meadow-integration/MeadowIntegration-Command-TSVTransform.js +166 -0
- package/source/services/meadow-integration/Retold-Data-Service-MeadowIntegration.js +113 -0
- package/source/services/migration-manager/MigrationManager-Command-Connections.js +220 -0
- package/source/services/migration-manager/MigrationManager-Command-DiffMigrate.js +169 -0
- package/source/services/migration-manager/MigrationManager-Command-Schemas.js +532 -0
- package/source/services/migration-manager/MigrationManager-Command-WebUI.js +123 -0
- package/source/services/migration-manager/Retold-Data-Service-MigrationManager.js +357 -0
- package/source/services/stricture/Retold-Data-Service-Stricture.js +303 -0
- package/source/services/stricture/Stricture-Command-Compile.js +39 -0
- package/source/services/stricture/Stricture-Command-Generate-AuthorizationChart.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-DictionaryCSV.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-LaTeX.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-Markdown.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-Meadow.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-ModelGraph.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-MySQL.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-MySQLMigrate.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-Pict.js +14 -0
- package/source/services/stricture/Stricture-Command-Generate-TestObjectContainers.js +14 -0
- package/test/RetoldDataService_tests.js +161 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "retold-data-cloner",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Data cloner example application. Clones a remote retold database to a local SQLite database.",
|
|
5
|
+
"main": "data-cloner.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node data-cloner.js"
|
|
8
|
+
},
|
|
9
|
+
"author": "Steven Velozo <steven@velozo.com>",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"fable": "^3.0.0",
|
|
13
|
+
"meadow-connection-sqlite": "^1.0.14",
|
|
14
|
+
"meadow-integration": "file:../../../meadow-integration",
|
|
15
|
+
"pict": "^1.0.356",
|
|
16
|
+
"pict-sessionmanager": "^1.0.1",
|
|
17
|
+
"retold-data-service": "file:../../"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "retold-data-service",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"description": "Serve up a whole model!",
|
|
5
5
|
"main": "source/Retold-Data-Service.js",
|
|
6
6
|
"scripts": {
|
|
@@ -51,20 +51,24 @@
|
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://github.com/stevenvelozo/retold-data-service",
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"meadow-connection-sqlite": "^1.0.
|
|
55
|
-
"quackage": "^1.0.
|
|
56
|
-
"stricture": "^
|
|
54
|
+
"meadow-connection-sqlite": "^1.0.17",
|
|
55
|
+
"quackage": "^1.0.61",
|
|
56
|
+
"stricture": "^4.0.0",
|
|
57
57
|
"supertest": "^7.2.2"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"fable": "^3.1.63",
|
|
61
61
|
"fable-serviceproviderbase": "^3.0.19",
|
|
62
|
-
"meadow": "^2.0.
|
|
63
|
-
"meadow-connection-mysql": "^1.0.
|
|
64
|
-
"meadow-endpoints": "^4.0.
|
|
65
|
-
"orator": "^6.0.
|
|
62
|
+
"meadow": "^2.0.28",
|
|
63
|
+
"meadow-connection-mysql": "^1.0.13",
|
|
64
|
+
"meadow-endpoints": "^4.0.13",
|
|
65
|
+
"orator": "^6.0.4",
|
|
66
66
|
"orator-http-proxy": "^1.0.5",
|
|
67
67
|
"orator-serviceserver-restify": "^2.0.9",
|
|
68
|
-
"
|
|
68
|
+
"meadow-integration": "^1.0.6",
|
|
69
|
+
"meadow-migrationmanager": "^0.0.4",
|
|
70
|
+
"orator-static-server": "^2.0.4",
|
|
71
|
+
"pict": "^1.0.357",
|
|
72
|
+
"stricture": "^4.0.0"
|
|
69
73
|
}
|
|
70
74
|
}
|
|
@@ -10,19 +10,52 @@ const libFableServiceProviderBase = require('fable-serviceproviderbase');
|
|
|
10
10
|
const libOrator = require('orator');
|
|
11
11
|
const libOratorServiceServerRestify = require('orator-serviceserver-restify');
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const libRetoldDataServiceMeadowEndpoints = require('./services/Retold-Data-Service-MeadowEndpoints.js');
|
|
14
|
+
const libRetoldDataServiceConnectionManager = require('./services/Retold-Data-Service-ConnectionManager.js');
|
|
15
|
+
const libRetoldDataServiceModelManager = require('./services/Retold-Data-Service-ModelManager.js');
|
|
16
|
+
const libRetoldDataServiceStricture = require('./services/stricture/Retold-Data-Service-Stricture.js');
|
|
17
|
+
const libRetoldDataServiceMeadowIntegration = require('./services/meadow-integration/Retold-Data-Service-MeadowIntegration.js');
|
|
18
|
+
const libRetoldDataServiceMigrationManager = require('./services/migration-manager/Retold-Data-Service-MigrationManager.js');
|
|
15
19
|
|
|
16
20
|
const defaultDataServiceSettings = (
|
|
17
21
|
{
|
|
18
|
-
StorageProvider:
|
|
19
|
-
StorageProviderModule:
|
|
22
|
+
StorageProvider: false,
|
|
23
|
+
StorageProviderModule: false,
|
|
20
24
|
|
|
21
25
|
FullMeadowSchemaPath: `${process.cwd()}/model/`,
|
|
22
|
-
FullMeadowSchemaFilename:
|
|
26
|
+
FullMeadowSchemaFilename: false,
|
|
23
27
|
|
|
24
28
|
AutoInitializeDataService: true,
|
|
25
|
-
AutoStartOrator: true
|
|
29
|
+
AutoStartOrator: true,
|
|
30
|
+
|
|
31
|
+
// Endpoint allow-list. Only enabled groups have their routes wired.
|
|
32
|
+
// Schema read routes (GET /1.0/Retold/Models, Model/:Name, etc.) are always available.
|
|
33
|
+
Endpoints:
|
|
34
|
+
{
|
|
35
|
+
// Runtime connection management (POST/DEL /1.0/Retold/Connection*)
|
|
36
|
+
ConnectionManager: false,
|
|
37
|
+
// Runtime model upload/delete/connect (POST/DEL /1.0/Retold/Model*)
|
|
38
|
+
ModelManagerWrite: false,
|
|
39
|
+
// DDL compilation and code generation (/1.0/Retold/Stricture/*)
|
|
40
|
+
Stricture: false,
|
|
41
|
+
// CSV/TSV/JSON data transformation (/1.0/Retold/MeadowIntegration/*)
|
|
42
|
+
MeadowIntegration: false,
|
|
43
|
+
// Per-entity CRUD endpoints (e.g. /1.0/Book, /1.0/Authors)
|
|
44
|
+
MeadowEndpoints: true,
|
|
45
|
+
// Migration manager API endpoints (/api/*)
|
|
46
|
+
MigrationManager: false,
|
|
47
|
+
// Migration manager web UI (GET /, /lib/*)
|
|
48
|
+
MigrationManagerWebUI: false
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// Migration manager configuration
|
|
52
|
+
MigrationManager:
|
|
53
|
+
{
|
|
54
|
+
// Directory containing .mddl/.ddl files to auto-import at startup
|
|
55
|
+
ModelPath: false,
|
|
56
|
+
// Route prefix for all migration manager endpoints (API + web UI)
|
|
57
|
+
RoutePrefix: '/meadow-migrationmanager'
|
|
58
|
+
}
|
|
26
59
|
});
|
|
27
60
|
|
|
28
61
|
class RetoldDataService extends libFableServiceProviderBase
|
|
@@ -35,7 +68,8 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
35
68
|
|
|
36
69
|
this.serviceType = 'RetoldDataService';
|
|
37
70
|
|
|
38
|
-
|
|
71
|
+
// Re-apply defaults without mutating the module-level defaultDataServiceSettings object.
|
|
72
|
+
this.options = Object.assign({}, JSON.parse(JSON.stringify(defaultDataServiceSettings)), this.options);
|
|
39
73
|
|
|
40
74
|
// Add the restify server provider and orator base class to fable
|
|
41
75
|
this.fable.serviceManager.addServiceType('OratorServiceServer', libOratorServiceServerRestify);
|
|
@@ -47,93 +81,112 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
47
81
|
// Initialize Orator, which will automatically use the default `OratorServiceServer` service we just instantiated
|
|
48
82
|
this.fable.serviceManager.instantiateServiceProvider('Orator', this.options);
|
|
49
83
|
|
|
50
|
-
//
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
84
|
+
// Register and instantiate the MeadowEndpoints service
|
|
85
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceMeadowEndpoints', libRetoldDataServiceMeadowEndpoints);
|
|
86
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceMeadowEndpoints',
|
|
87
|
+
{
|
|
88
|
+
StorageProvider: this.options.StorageProvider,
|
|
89
|
+
FullMeadowSchemaPath: this.options.FullMeadowSchemaPath,
|
|
90
|
+
FullMeadowSchemaFilename: this.options.FullMeadowSchemaFilename
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Register and instantiate the ConnectionManager service
|
|
94
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceConnectionManager', libRetoldDataServiceConnectionManager);
|
|
95
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceConnectionManager');
|
|
96
|
+
|
|
97
|
+
// Register and instantiate the ModelManager service
|
|
98
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceModelManager', libRetoldDataServiceModelManager);
|
|
99
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceModelManager');
|
|
100
|
+
|
|
101
|
+
// Register and instantiate the Stricture service
|
|
102
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceStricture', libRetoldDataServiceStricture);
|
|
103
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceStricture');
|
|
104
|
+
|
|
105
|
+
// Register and instantiate the MeadowIntegration service
|
|
106
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceMeadowIntegration', libRetoldDataServiceMeadowIntegration);
|
|
107
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceMeadowIntegration');
|
|
108
|
+
|
|
109
|
+
// Register and instantiate the MigrationManager service
|
|
110
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceMigrationManager', libRetoldDataServiceMigrationManager);
|
|
111
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceMigrationManager');
|
|
112
|
+
|
|
113
|
+
// Expose the DAL and MeadowEndpoints from the service on this object and on fable for backward compatibility
|
|
114
|
+
this._DAL = this.fable.RetoldDataServiceMeadowEndpoints._DAL;
|
|
115
|
+
this._MeadowEndpoints = this.fable.RetoldDataServiceMeadowEndpoints._MeadowEndpoints;
|
|
59
116
|
this.fable.DAL = this._DAL;
|
|
60
117
|
this.fable.MeadowEndpoints = this._MeadowEndpoints;
|
|
61
118
|
|
|
62
|
-
// Storage for the model and entities
|
|
63
|
-
this.fullModel = false;
|
|
64
|
-
this.entityList = false;
|
|
65
|
-
|
|
66
119
|
this.serviceInitialized = false;
|
|
67
120
|
}
|
|
68
121
|
|
|
69
|
-
|
|
122
|
+
// Proxy accessors for model data that lives on the MeadowEndpoints service
|
|
123
|
+
get fullModel()
|
|
70
124
|
{
|
|
71
|
-
return
|
|
125
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.fullModel;
|
|
72
126
|
}
|
|
73
127
|
|
|
74
|
-
|
|
128
|
+
get entityList()
|
|
75
129
|
{
|
|
76
|
-
return
|
|
130
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.entityList;
|
|
77
131
|
}
|
|
78
132
|
|
|
79
|
-
|
|
133
|
+
get models()
|
|
80
134
|
{
|
|
81
|
-
return
|
|
135
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.models;
|
|
82
136
|
}
|
|
83
137
|
|
|
84
|
-
|
|
138
|
+
loadModel(pModelName, pModelObject, pStorageProvider, fCallback)
|
|
85
139
|
{
|
|
86
|
-
|
|
87
|
-
// Load the mysql connection for meadow if it doesn't exist yet
|
|
88
|
-
this.fable.serviceManager.addAndInstantiateServiceType(`Meadow${this.options.StorageProvider}Provider`, require(this.options.StorageProviderModule));
|
|
89
|
-
return fCallback();
|
|
140
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.loadModel(pModelName, pModelObject, pStorageProvider, fCallback);
|
|
90
141
|
}
|
|
91
142
|
|
|
92
|
-
|
|
143
|
+
loadModelFromFile(pModelName, pModelPath, pModelFilename, fCallback)
|
|
93
144
|
{
|
|
94
|
-
this.fable.
|
|
145
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.loadModelFromFile(pModelName, pModelPath, pModelFilename, fCallback);
|
|
146
|
+
}
|
|
95
147
|
|
|
96
|
-
|
|
148
|
+
/**
|
|
149
|
+
* Check if an endpoint group is enabled in the Endpoints configuration.
|
|
150
|
+
*
|
|
151
|
+
* @param {string} pGroupName - The endpoint group name (e.g. 'ConnectionManager', 'Stricture')
|
|
152
|
+
* @return {boolean} True if the group is enabled
|
|
153
|
+
*/
|
|
154
|
+
isEndpointGroupEnabled(pGroupName)
|
|
155
|
+
{
|
|
156
|
+
if (!this.options.Endpoints)
|
|
157
|
+
{
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
if (!this.options.Endpoints.hasOwnProperty(pGroupName))
|
|
161
|
+
{
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
return !!this.options.Endpoints[pGroupName];
|
|
165
|
+
}
|
|
97
166
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
167
|
+
onBeforeInitialize(fCallback)
|
|
168
|
+
{
|
|
169
|
+
return fCallback();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
onInitialize(fCallback)
|
|
173
|
+
{
|
|
174
|
+
return fCallback();
|
|
175
|
+
}
|
|
102
176
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
177
|
+
onAfterInitialize(fCallback)
|
|
178
|
+
{
|
|
179
|
+
return fCallback();
|
|
180
|
+
}
|
|
106
181
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
182
|
+
initializePersistenceEngine(fCallback)
|
|
183
|
+
{
|
|
184
|
+
// Only instantiate a default provider if StorageProviderModule is configured.
|
|
185
|
+
// When launching with no model, ConnectionManager handles provider instantiation.
|
|
186
|
+
if (this.options.StorageProviderModule)
|
|
110
187
|
{
|
|
111
|
-
|
|
112
|
-
let tmpDALEntityName = this.entityList[i];
|
|
113
|
-
try
|
|
114
|
-
{
|
|
115
|
-
let tmpDALSchema = this.fullModel.Tables[tmpDALEntityName];
|
|
116
|
-
let tmpDALMeadowSchema = tmpDALSchema.MeadowSchema;
|
|
117
|
-
|
|
118
|
-
//let tmpDALPackageFile = `${this.options.DALMeadowSchemaPath}${this.options.DALMeadowSchemaPrefix}${tmpDALEntityName}${this.options.DALMeadowSchemaPostfix}.json`
|
|
119
|
-
//this.fable.log.info(`Initializing the ${tmpDALEntityName} DAL from [${tmpDALPackageFile}]...`);
|
|
120
|
-
this._DAL[tmpDALEntityName] = this._Meadow.loadFromPackageObject(tmpDALMeadowSchema);
|
|
121
|
-
// 5. Tell this DAL object to use the configured storage provider
|
|
122
|
-
this.fable.log.info(`...defaulting the ${tmpDALEntityName} DAL to use ${this.options.StorageProvider}`);
|
|
123
|
-
this._DAL[tmpDALEntityName].setProvider(this.options.StorageProvider);
|
|
124
|
-
// 6. Create a Meadow Endpoints class for this DAL
|
|
125
|
-
this.fable.log.info(`...initializing the ${tmpDALEntityName} Meadow Endpoints`);
|
|
126
|
-
this._MeadowEndpoints[tmpDALEntityName] = libMeadowEndpoints.new(this._DAL[tmpDALEntityName]);
|
|
127
|
-
// 8. Expose the meadow endpoints on Orator
|
|
128
|
-
this.fable.log.info(`...mapping the ${tmpDALEntityName} Meadow Endpoints to Orator`);
|
|
129
|
-
this._MeadowEndpoints[tmpDALEntityName].connectRoutes(this.fable.OratorServiceServer);
|
|
130
|
-
}
|
|
131
|
-
catch (pError)
|
|
132
|
-
{
|
|
133
|
-
this.fable.log.error(`Error initializing DAL and Endpoints for entity [${tmpDALEntityName}]: ${pError}`);
|
|
134
|
-
}
|
|
188
|
+
this.fable.serviceManager.addAndInstantiateServiceType(`Meadow${this.options.StorageProvider}Provider`, require(this.options.StorageProviderModule));
|
|
135
189
|
}
|
|
136
|
-
|
|
137
190
|
return fCallback();
|
|
138
191
|
}
|
|
139
192
|
|
|
@@ -147,7 +200,29 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
147
200
|
{
|
|
148
201
|
let tmpAnticipate = this.fable.newAnticipate();
|
|
149
202
|
|
|
150
|
-
this.fable.log.info(`The Retold Data Service is
|
|
203
|
+
this.fable.log.info(`The Retold Data Service is initializing...`);
|
|
204
|
+
|
|
205
|
+
// Log endpoint configuration
|
|
206
|
+
let tmpGroupNames = ['ConnectionManager', 'ModelManagerWrite', 'Stricture', 'MeadowIntegration', 'MeadowEndpoints', 'MigrationManager', 'MigrationManagerWebUI'];
|
|
207
|
+
let tmpEnabledGroups = [];
|
|
208
|
+
let tmpDisabledGroups = [];
|
|
209
|
+
for (let i = 0; i < tmpGroupNames.length; i++)
|
|
210
|
+
{
|
|
211
|
+
if (this.isEndpointGroupEnabled(tmpGroupNames[i]))
|
|
212
|
+
{
|
|
213
|
+
tmpEnabledGroups.push(tmpGroupNames[i]);
|
|
214
|
+
}
|
|
215
|
+
else
|
|
216
|
+
{
|
|
217
|
+
tmpDisabledGroups.push(tmpGroupNames[i]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
this.fable.log.info(`Endpoint groups enabled: [${tmpEnabledGroups.join(', ')}]`);
|
|
221
|
+
if (tmpDisabledGroups.length > 0)
|
|
222
|
+
{
|
|
223
|
+
this.fable.log.info(`Endpoint groups disabled: [${tmpDisabledGroups.join(', ')}]`);
|
|
224
|
+
}
|
|
225
|
+
this.fable.log.info(`Schema read endpoints are always enabled.`);
|
|
151
226
|
|
|
152
227
|
tmpAnticipate.anticipate(this.onBeforeInitialize.bind(this));
|
|
153
228
|
|
|
@@ -168,7 +243,85 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
168
243
|
|
|
169
244
|
tmpAnticipate.anticipate(this.onInitialize.bind(this));
|
|
170
245
|
|
|
171
|
-
|
|
246
|
+
// Wire endpoint routes based on the Endpoints allow-list configuration
|
|
247
|
+
tmpAnticipate.anticipate(
|
|
248
|
+
(fInitCallback) =>
|
|
249
|
+
{
|
|
250
|
+
// ConnectionManager routes (runtime connection hotloading)
|
|
251
|
+
if (this.isEndpointGroupEnabled('ConnectionManager'))
|
|
252
|
+
{
|
|
253
|
+
this.fable.RetoldDataServiceConnectionManager.connectRoutes(this.fable.OratorServiceServer);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// ModelManager schema READ routes are ALWAYS available
|
|
257
|
+
this.fable.RetoldDataServiceModelManager.connectReadRoutes(this.fable.OratorServiceServer);
|
|
258
|
+
|
|
259
|
+
// ModelManager WRITE routes (model upload, delete, connect)
|
|
260
|
+
if (this.isEndpointGroupEnabled('ModelManagerWrite'))
|
|
261
|
+
{
|
|
262
|
+
this.fable.RetoldDataServiceModelManager.connectWriteRoutes(this.fable.OratorServiceServer);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Stricture routes (DDL compilation and code generation)
|
|
266
|
+
if (this.isEndpointGroupEnabled('Stricture'))
|
|
267
|
+
{
|
|
268
|
+
this.fable.RetoldDataServiceStricture.connectRoutes(this.fable.OratorServiceServer);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// MeadowIntegration routes (CSV/TSV/JSON data transformation)
|
|
272
|
+
if (this.isEndpointGroupEnabled('MeadowIntegration'))
|
|
273
|
+
{
|
|
274
|
+
this.fable.RetoldDataServiceMeadowIntegration.connectRoutes(this.fable.OratorServiceServer);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// MigrationManager API routes (/api/*)
|
|
278
|
+
if (this.isEndpointGroupEnabled('MigrationManager'))
|
|
279
|
+
{
|
|
280
|
+
this.fable.RetoldDataServiceMigrationManager.connectRoutes(this.fable.OratorServiceServer);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// MigrationManager Web UI routes (GET /, /lib/*)
|
|
284
|
+
if (this.isEndpointGroupEnabled('MigrationManagerWebUI'))
|
|
285
|
+
{
|
|
286
|
+
this.fable.RetoldDataServiceMigrationManager.connectWebUIRoutes(this.fable.OratorServiceServer);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return fInitCallback();
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
// Initialize MigrationManager (scan ModelPath, import DDL files, auto-compile)
|
|
293
|
+
// if either MigrationManager or MigrationManagerWebUI is enabled
|
|
294
|
+
tmpAnticipate.anticipate(
|
|
295
|
+
(fInitCallback) =>
|
|
296
|
+
{
|
|
297
|
+
if (!this.isEndpointGroupEnabled('MigrationManager') && !this.isEndpointGroupEnabled('MigrationManagerWebUI'))
|
|
298
|
+
{
|
|
299
|
+
return fInitCallback();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
this.fable.RetoldDataServiceMigrationManager.initializeMigrationManager(fInitCallback);
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// Only load the default model if MeadowEndpoints are enabled and a schema file is configured
|
|
306
|
+
tmpAnticipate.anticipate(
|
|
307
|
+
(fInitCallback) =>
|
|
308
|
+
{
|
|
309
|
+
if (!this.isEndpointGroupEnabled('MeadowEndpoints'))
|
|
310
|
+
{
|
|
311
|
+
this.fable.log.info('MeadowEndpoints are disabled in configuration; skipping data endpoint initialization.');
|
|
312
|
+
return fInitCallback();
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (this.options.FullMeadowSchemaFilename)
|
|
316
|
+
{
|
|
317
|
+
this.fable.RetoldDataServiceMeadowEndpoints.initializeDataEndpoints(fInitCallback);
|
|
318
|
+
}
|
|
319
|
+
else
|
|
320
|
+
{
|
|
321
|
+
this.fable.log.info('No default model configured; skipping data endpoint initialization. Use the Model and Connection management endpoints to add models at runtime.');
|
|
322
|
+
return fInitCallback();
|
|
323
|
+
}
|
|
324
|
+
});
|
|
172
325
|
|
|
173
326
|
tmpAnticipate.anticipate(this.onAfterInitialize.bind(this));
|
|
174
327
|
|
|
@@ -180,7 +333,6 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
180
333
|
this.log.error(`Error initializing Retold Data Service: ${pError}`);
|
|
181
334
|
return fCallback(pError);
|
|
182
335
|
}
|
|
183
|
-
this.fable.Orator.startWebServer.bind(this.fable.Orator);
|
|
184
336
|
this.serviceInitialized = true;
|
|
185
337
|
return fCallback();
|
|
186
338
|
});
|
|
@@ -216,4 +368,4 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
216
368
|
}
|
|
217
369
|
}
|
|
218
370
|
|
|
219
|
-
module.exports = RetoldDataService;
|
|
371
|
+
module.exports = RetoldDataService;
|