retold-data-service 2.0.38 → 2.0.42

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "retold-data-service",
3
- "version": "2.0.38",
3
+ "version": "2.0.42",
4
4
  "description": "Serve up a whole model!",
5
5
  "main": "source/Retold-Data-Service.js",
6
6
  "bin": {
@@ -70,11 +70,11 @@
70
70
  "bibliograph": "^0.1.4",
71
71
  "fable": "^3.1.70",
72
72
  "fable-serviceproviderbase": "^3.0.19",
73
- "meadow": "^2.0.33",
73
+ "meadow": "^2.0.35",
74
74
  "meadow-connection-mysql": "^1.0.14",
75
75
  "meadow-endpoints": "^4.0.15",
76
- "meadow-integration": "^1.0.30",
77
- "meadow-migrationmanager": "^0.0.9",
76
+ "meadow-integration": "^1.0.34",
77
+ "meadow-migrationmanager": "^0.0.12",
78
78
  "orator": "^6.0.4",
79
79
  "orator-http-proxy": "^1.0.5",
80
80
  "orator-serviceserver-restify": "^2.0.10",
@@ -70,6 +70,9 @@ class DataClonerApplication extends libPictApplication
70
70
  'connProvider', 'sqliteFilePath',
71
71
  'mysqlServer', 'mysqlPort', 'mysqlUser', 'mysqlPassword', 'mysqlDatabase', 'mysqlConnectionLimit',
72
72
  'mssqlServer', 'mssqlPort', 'mssqlUser', 'mssqlPassword', 'mssqlDatabase', 'mssqlConnectionLimit',
73
+ 'mssqlRequestTimeoutSec', 'mssqlConnectionTimeoutSec',
74
+ 'mssqlConnectMaxAttempts', 'mssqlDDLMaxAttempts',
75
+ 'mssqlRetryInitialDelaySec', 'mssqlRetryMaxDelaySec',
73
76
  'postgresqlHost', 'postgresqlPort', 'postgresqlUser', 'postgresqlPassword', 'postgresqlDatabase', 'postgresqlConnectionLimit',
74
77
  'solrHost', 'solrPort', 'solrCore', 'solrPath',
75
78
  'mongodbHost', 'mongodbPort', 'mongodbUser', 'mongodbPassword', 'mongodbDatabase', 'mongodbConnectionLimit',
@@ -295,6 +295,12 @@ class DataClonerProvider extends libPictProvider
295
295
  {
296
296
  document.getElementById('solrSecure').checked = tmpSolrSecure === 'true';
297
297
  }
298
+ let tmpMssqlLegacyPagination = localStorage.getItem('dataCloner_mssqlLegacyPagination');
299
+ if (tmpMssqlLegacyPagination !== null)
300
+ {
301
+ let tmpEl = document.getElementById('mssqlLegacyPagination');
302
+ if (tmpEl) tmpEl.checked = tmpMssqlLegacyPagination === 'true';
303
+ }
298
304
  // Restore advanced ID pagination checkbox
299
305
  let tmpAdvancedIDPagination = localStorage.getItem('dataCloner_syncAdvancedIDPagination');
300
306
  if (tmpAdvancedIDPagination !== null)
@@ -351,6 +357,16 @@ class DataClonerProvider extends libPictProvider
351
357
  });
352
358
  }
353
359
 
360
+ // Persist MSSQL legacy pagination checkbox
361
+ let tmpMssqlLegacyPaginationEl = document.getElementById('mssqlLegacyPagination');
362
+ if (tmpMssqlLegacyPaginationEl)
363
+ {
364
+ tmpMssqlLegacyPaginationEl.addEventListener('change', function()
365
+ {
366
+ localStorage.setItem('dataCloner_mssqlLegacyPagination', this.checked);
367
+ });
368
+ }
369
+
354
370
  // Persist advanced ID pagination checkbox
355
371
  let tmpAdvancedIDPaginationEl = document.getElementById('syncAdvancedIDPagination');
356
372
  if (tmpAdvancedIDPaginationEl)
