http-request-manager 18.15.23 → 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.
|
@@ -988,9 +988,7 @@ class StreamingProcessor {
|
|
|
988
988
|
received,
|
|
989
989
|
total,
|
|
990
990
|
percent,
|
|
991
|
-
stage: 'streaming'
|
|
992
|
-
bytesLoaded: event.loaded,
|
|
993
|
-
bytesTotal: event.total
|
|
991
|
+
stage: 'streaming'
|
|
994
992
|
};
|
|
995
993
|
return {
|
|
996
994
|
data: newItems.length > 0 ? newItems : [],
|
|
@@ -1002,16 +1000,12 @@ class StreamingProcessor {
|
|
|
1002
1000
|
if (event.body) {
|
|
1003
1001
|
this.buffer = typeof event.body === 'string' ? event.body : this.buffer;
|
|
1004
1002
|
const parsedData = this.parseBuffer();
|
|
1005
|
-
// Calculate final progress
|
|
1006
|
-
const total = this.totalFromHeader ?? event.total;
|
|
1003
|
+
// Calculate final progress
|
|
1007
1004
|
const received = this.totalFromHeader ? parsedData.length : event.loaded;
|
|
1008
1005
|
const progress = {
|
|
1009
1006
|
received,
|
|
1010
|
-
total,
|
|
1011
1007
|
percent: 100,
|
|
1012
|
-
stage: 'complete'
|
|
1013
|
-
bytesLoaded: event.loaded,
|
|
1014
|
-
bytesTotal: event.total
|
|
1008
|
+
stage: 'complete'
|
|
1015
1009
|
};
|
|
1016
1010
|
return {
|
|
1017
1011
|
data: parsedData.length > 0 ? parsedData : [],
|
|
@@ -2963,7 +2957,7 @@ class RequestService extends WebsocketService {
|
|
|
2963
2957
|
reportProgress: true
|
|
2964
2958
|
}).pipe(
|
|
2965
2959
|
// tap(data => console.log('STREAM DATA', data)),
|
|
2966
|
-
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())
|
|
2967
2961
|
: this.http.get(urlPath, headers).pipe(this.request(options));
|
|
2968
2962
|
}
|
|
2969
2963
|
createRecordRequest(options, data) {
|
|
@@ -2976,7 +2970,7 @@ class RequestService extends WebsocketService {
|
|
|
2976
2970
|
observe: 'events',
|
|
2977
2971
|
responseType: 'text',
|
|
2978
2972
|
reportProgress: true
|
|
2979
|
-
}).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())
|
|
2980
2974
|
: this.http.post(urlPath, data, headers).pipe(this.request(options));
|
|
2981
2975
|
}
|
|
2982
2976
|
updateRecordRequest(options, data) {
|