http-request-manager 18.15.24 → 18.15.25
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.
|
@@ -1000,12 +1000,10 @@ class StreamingProcessor {
|
|
|
1000
1000
|
if (event.body) {
|
|
1001
1001
|
this.buffer = typeof event.body === 'string' ? event.body : this.buffer;
|
|
1002
1002
|
const parsedData = this.parseBuffer();
|
|
1003
|
-
// Calculate final progress
|
|
1004
|
-
const total = this.totalFromHeader ?? event.total;
|
|
1003
|
+
// Calculate final progress
|
|
1005
1004
|
const received = this.totalFromHeader ? parsedData.length : event.loaded;
|
|
1006
1005
|
const progress = {
|
|
1007
1006
|
received,
|
|
1008
|
-
total,
|
|
1009
1007
|
percent: 100,
|
|
1010
1008
|
stage: 'complete'
|
|
1011
1009
|
};
|
|
@@ -2959,7 +2957,7 @@ class RequestService extends WebsocketService {
|
|
|
2959
2957
|
reportProgress: true
|
|
2960
2958
|
}).pipe(
|
|
2961
2959
|
// tap(data => console.log('STREAM DATA', data)),
|
|
2962
|
-
requestStreaming({ streamType: options.streamType || StreamType.NDJSON }), this.requestStreaming(options), this.handleFinalize())
|
|
2960
|
+
requestStreaming({ streamType: options.streamType || StreamType.NDJSON, totalHeader: 'X-Total-Count' }), this.requestStreaming(options), this.handleFinalize())
|
|
2963
2961
|
: this.http.get(urlPath, headers).pipe(this.request(options));
|
|
2964
2962
|
}
|
|
2965
2963
|
createRecordRequest(options, data) {
|
|
@@ -2972,7 +2970,7 @@ class RequestService extends WebsocketService {
|
|
|
2972
2970
|
observe: 'events',
|
|
2973
2971
|
responseType: 'text',
|
|
2974
2972
|
reportProgress: true
|
|
2975
|
-
}).pipe(requestStreaming({ streamType: options.streamType || StreamType.NDJSON }), this.requestStreaming(options), this.handleFinalize())
|
|
2973
|
+
}).pipe(requestStreaming({ streamType: options.streamType || StreamType.NDJSON, totalHeader: 'X-Total-Count' }), this.requestStreaming(options), this.handleFinalize())
|
|
2976
2974
|
: this.http.post(urlPath, data, headers).pipe(this.request(options));
|
|
2977
2975
|
}
|
|
2978
2976
|
updateRecordRequest(options, data) {
|