@@ -48,6 +48,39 @@ class DataClonerConnectionView extends libPictView
48
48
  tmpConfig.password = document.getElementById('mssqlPassword').value;
49
49
  tmpConfig.database = document.getElementById('mssqlDatabase').value.trim();
50
50
  tmpConfig.connectionLimit = parseInt(document.getElementById('mssqlConnectionLimit').value, 10) || 20;
51
+ // Use ROW_NUMBER() pagination instead of OFFSET/FETCH for
52
+ // SQL Server 2008 R2 / 2012 or databases whose compatibility
53
+ // level is < 110 (the parser rejects OFFSET/FETCH syntax
54
+ // otherwise).
55
+ tmpConfig.LegacyPagination = document.getElementById('mssqlLegacyPagination').checked;
56
+
57
+ // Reliability tuning — pull from the advanced settings block.
58
+ // All are optional; the connection provider falls back to
59
+ // sensible defaults when a value is missing or zero.
60
+ let tmpReqSec = parseInt(document.getElementById('mssqlRequestTimeoutSec').value, 10);
61
+ if (tmpReqSec > 0) tmpConfig.RequestTimeoutMs = tmpReqSec * 1000;
62
+ let tmpConnSec = parseInt(document.getElementById('mssqlConnectionTimeoutSec').value, 10);
63
+ if (tmpConnSec > 0) tmpConfig.ConnectionTimeoutMs = tmpConnSec * 1000;
64
+
65
+ let tmpConnectAttempts = parseInt(document.getElementById('mssqlConnectMaxAttempts').value, 10);
66
+ let tmpDDLAttempts = parseInt(document.getElementById('mssqlDDLMaxAttempts').value, 10);
67
+ let tmpInitialDelaySec = parseInt(document.getElementById('mssqlRetryInitialDelaySec').value, 10);
68
+ let tmpMaxDelaySec = parseInt(document.getElementById('mssqlRetryMaxDelaySec').value, 10);
69
+
70
+ if (tmpConnectAttempts > 0 || tmpInitialDelaySec > 0 || tmpMaxDelaySec > 0)
71
+ {
72
+ tmpConfig.ConnectRetryOptions = {};
73
+ if (tmpConnectAttempts > 0) tmpConfig.ConnectRetryOptions.MaxAttempts = tmpConnectAttempts;
74
+ if (tmpInitialDelaySec > 0) tmpConfig.ConnectRetryOptions.InitialDelayMs = tmpInitialDelaySec * 1000;
75
+ if (tmpMaxDelaySec > 0) tmpConfig.ConnectRetryOptions.MaxDelayMs = tmpMaxDelaySec * 1000;
76
+ }
77
+ if (tmpDDLAttempts > 0 || tmpInitialDelaySec > 0 || tmpMaxDelaySec > 0)
78
+ {
79
+ tmpConfig.DDLRetryOptions = {};
80
+ if (tmpDDLAttempts > 0) tmpConfig.DDLRetryOptions.MaxAttempts = tmpDDLAttempts;
81
+ if (tmpInitialDelaySec > 0) tmpConfig.DDLRetryOptions.InitialDelayMs = tmpInitialDelaySec * 1000;
82
+ if (tmpMaxDelaySec > 0) tmpConfig.DDLRetryOptions.MaxDelayMs = tmpMaxDelaySec * 1000;
83
+ }
51
84
  }
52
85
  else if (tmpProvider === 'PostgreSQL')
