bellboy 8.7.1 → 8.7.2
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.
|
@@ -91,7 +91,10 @@ class HttpProcessor extends processor_1.Processor {
|
|
|
91
91
|
readStream: delimitedStream,
|
|
92
92
|
hasHeader: this.hasHeader,
|
|
93
93
|
});
|
|
94
|
-
await
|
|
94
|
+
await new Promise((resolve, reject) => {
|
|
95
|
+
requestStream.data.on('error', reject);
|
|
96
|
+
processStream(generator()).then(resolve).catch(reject);
|
|
97
|
+
});
|
|
95
98
|
}
|
|
96
99
|
else if (this.dataFormat === 'json') {
|
|
97
100
|
const requestStream = await (0, axios_1.default)({ ...options, responseType: 'stream', }).catch(errorHandler);
|
|
@@ -100,14 +103,20 @@ class HttpProcessor extends processor_1.Processor {
|
|
|
100
103
|
.pipe((0, Pick_1.pick)({ filter: this.jsonPath || '' }))
|
|
101
104
|
.pipe((0, StreamValues_1.streamValues)())
|
|
102
105
|
.pipe((0, utils_1.getValueFromJSONChunk)());
|
|
103
|
-
await
|
|
106
|
+
await new Promise((resolve, reject) => {
|
|
107
|
+
requestStream.data.on('error', reject);
|
|
108
|
+
processStream(jsonStream).then(resolve).catch(reject);
|
|
109
|
+
});
|
|
104
110
|
}
|
|
105
111
|
else if (this.dataFormat === 'xml') {
|
|
106
112
|
const requestStream = await (0, axios_1.default)({ ...options, responseType: 'stream' }).catch(errorHandler);
|
|
107
113
|
const xmlStream = requestStream.data
|
|
108
114
|
.pipe(saxStream(this.saxOptions))
|
|
109
115
|
.pipe((0, utils_1.removeCircularReferencesFromChunk)());
|
|
110
|
-
await
|
|
116
|
+
await new Promise((resolve, reject) => {
|
|
117
|
+
requestStream.data.on('error', reject);
|
|
118
|
+
processStream(xmlStream).then(resolve).catch(reject);
|
|
119
|
+
});
|
|
111
120
|
}
|
|
112
121
|
if (this.nextRequest) {
|
|
113
122
|
const nextOptions = await this.nextRequest();
|