meadow-integration 1.0.27 → 1.0.29
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": "meadow-integration",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "Meadow Data Integration",
|
|
5
5
|
"bin": {
|
|
6
6
|
"mdwint": "source/cli/Meadow-Integration-CLI-Run.js"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"fable": "^3.1.
|
|
43
|
+
"fable": "^3.1.70",
|
|
44
44
|
"fable-serviceproviderbase": "^3.0.19",
|
|
45
45
|
"fast-xml-parser": "^4.4.1",
|
|
46
46
|
"meadow": "^2.0.33",
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
const libFableServiceProviderBase = require('fable-serviceproviderbase');
|
|
2
|
-
const Http = require('http');
|
|
3
|
-
const Https = require('https');
|
|
4
2
|
|
|
5
3
|
const defaultRestClientOptions = (
|
|
6
4
|
{
|
|
@@ -41,30 +39,22 @@ class MeadowCloneRestClient extends libFableServiceProviderBase
|
|
|
41
39
|
this._SessionToken = this.options.SessionToken;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
this.requestTimeout = this.options.RequestTimeout;
|
|
48
|
-
this.maxRequestTimeout = this.options.MaxRequestTimeout;
|
|
42
|
+
// Fable settings override instance options for timeouts
|
|
43
|
+
this.requestTimeout = this.fable.settings.RestClientRequestTimeout || this.options.RequestTimeout;
|
|
44
|
+
this.maxRequestTimeout = this.fable.settings.RestClientMaxRequestTimeout || this.options.MaxRequestTimeout;
|
|
49
45
|
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
this.restClient.prepareRequestOptions = (pOptions) =>
|
|
64
|
-
{
|
|
65
|
-
pOptions.agent = this.agent;
|
|
66
|
-
return pOptions;
|
|
67
|
-
};
|
|
46
|
+
// When keep-alive is enabled via fable settings (RestClientKeepAlive), use a
|
|
47
|
+
// socket timeout based on the longer of the two request timeouts so that
|
|
48
|
+
// slow MAX queries don't get killed at the socket level.
|
|
49
|
+
let tmpRestClientOptions = (
|
|
50
|
+
{
|
|
51
|
+
KeepAliveAgentOptions:
|
|
52
|
+
{
|
|
53
|
+
timeout: Math.max(this.requestTimeout, this.maxRequestTimeout)
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this.restClient = this.fable.serviceManager.instantiateServiceProvider('RestClient', tmpRestClientOptions, 'MeadowCloneRestClient-RestClient');
|
|
57
|
+
this.cache = {};
|
|
68
58
|
}
|
|
69
59
|
|
|
70
60
|
prepareRequestOptions(pOptions)
|
|
@@ -715,7 +715,7 @@ class MeadowSyncEntityOngoing extends libFableServiceProviderBase
|
|
|
715
715
|
const tmpRecordID = pEntityRecord[this.DefaultIdentifier];
|
|
716
716
|
if (!tmpRecordID || tmpRecordID < 1)
|
|
717
717
|
{
|
|
718
|
-
return fRecordComplete
|
|
718
|
+
return setImmediate(fRecordComplete);
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
// Read local record with delete tracking disabled so we can see all records
|
|
@@ -745,7 +745,7 @@ class MeadowSyncEntityOngoing extends libFableServiceProviderBase
|
|
|
745
745
|
{
|
|
746
746
|
this.log.error(`Error creating deleted record ${this.EntitySchema.TableName} ID ${tmpRecordID}: ${pCreateError}`);
|
|
747
747
|
}
|
|
748
|
-
return fRecordComplete
|
|
748
|
+
return setImmediate(fRecordComplete);
|
|
749
749
|
});
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
@@ -753,7 +753,7 @@ class MeadowSyncEntityOngoing extends libFableServiceProviderBase
|
|
|
753
753
|
if (pRecord.Deleted == 1)
|
|
754
754
|
{
|
|
755
755
|
// Already marked deleted locally
|
|
756
|
-
return fRecordComplete
|
|
756
|
+
return setImmediate(fRecordComplete);
|
|
757
757
|
}
|
|
758
758
|
|
|
759
759
|
// Record exists locally but is not deleted -- update it
|
|
@@ -772,7 +772,7 @@ class MeadowSyncEntityOngoing extends libFableServiceProviderBase
|
|
|
772
772
|
{
|
|
773
773
|
this.log.error(`Error marking record as deleted ${this.EntitySchema.TableName} ID ${tmpRecordID}: ${pUpdateError}`);
|
|
774
774
|
}
|
|
775
|
-
return fRecordComplete
|
|
775
|
+
return setImmediate(fRecordComplete);
|
|
776
776
|
});
|
|
777
777
|
});
|
|
778
778
|
},
|
|
@@ -208,7 +208,7 @@ class MeadowSyncEntityOngoingEventualConsistency extends libMeadowSyncEntityOngo
|
|
|
208
208
|
const tmpRecordID = pEntityRecord[this.DefaultIdentifier];
|
|
209
209
|
if (!tmpRecordID || tmpRecordID < 1)
|
|
210
210
|
{
|
|
211
|
-
return fRecordComplete
|
|
211
|
+
return setImmediate(fRecordComplete);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
const tmpQuery = this.Meadow.query;
|
|
@@ -237,7 +237,7 @@ class MeadowSyncEntityOngoingEventualConsistency extends libMeadowSyncEntityOngo
|
|
|
237
237
|
this.log.error(`Error creating deleted record ${this.EntitySchema.TableName} ID ${tmpRecordID}: ${pCreateError}`);
|
|
238
238
|
}
|
|
239
239
|
tmpProcessed++;
|
|
240
|
-
return fRecordComplete
|
|
240
|
+
return setImmediate(fRecordComplete);
|
|
241
241
|
});
|
|
242
242
|
return;
|
|
243
243
|
}
|
|
@@ -245,7 +245,7 @@ class MeadowSyncEntityOngoingEventualConsistency extends libMeadowSyncEntityOngo
|
|
|
245
245
|
if (pRecord.Deleted == 1)
|
|
246
246
|
{
|
|
247
247
|
tmpProcessed++;
|
|
248
|
-
return fRecordComplete
|
|
248
|
+
return setImmediate(fRecordComplete);
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
const tmpRecordToCommit = this.marshalRecord(pEntityRecord);
|
|
@@ -264,7 +264,7 @@ class MeadowSyncEntityOngoingEventualConsistency extends libMeadowSyncEntityOngo
|
|
|
264
264
|
this.log.error(`Error marking record as deleted ${this.EntitySchema.TableName} ID ${tmpRecordID}: ${pUpdateError}`);
|
|
265
265
|
}
|
|
266
266
|
tmpProcessed++;
|
|
267
|
-
return fRecordComplete
|
|
267
|
+
return setImmediate(fRecordComplete);
|
|
268
268
|
});
|
|
269
269
|
});
|
|
270
270
|
},
|