53
86
  {
@@ -291,6 +324,45 @@ module.exports.default_configuration =
291
324
  </div>
292
325
  <div></div>
293
326
  </div>
327
+ <div style="margin-top:8px">
328
+ <input type="checkbox" id="mssqlLegacyPagination">
329
+ <label for="mssqlLegacyPagination" title="Enable for SQL Server 2008 R2 / 2012 or databases at compatibility_level &lt; 110. Uses ROW_NUMBER() pagination instead of OFFSET/FETCH.">Legacy pagination (SQL Server &lt; 2012 / compat level &lt; 110)</label>
330
+ </div>
331
+
332
+ <details style="margin-top:8px">
333
+ <summary style="cursor:pointer; font-weight:600">Reliability &amp; timeouts (advanced)</summary>
334
+ <p style="margin:8px 0; font-size:0.9em; color:#555">Tune these for slow / flaky customer networks. Connection and DDL operations will retry with exponential backoff, classifying each failure (NetworkError / RequestTimeout / PoolDegraded / ServerError) in the logs so the failure mode is obvious.</p>
335
+ <div class="inline-group">
336
+ <div>
337
+ <label for="mssqlRequestTimeoutSec">Request timeout (sec)</label>
338
+ <input type="number" id="mssqlRequestTimeoutSec" placeholder="120" value="120">
339
+ </div>
340
+ <div>
341
+ <label for="mssqlConnectionTimeoutSec">Connection timeout (sec)</label>
342
+ <input type="number" id="mssqlConnectionTimeoutSec" placeholder="60" value="60">
343
+ </div>
344
+ </div>
345
+ <div class="inline-group">
346
+ <div>
347
+ <label for="mssqlConnectMaxAttempts">Connect retries (max attempts)</label>
348
+ <input type="number" id="mssqlConnectMaxAttempts" placeholder="5" value="5" min="1" max="20">
349
+ </div>
350
+ <div>
351
+ <label for="mssqlDDLMaxAttempts">DDL retries (max attempts)</label>
352
+ <input type="number" id="mssqlDDLMaxAttempts" placeholder="5" value="5" min="1" max="20">
353
+ </div>
354
+ </div>
355
+ <div class="inline-group">
356
+ <div>
357
+ <label for="mssqlRetryInitialDelaySec">Retry initial delay (sec)</label>
358
+ <input type="number" id="mssqlRetryInitialDelaySec" placeholder="3" value="3" min="1" max="60">
359
+ </div>
360
+ <div>
361
+ <label for="mssqlRetryMaxDelaySec">Retry max delay (sec)</label>
362
+ <input type="number" id="mssqlRetryMaxDelaySec" placeholder="30" value="30" min="1" max="600">
363
+ </div>
364
+ </div>
365
+ </details>
294
366
  </div>
295
367
 
296
368
  <!-- PostgreSQL Config -->
@@ -37,6 +37,10 @@ class DataClonerExportView extends libPictView
37
37
  tmpDbConfig.password = document.getElementById('mssqlPassword').value;
38
38
  tmpDbConfig.database = document.getElementById('mssqlDatabase').value.trim();
39
39
  tmpDbConfig.connectionLimit = parseInt(document.getElementById('mssqlConnectionLimit').value, 10) || 20;
40
+ if (document.getElementById('mssqlLegacyPagination').checked)
41
+ {
42
+ tmpDbConfig.LegacyPagination = true;
43
+ }
40
44
  }
41
45
  else if (tmpProvider === 'PostgreSQL')
42
46
  {
@@ -156,6 +160,10 @@ class DataClonerExportView extends libPictView
156
160
  tmpConfig.Destination.MSSQL.password = document.getElementById('mssqlPassword').value || '';
157
161
  tmpConfig.Destination.MSSQL.database = document.getElementById('mssqlDatabase').value.trim() || 'meadow';
158
162
  tmpConfig.Destination.MSSQL.ConnectionPoolLimit = parseInt(document.getElementById('mssqlConnectionLimit').value, 10) || 20;
163
+ if (document.getElementById('mssqlLegacyPagination').checked)
164
+ {
165
+ tmpConfig.Destination.MSSQL.LegacyPagination = true;
166
+ }
159
167
  }
160
168
  else
