meadow-integration 1.0.36 → 1.0.37

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.36",
3
+ "version": "1.0.37",
4
4
  "description": "Meadow Data Integration",
5
5
  "retoldBeacon": {
6
6
  "displayName": "Meadow Integration",
@@ -77,7 +77,7 @@
77
77
  "meadow": "^2.0.37",
78
78
  "meadow-connection-mssql": "^1.0.21",
79
79
  "meadow-connection-mysql": "^1.0.17",
80
- "orator": "^6.0.4",
80
+ "orator": "^6.1.0",
81
81
  "orator-serviceserver-restify": "^2.0.10",
82
82
  "pict-section-flow": "^0.0.17",
83
83
  "pict-service-commandlineutility": "^1.0.19",
@@ -100,9 +100,25 @@ class MeadowIntegrationBeaconProvider
100
100
  let tmpSettings = pWorkItem.Settings || {};
101
101
  let tmpBeaconURL = tmpSettings.BeaconURL;
102
102
  let tmpEntity = tmpSettings.EntityName;
103
- let tmpRecords = tmpSettings.Records || [];
103
+ let tmpRecords = tmpSettings.Records;
104
104
  if (!tmpBeaconURL) { return fCallback(new Error('BeaconURL is required.')); }
105
105
  if (!tmpEntity) { return fCallback(new Error('EntityName is required.')); }
106
+ // Defensive: catch the "engine left an unresolved {~D:~} string
107
+ // in Records" failure mode loudly instead of iterating over
108
+ // the string's characters and POSTing garbage. The execution
109
+ // engine's template resolver SHOULD substitute Array-typed
110
+ // settings whose value is a single whole-string reference,
111
+ // but if it doesn't (older engine, mis-wired graph) this
112
+ // catches it at the boundary with a useful message.
113
+ if (tmpRecords === undefined || tmpRecords === null) { tmpRecords = []; }
114
+ if (!Array.isArray(tmpRecords))
115
+ {
116
+ return fCallback(new Error(
117
+ `BulkInsertViaBeacon: Records must be an array, got ${typeof(tmpRecords)}` +
118
+ (typeof(tmpRecords) === 'string'
119
+ ? ` (looks like an unresolved template: "${tmpRecords.slice(0, 80)}")`
120
+ : '')));
121
+ }
106
122
 
107
123
  let tmpURL = new URL(tmpBeaconURL);
108
124
  let tmpHttp = tmpURL.protocol === 'https:' ? require('https') : require('http');