retold-data-service 2.0.13 → 2.0.16
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/bin/retold-data-service-clone.js +286 -0
- package/package.json +18 -9
- package/source/Retold-Data-Service.js +275 -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/data-cloner/DataCloner-Command-Connection.js +138 -0
- package/source/services/data-cloner/DataCloner-Command-Headless.js +357 -0
- package/source/services/data-cloner/DataCloner-Command-Schema.js +367 -0
- package/source/services/data-cloner/DataCloner-Command-Session.js +229 -0
- package/source/services/data-cloner/DataCloner-Command-Sync.js +491 -0
- package/source/services/data-cloner/DataCloner-Command-WebUI.js +40 -0
- package/source/services/data-cloner/DataCloner-ProviderRegistry.js +20 -0
- package/source/services/data-cloner/Retold-Data-Service-DataCloner.js +751 -0
- package/source/services/data-cloner/data-cloner-web.html +2706 -0
- package/source/services/integration-telemetry/IntegrationTelemetry-Command-Dashboard.js +60 -0
- package/source/services/integration-telemetry/IntegrationTelemetry-Command-Integrations.js +132 -0
- package/source/services/integration-telemetry/IntegrationTelemetry-Command-Runs.js +93 -0
- package/source/services/integration-telemetry/IntegrationTelemetry-StorageProvider-Base.js +116 -0
- package/source/services/integration-telemetry/IntegrationTelemetry-StorageProvider-Bibliograph.js +495 -0
- package/source/services/integration-telemetry/Retold-Data-Service-IntegrationTelemetry.js +224 -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
- package/debug/data/books.csv +0 -10001
|
@@ -10,19 +10,76 @@ 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');
|
|
19
|
+
const libRetoldDataServiceDataCloner = require('./services/data-cloner/Retold-Data-Service-DataCloner.js');
|
|
20
|
+
const libRetoldDataServiceIntegrationTelemetry = require('./services/integration-telemetry/Retold-Data-Service-IntegrationTelemetry.js');
|
|
15
21
|
|
|
16
22
|
const defaultDataServiceSettings = (
|
|
17
23
|
{
|
|
18
|
-
StorageProvider:
|
|
19
|
-
StorageProviderModule:
|
|
24
|
+
StorageProvider: false,
|
|
25
|
+
StorageProviderModule: false,
|
|
20
26
|
|
|
21
27
|
FullMeadowSchemaPath: `${process.cwd()}/model/`,
|
|
22
|
-
FullMeadowSchemaFilename:
|
|
28
|
+
FullMeadowSchemaFilename: false,
|
|
23
29
|
|
|
24
30
|
AutoInitializeDataService: true,
|
|
25
|
-
AutoStartOrator: true
|
|
31
|
+
AutoStartOrator: true,
|
|
32
|
+
|
|
33
|
+
// Endpoint allow-list. Only enabled groups have their routes wired.
|
|
34
|
+
// Schema read routes (GET /1.0/Retold/Models, Model/:Name, etc.) are always available.
|
|
35
|
+
Endpoints:
|
|
36
|
+
{
|
|
37
|
+
// Runtime connection management (POST/DEL /1.0/Retold/Connection*)
|
|
38
|
+
ConnectionManager: false,
|
|
39
|
+
// Runtime model upload/delete/connect (POST/DEL /1.0/Retold/Model*)
|
|
40
|
+
ModelManagerWrite: false,
|
|
41
|
+
// DDL compilation and code generation (/1.0/Retold/Stricture/*)
|
|
42
|
+
Stricture: false,
|
|
43
|
+
// CSV/TSV/JSON data transformation (/1.0/Retold/MeadowIntegration/*)
|
|
44
|
+
MeadowIntegration: false,
|
|
45
|
+
// Per-entity CRUD endpoints (e.g. /1.0/Book, /1.0/Authors)
|
|
46
|
+
MeadowEndpoints: true,
|
|
47
|
+
// Migration manager API endpoints (/api/*)
|
|
48
|
+
MigrationManager: false,
|
|
49
|
+
// Migration manager web UI (GET /, /lib/*)
|
|
50
|
+
MigrationManagerWebUI: false,
|
|
51
|
+
// Data cloner API endpoints (/clone/*)
|
|
52
|
+
DataCloner: false,
|
|
53
|
+
// Data cloner web UI (GET /clone/)
|
|
54
|
+
DataClonerWebUI: false,
|
|
55
|
+
// Integration telemetry API endpoints (/telemetry/*)
|
|
56
|
+
IntegrationTelemetry: false
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
// Migration manager configuration
|
|
60
|
+
MigrationManager:
|
|
61
|
+
{
|
|
62
|
+
// Directory containing .mddl/.ddl files to auto-import at startup
|
|
63
|
+
ModelPath: false,
|
|
64
|
+
// Route prefix for all migration manager endpoints (API + web UI)
|
|
65
|
+
RoutePrefix: '/meadow-migrationmanager'
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// Data cloner configuration
|
|
69
|
+
DataCloner:
|
|
70
|
+
{
|
|
71
|
+
// Route prefix for all data cloner endpoints (API + web UI)
|
|
72
|
+
RoutePrefix: '/clone'
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
// Integration telemetry configuration
|
|
76
|
+
IntegrationTelemetry:
|
|
77
|
+
{
|
|
78
|
+
// Route prefix for all telemetry endpoints
|
|
79
|
+
RoutePrefix: '/telemetry',
|
|
80
|
+
// Default tenant identifier when none is provided
|
|
81
|
+
DefaultTenantID: 'default'
|
|
82
|
+
}
|
|
26
83
|
});
|
|
27
84
|
|
|
28
85
|
class RetoldDataService extends libFableServiceProviderBase
|
|
@@ -35,7 +92,8 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
35
92
|
|
|
36
93
|
this.serviceType = 'RetoldDataService';
|
|
37
94
|
|
|
38
|
-
|
|
95
|
+
// Re-apply defaults without mutating the module-level defaultDataServiceSettings object.
|
|
96
|
+
this.options = Object.assign({}, JSON.parse(JSON.stringify(defaultDataServiceSettings)), this.options);
|
|
39
97
|
|
|
40
98
|
// Add the restify server provider and orator base class to fable
|
|
41
99
|
this.fable.serviceManager.addServiceType('OratorServiceServer', libOratorServiceServerRestify);
|
|
@@ -47,93 +105,120 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
47
105
|
// Initialize Orator, which will automatically use the default `OratorServiceServer` service we just instantiated
|
|
48
106
|
this.fable.serviceManager.instantiateServiceProvider('Orator', this.options);
|
|
49
107
|
|
|
50
|
-
//
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
108
|
+
// Register and instantiate the MeadowEndpoints service
|
|
109
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceMeadowEndpoints', libRetoldDataServiceMeadowEndpoints);
|
|
110
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceMeadowEndpoints',
|
|
111
|
+
{
|
|
112
|
+
StorageProvider: this.options.StorageProvider,
|
|
113
|
+
FullMeadowSchemaPath: this.options.FullMeadowSchemaPath,
|
|
114
|
+
FullMeadowSchemaFilename: this.options.FullMeadowSchemaFilename
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Register and instantiate the ConnectionManager service
|
|
118
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceConnectionManager', libRetoldDataServiceConnectionManager);
|
|
119
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceConnectionManager');
|
|
120
|
+
|
|
121
|
+
// Register and instantiate the ModelManager service
|
|
122
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceModelManager', libRetoldDataServiceModelManager);
|
|
123
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceModelManager');
|
|
124
|
+
|
|
125
|
+
// Register and instantiate the Stricture service
|
|
126
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceStricture', libRetoldDataServiceStricture);
|
|
127
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceStricture');
|
|
128
|
+
|
|
129
|
+
// Register and instantiate the MeadowIntegration service
|
|
130
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceMeadowIntegration', libRetoldDataServiceMeadowIntegration);
|
|
131
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceMeadowIntegration');
|
|
132
|
+
|
|
133
|
+
// Register and instantiate the MigrationManager service
|
|
134
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceMigrationManager', libRetoldDataServiceMigrationManager);
|
|
135
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceMigrationManager');
|
|
136
|
+
|
|
137
|
+
// Register and instantiate the DataCloner service
|
|
138
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceDataCloner', libRetoldDataServiceDataCloner);
|
|
139
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceDataCloner');
|
|
140
|
+
|
|
141
|
+
// Register and instantiate the IntegrationTelemetry service
|
|
142
|
+
this.fable.serviceManager.addServiceType('RetoldDataServiceIntegrationTelemetry', libRetoldDataServiceIntegrationTelemetry);
|
|
143
|
+
this.fable.serviceManager.instantiateServiceProvider('RetoldDataServiceIntegrationTelemetry');
|
|
144
|
+
|
|
145
|
+
// Expose the DAL and MeadowEndpoints from the service on this object and on fable for backward compatibility
|
|
146
|
+
this._DAL = this.fable.RetoldDataServiceMeadowEndpoints._DAL;
|
|
147
|
+
this._MeadowEndpoints = this.fable.RetoldDataServiceMeadowEndpoints._MeadowEndpoints;
|
|
59
148
|
this.fable.DAL = this._DAL;
|
|
60
149
|
this.fable.MeadowEndpoints = this._MeadowEndpoints;
|
|
61
150
|
|
|
62
|
-
// Storage for the model and entities
|
|
63
|
-
this.fullModel = false;
|
|
64
|
-
this.entityList = false;
|
|
65
|
-
|
|
66
151
|
this.serviceInitialized = false;
|
|
67
152
|
}
|
|
68
153
|
|
|
69
|
-
|
|
154
|
+
// Proxy accessors for model data that lives on the MeadowEndpoints service
|
|
155
|
+
get fullModel()
|
|
70
156
|
{
|
|
71
|
-
return
|
|
157
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.fullModel;
|
|
72
158
|
}
|
|
73
159
|
|
|
74
|
-
|
|
160
|
+
get entityList()
|
|
75
161
|
{
|
|
76
|
-
return
|
|
162
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.entityList;
|
|
77
163
|
}
|
|
78
164
|
|
|
79
|
-
|
|
165
|
+
get models()
|
|
80
166
|
{
|
|
81
|
-
return
|
|
167
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.models;
|
|
82
168
|
}
|
|
83
169
|
|
|
84
|
-
|
|
170
|
+
loadModel(pModelName, pModelObject, pStorageProvider, fCallback)
|
|
85
171
|
{
|
|
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();
|
|
172
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.loadModel(pModelName, pModelObject, pStorageProvider, fCallback);
|
|
90
173
|
}
|
|
91
174
|
|
|
92
|
-
|
|
175
|
+
loadModelFromFile(pModelName, pModelPath, pModelFilename, fCallback)
|
|
93
176
|
{
|
|
94
|
-
this.fable.
|
|
177
|
+
return this.fable.RetoldDataServiceMeadowEndpoints.loadModelFromFile(pModelName, pModelPath, pModelFilename, fCallback);
|
|
178
|
+
}
|
|
95
179
|
|
|
96
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Check if an endpoint group is enabled in the Endpoints configuration.
|
|
182
|
+
*
|
|
183
|
+
* @param {string} pGroupName - The endpoint group name (e.g. 'ConnectionManager', 'Stricture')
|
|
184
|
+
* @return {boolean} True if the group is enabled
|
|
185
|
+
*/
|
|
186
|
+
isEndpointGroupEnabled(pGroupName)
|
|
187
|
+
{
|
|
188
|
+
if (!this.options.Endpoints)
|
|
189
|
+
{
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
if (!this.options.Endpoints.hasOwnProperty(pGroupName))
|
|
193
|
+
{
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
return !!this.options.Endpoints[pGroupName];
|
|
197
|
+
}
|
|
97
198
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
199
|
+
onBeforeInitialize(fCallback)
|
|
200
|
+
{
|
|
201
|
+
return fCallback();
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
onInitialize(fCallback)
|
|
205
|
+
{
|
|
206
|
+
return fCallback();
|
|
207
|
+
}
|
|
102
208
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
209
|
+
onAfterInitialize(fCallback)
|
|
210
|
+
{
|
|
211
|
+
return fCallback();
|
|
212
|
+
}
|
|
106
213
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
214
|
+
initializePersistenceEngine(fCallback)
|
|
215
|
+
{
|
|
216
|
+
// Only instantiate a default provider if StorageProviderModule is configured.
|
|
217
|
+
// When launching with no model, ConnectionManager handles provider instantiation.
|
|
218
|
+
if (this.options.StorageProviderModule)
|
|
110
219
|
{
|
|
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
|
-
}
|
|
220
|
+
this.fable.serviceManager.addAndInstantiateServiceType(`Meadow${this.options.StorageProvider}Provider`, require(this.options.StorageProviderModule));
|
|
135
221
|
}
|
|
136
|
-
|
|
137
222
|
return fCallback();
|
|
138
223
|
}
|
|
139
224
|
|
|
@@ -147,7 +232,29 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
147
232
|
{
|
|
148
233
|
let tmpAnticipate = this.fable.newAnticipate();
|
|
149
234
|
|
|
150
|
-
this.fable.log.info(`The Retold Data Service is
|
|
235
|
+
this.fable.log.info(`The Retold Data Service is initializing...`);
|
|
236
|
+
|
|
237
|
+
// Log endpoint configuration
|
|
238
|
+
let tmpGroupNames = ['ConnectionManager', 'ModelManagerWrite', 'Stricture', 'MeadowIntegration', 'MeadowEndpoints', 'MigrationManager', 'MigrationManagerWebUI', 'DataCloner', 'DataClonerWebUI', 'IntegrationTelemetry'];
|
|
239
|
+
let tmpEnabledGroups = [];
|
|
240
|
+
let tmpDisabledGroups = [];
|
|
241
|
+
for (let i = 0; i < tmpGroupNames.length; i++)
|
|
242
|
+
{
|
|
243
|
+
if (this.isEndpointGroupEnabled(tmpGroupNames[i]))
|
|
244
|
+
{
|
|
245
|
+
tmpEnabledGroups.push(tmpGroupNames[i]);
|
|
246
|
+
}
|
|
247
|
+
else
|
|
248
|
+
{
|
|
249
|
+
tmpDisabledGroups.push(tmpGroupNames[i]);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
this.fable.log.info(`Endpoint groups enabled: [${tmpEnabledGroups.join(', ')}]`);
|
|
253
|
+
if (tmpDisabledGroups.length > 0)
|
|
254
|
+
{
|
|
255
|
+
this.fable.log.info(`Endpoint groups disabled: [${tmpDisabledGroups.join(', ')}]`);
|
|
256
|
+
}
|
|
257
|
+
this.fable.log.info(`Schema read endpoints are always enabled.`);
|
|
151
258
|
|
|
152
259
|
tmpAnticipate.anticipate(this.onBeforeInitialize.bind(this));
|
|
153
260
|
|
|
@@ -168,7 +275,103 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
168
275
|
|
|
169
276
|
tmpAnticipate.anticipate(this.onInitialize.bind(this));
|
|
170
277
|
|
|
171
|
-
|
|
278
|
+
// Wire endpoint routes based on the Endpoints allow-list configuration
|
|
279
|
+
tmpAnticipate.anticipate(
|
|
280
|
+
(fInitCallback) =>
|
|
281
|
+
{
|
|
282
|
+
// ConnectionManager routes (runtime connection hotloading)
|
|
283
|
+
if (this.isEndpointGroupEnabled('ConnectionManager'))
|
|
284
|
+
{
|
|
285
|
+
this.fable.RetoldDataServiceConnectionManager.connectRoutes(this.fable.OratorServiceServer);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// ModelManager schema READ routes are ALWAYS available
|
|
289
|
+
this.fable.RetoldDataServiceModelManager.connectReadRoutes(this.fable.OratorServiceServer);
|
|
290
|
+
|
|
291
|
+
// ModelManager WRITE routes (model upload, delete, connect)
|
|
292
|
+
if (this.isEndpointGroupEnabled('ModelManagerWrite'))
|
|
293
|
+
{
|
|
294
|
+
this.fable.RetoldDataServiceModelManager.connectWriteRoutes(this.fable.OratorServiceServer);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Stricture routes (DDL compilation and code generation)
|
|
298
|
+
if (this.isEndpointGroupEnabled('Stricture'))
|
|
299
|
+
{
|
|
300
|
+
this.fable.RetoldDataServiceStricture.connectRoutes(this.fable.OratorServiceServer);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// MeadowIntegration routes (CSV/TSV/JSON data transformation)
|
|
304
|
+
if (this.isEndpointGroupEnabled('MeadowIntegration'))
|
|
305
|
+
{
|
|
306
|
+
this.fable.RetoldDataServiceMeadowIntegration.connectRoutes(this.fable.OratorServiceServer);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// MigrationManager API routes (/api/*)
|
|
310
|
+
if (this.isEndpointGroupEnabled('MigrationManager'))
|
|
311
|
+
{
|
|
312
|
+
this.fable.RetoldDataServiceMigrationManager.connectRoutes(this.fable.OratorServiceServer);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// MigrationManager Web UI routes (GET /, /lib/*)
|
|
316
|
+
if (this.isEndpointGroupEnabled('MigrationManagerWebUI'))
|
|
317
|
+
{
|
|
318
|
+
this.fable.RetoldDataServiceMigrationManager.connectWebUIRoutes(this.fable.OratorServiceServer);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// DataCloner API routes (/clone/*)
|
|
322
|
+
if (this.isEndpointGroupEnabled('DataCloner'))
|
|
323
|
+
{
|
|
324
|
+
this.fable.RetoldDataServiceDataCloner.connectRoutes(this.fable.OratorServiceServer);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// DataCloner Web UI routes (GET /clone/)
|
|
328
|
+
if (this.isEndpointGroupEnabled('DataClonerWebUI'))
|
|
329
|
+
{
|
|
330
|
+
this.fable.RetoldDataServiceDataCloner.connectWebUIRoutes(this.fable.OratorServiceServer);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// IntegrationTelemetry API routes (/telemetry/*)
|
|
334
|
+
if (this.isEndpointGroupEnabled('IntegrationTelemetry'))
|
|
335
|
+
{
|
|
336
|
+
this.fable.RetoldDataServiceIntegrationTelemetry.connectRoutes(this.fable.OratorServiceServer);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return fInitCallback();
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
// Initialize MigrationManager (scan ModelPath, import DDL files, auto-compile)
|
|
343
|
+
// if either MigrationManager or MigrationManagerWebUI is enabled
|
|
344
|
+
tmpAnticipate.anticipate(
|
|
345
|
+
(fInitCallback) =>
|
|
346
|
+
{
|
|
347
|
+
if (!this.isEndpointGroupEnabled('MigrationManager') && !this.isEndpointGroupEnabled('MigrationManagerWebUI'))
|
|
348
|
+
{
|
|
349
|
+
return fInitCallback();
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
this.fable.RetoldDataServiceMigrationManager.initializeMigrationManager(fInitCallback);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// Only load the default model if MeadowEndpoints are enabled and a schema file is configured
|
|
356
|
+
tmpAnticipate.anticipate(
|
|
357
|
+
(fInitCallback) =>
|
|
358
|
+
{
|
|
359
|
+
if (!this.isEndpointGroupEnabled('MeadowEndpoints'))
|
|
360
|
+
{
|
|
361
|
+
this.fable.log.info('MeadowEndpoints are disabled in configuration; skipping data endpoint initialization.');
|
|
362
|
+
return fInitCallback();
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (this.options.FullMeadowSchemaFilename)
|
|
366
|
+
{
|
|
367
|
+
this.fable.RetoldDataServiceMeadowEndpoints.initializeDataEndpoints(fInitCallback);
|
|
368
|
+
}
|
|
369
|
+
else
|
|
370
|
+
{
|
|
371
|
+
this.fable.log.info('No default model configured; skipping data endpoint initialization. Use the Model and Connection management endpoints to add models at runtime.');
|
|
372
|
+
return fInitCallback();
|
|
373
|
+
}
|
|
374
|
+
});
|
|
172
375
|
|
|
173
376
|
tmpAnticipate.anticipate(this.onAfterInitialize.bind(this));
|
|
174
377
|
|
|
@@ -180,7 +383,6 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
180
383
|
this.log.error(`Error initializing Retold Data Service: ${pError}`);
|
|
181
384
|
return fCallback(pError);
|
|
182
385
|
}
|
|
183
|
-
this.fable.Orator.startWebServer.bind(this.fable.Orator);
|
|
184
386
|
this.serviceInitialized = true;
|
|
185
387
|
return fCallback();
|
|
186
388
|
});
|
|
@@ -216,4 +418,4 @@ class RetoldDataService extends libFableServiceProviderBase
|
|
|
216
418
|
}
|
|
217
419
|
}
|
|
218
420
|
|
|
219
|
-
module.exports = RetoldDataService;
|
|
421
|
+
module.exports = RetoldDataService;
|