161
169
  {
@@ -4803,7 +4803,7 @@
4803
4803
  StatusDetailTimer: null,
4804
4804
  StatusDetailData: null,
4805
4805
  LastLiveStatus: null,
4806
- PersistFields: ['serverURL', 'authMethod', 'authURI', 'checkURI', 'cookieName', 'cookieValueAddr', 'cookieValueTemplate', 'loginMarker', 'userName', 'password', 'schemaURL', 'pageSize', 'dateTimePrecisionMS', 'connProvider', 'sqliteFilePath', 'mysqlServer', 'mysqlPort', 'mysqlUser', 'mysqlPassword', 'mysqlDatabase', 'mysqlConnectionLimit', 'mssqlServer', 'mssqlPort', 'mssqlUser', 'mssqlPassword', 'mssqlDatabase', 'mssqlConnectionLimit', 'postgresqlHost', 'postgresqlPort', 'postgresqlUser', 'postgresqlPassword', 'postgresqlDatabase', 'postgresqlConnectionLimit', 'solrHost', 'solrPort', 'solrCore', 'solrPath', 'mongodbHost', 'mongodbPort', 'mongodbUser', 'mongodbPassword', 'mongodbDatabase', 'mongodbConnectionLimit', 'rocksdbFolder', 'bibliographFolder', 'syncMaxRecords']
4806
+ PersistFields: ['serverURL', 'authMethod', 'authURI', 'checkURI', 'cookieName', 'cookieValueAddr', 'cookieValueTemplate', 'loginMarker', 'userName', 'password', 'schemaURL', 'pageSize', 'dateTimePrecisionMS', 'connProvider', 'sqliteFilePath', 'mysqlServer', 'mysqlPort', 'mysqlUser', 'mysqlPassword', 'mysqlDatabase', 'mysqlConnectionLimit', 'mssqlServer', 'mssqlPort', 'mssqlUser', 'mssqlPassword', 'mssqlDatabase', 'mssqlConnectionLimit', 'mssqlRequestTimeoutSec', 'mssqlConnectionTimeoutSec', 'mssqlConnectMaxAttempts', 'mssqlDDLMaxAttempts', 'mssqlRetryInitialDelaySec', 'mssqlRetryMaxDelaySec', 'postgresqlHost', 'postgresqlPort', 'postgresqlUser', 'postgresqlPassword', 'postgresqlDatabase', 'postgresqlConnectionLimit', 'solrHost', 'solrPort', 'solrCore', 'solrPath', 'mongodbHost', 'mongodbPort', 'mongodbUser', 'mongodbPassword', 'mongodbDatabase', 'mongodbConnectionLimit', 'rocksdbFolder', 'bibliographFolder', 'syncMaxRecords']
4807
4807
  };
4808
4808
 
4809
4809
  // Make pict available for inline onclick handlers
@@ -5072,6 +5072,11 @@
5072
5072
  if (tmpSolrSecure !== null) {
5073
5073
  document.getElementById('solrSecure').checked = tmpSolrSecure === 'true';
5074
5074
  }
5075
+ let tmpMssqlLegacyPagination = localStorage.getItem('dataCloner_mssqlLegacyPagination');
5076
+ if (tmpMssqlLegacyPagination !== null) {
5077
+ let tmpEl = document.getElementById('mssqlLegacyPagination');
5078
+ if (tmpEl) tmpEl.checked = tmpMssqlLegacyPagination === 'true';
5079
+ }
5075
5080
  // Restore advanced ID pagination checkbox
5076
5081
  let tmpAdvancedIDPagination = localStorage.getItem('dataCloner_syncAdvancedIDPagination');
5077
5082
  if (tmpAdvancedIDPagination !== null) {
@@ -5119,6 +5124,14 @@
5119
5124
  });
5120
5125
  }
5121
5126
 
5127
+ // Persist MSSQL legacy pagination checkbox
5128
+ let tmpMssqlLegacyPaginationEl = document.getElementById('mssqlLegacyPagination');
5129
+ if (tmpMssqlLegacyPaginationEl) {
5130
+ tmpMssqlLegacyPaginationEl.addEventListener('change', function () {
5131
+ localStorage.setItem('dataCloner_mssqlLegacyPagination', this.checked);
5132
+ });
5133
+ }
5134
+
5122
5135
  // Persist advanced ID pagination checkbox
5123
5136
  let tmpAdvancedIDPaginationEl = document.getElementById('syncAdvancedIDPagination');
5124
5137
  if (tmpAdvancedIDPaginationEl) {
@@ -5851,6 +5864,35 @@
5851
5864
  tmpConfig.password = document.getElementById('mssqlPassword').value;
5852
5865
  tmpConfig.database = document.getElementById('mssqlDatabase').value.trim();
5853
5866
  tmpConfig.connectionLimit = parseInt(document.getElementById('mssqlConnectionLimit').value, 10) || 20;
5867
+ // Use ROW_NUMBER() pagination instead of OFFSET/FETCH for
5868
+ // SQL Server 2008 R2 / 2012 or databases whose compatibility
5869
+ // level is < 110 (the parser rejects OFFSET/FETCH syntax
5870
+ // otherwise).
5871
+ tmpConfig.LegacyPagination = document.getElementById('mssqlLegacyPagination').checked;
5872
+
5873
+ // Reliability tuning — pull from the advanced settings block.
5874
+ // All are optional; the connection provider falls back to
5875
+ // sensible defaults when a value is missing or zero.
5876
+ let tmpReqSec = parseInt(document.getElementById('mssqlRequestTimeoutSec').value, 10);
5877
+ if (tmpReqSec > 0) tmpConfig.RequestTimeoutMs = tmpReqSec * 1000;
5878
+ let tmpConnSec = parseInt(document.getElementById('mssqlConnectionTimeoutSec').value, 10);
5879
+ if (tmpConnSec > 0) tmpConfig.ConnectionTimeoutMs = tmpConnSec * 1000;
5880
+ let tmpConnectAttempts = parseInt(document.getElementById('mssqlConnectMaxAttempts').value, 10);
5881
+ let tmpDDLAttempts = parseInt(document.getElementById('mssqlDDLMaxAttempts').value, 10);
5882
+ let tmpInitialDelaySec = parseInt(document.getElementById('mssqlRetryInitialDelaySec').value, 10);
5883
+ let tmpMaxDelaySec = parseInt(document.getElementById('mssqlRetryMaxDelaySec').value, 10);
5884
+ if (tmpConnectAttempts > 0 || tmpInitialDelaySec > 0 || tmpMaxDelaySec > 0) {
5885
+ tmpConfig.ConnectRetryOptions = {};
5886
+ if (tmpConnectAttempts > 0) tmpConfig.ConnectRetryOptions.MaxAttempts = tmpConnectAttempts;
5887
+ if (tmpInitialDelaySec > 0) tmpConfig.ConnectRetryOptions.InitialDelayMs = tmpInitialDelaySec * 1000;
5888
+ if (tmpMaxDelaySec > 0) tmpConfig.ConnectRetryOptions.MaxDelayMs = tmpMaxDelaySec * 1000;
5889
+ }
5890
+ if (tmpDDLAttempts > 0 || tmpInitialDelaySec > 0 || tmpMaxDelaySec > 0) {
5891
+ tmpConfig.DDLRetryOptions = {};
5892
+ if (tmpDDLAttempts > 0) tmpConfig.DDLRetryOptions.MaxAttempts = tmpDDLAttempts;
5893
+ if (tmpInitialDelaySec > 0) tmpConfig.DDLRetryOptions.InitialDelayMs = tmpInitialDelaySec * 1000;
5894
+ if (tmpMaxDelaySec > 0) tmpConfig.DDLRetryOptions.MaxDelayMs = tmpMaxDelaySec * 1000;
5895
+ }
5854
5896
  } else if (tmpProvider === 'PostgreSQL') {
5855
5897
  tmpConfig.host = document.getElementById('postgresqlHost').value.trim() || '127.0.0.1';
5856
5898
  tmpConfig.port = parseInt(document.getElementById('postgresqlPort').value, 10) || 5432;
@@ -6044,6 +6086,45 @@
6044
6086
  </div>
6045
6087
  <div></div>
6046
6088
  </div>
6089
+ <div style="margin-top:8px">
6090
+ <input type="checkbox" id="mssqlLegacyPagination">
6091
+ <label for="mssqlLegacyPagination" title="Enable for SQL Server 2008 R2 / 2012 or databases at compatibility_level &lt; 110. Uses ROW_NUMBER() pagination instead of OFFSET/FETCH.">Legacy pagination (SQL Server &lt; 2012 / compat level &lt; 110)</label>
6092
+ </div>
6093
+
6094
+ <details style="margin-top:8px">
6095
+ <summary style="cursor:pointer; font-weight:600">Reliability &amp; timeouts (advanced)</summary>
6096
+ <p style="margin:8px 0; font-size:0.9em; color:#555">Tune these for slow / flaky customer networks. Connection and DDL operations will retry with exponential backoff, classifying each failure (NetworkError / RequestTimeout / PoolDegraded / ServerError) in the logs so the failure mode is obvious.</p>
6097
+ <div class="inline-group">
6098
+ <div>
6099
+ <label for="mssqlRequestTimeoutSec">Request timeout (sec)</label>
6100
+ <input type="number" id="mssqlRequestTimeoutSec" placeholder="120" value="120">
6101
+ </div>
6102
+ <div>
6103
+ <label for="mssqlConnectionTimeoutSec">Connection timeout (sec)</label>
6104
+ <input type="number" id="mssqlConnectionTimeoutSec" placeholder="60" value="60">
6105
+ </div>
6106
+ </div>
6107
+ <div class="inline-group">
6108
+ <div>
6109
+ <label for="mssqlConnectMaxAttempts">Connect retries (max attempts)</label>
6110
+ <input type="number" id="mssqlConnectMaxAttempts" placeholder="5" value="5" min="1" max="20">
6111
+ </div>
6112
+ <div>
6113
+ <label for="mssqlDDLMaxAttempts">DDL retries (max attempts)</label>
6114
+ <input type="number" id="mssqlDDLMaxAttempts" placeholder="5" value="5" min="1" max="20">
6115
+ </div>
6116
+ </div>
6117
+ <div class="inline-group">
6118
+ <div>
6119
+ <label for="mssqlRetryInitialDelaySec">Retry initial delay (sec)</label>
6120
+ <input type="number" id="mssqlRetryInitialDelaySec" placeholder="3" value="3" min="1" max="60">
6121
+ </div>
6122
+ <div>
6123
+ <label for="mssqlRetryMaxDelaySec">Retry max delay (sec)</label>
6124
+ <input type="number" id="mssqlRetryMaxDelaySec" placeholder="30" value="30" min="1" max="600">
6125
+ </div>
6126
+ </div>
6127
+ </details>
6047
6128
  </div>
6048
6129
 
6049
6130
  <!-- PostgreSQL Config -->
@@ -6362,6 +6443,9 @@
6362
6443
  tmpDbConfig.password = document.getElementById('mssqlPassword').value;
6363
6444
  tmpDbConfig.database = document.getElementById('mssqlDatabase').value.trim();
6364
6445
  tmpDbConfig.connectionLimit = parseInt(document.getElementById('mssqlConnectionLimit').value, 10) || 20;
6446
+ if (document.getElementById('mssqlLegacyPagination').checked) {
6447
+ tmpDbConfig.LegacyPagination = true;
6448
+ }
6365
6449
  } else if (tmpProvider === 'PostgreSQL') {
6366
6450
  tmpDbConfig.host = document.getElementById('postgresqlHost').value.trim() || '127.0.0.1';
6367
6451
  tmpDbConfig.port = parseInt(document.getElementById('postgresqlPort').value, 10) || 5432;
@@ -6465,6 +6549,9 @@
6465
6549
  tmpConfig.Destination.MSSQL.password = document.getElementById('mssqlPassword').value || '';
6466
6550
  tmpConfig.Destination.MSSQL.database = document.getElementById('mssqlDatabase').value.trim() || 'meadow';
6467
6551
  tmpConfig.Destination.MSSQL.ConnectionPoolLimit = parseInt(document.getElementById('mssqlConnectionLimit').value, 10) || 20;
6552
+ if (document.getElementById('mssqlLegacyPagination').checked) {
6553
+ tmpConfig.Destination.MSSQL.LegacyPagination = true;
6554
+ }
6468
6555
  } else {
6469
6556
  // Default to MySQL placeholder for unsupported providers
6470
6557
  tmpConfig.Destination.Provider = 'MySQL';