@milaboratories/pl-drivers 1.3.11 → 1.3.12
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/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/drivers/upload.ts +21 -3
package/package.json
CHANGED
package/src/drivers/upload.ts
CHANGED
|
@@ -289,10 +289,28 @@ class ProgressUpdater {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
public mustGetProgress(blobExists: boolean) {
|
|
292
|
+
// We provide a deep copy of progress,
|
|
293
|
+
// since we do not want to pass a mutable object
|
|
294
|
+
// to API, it led to bugs before.
|
|
295
|
+
|
|
296
|
+
// We do not use '...' cloning syntax
|
|
297
|
+
// for the compiler to fail here if we change API.
|
|
298
|
+
const progress: sdk.ImportProgress = {
|
|
299
|
+
done: this.progress.done,
|
|
300
|
+
isUpload: this.progress.isUpload,
|
|
301
|
+
isUploadSignMatch: this.progress.isUploadSignMatch,
|
|
302
|
+
lastError: this.progress.lastError
|
|
303
|
+
};
|
|
304
|
+
if (this.progress.status)
|
|
305
|
+
progress.status = {
|
|
306
|
+
progress: this.progress.status.progress,
|
|
307
|
+
bytesProcessed: this.progress.status.bytesProcessed,
|
|
308
|
+
bytesTotal: this.progress.status.bytesTotal
|
|
309
|
+
};
|
|
310
|
+
|
|
292
311
|
if (blobExists) {
|
|
293
312
|
this.setDone(blobExists);
|
|
294
|
-
|
|
295
|
-
return this.progress;
|
|
313
|
+
return progress;
|
|
296
314
|
}
|
|
297
315
|
|
|
298
316
|
if (this.uploadingTerminallyFailed) {
|
|
@@ -300,7 +318,7 @@ class ProgressUpdater {
|
|
|
300
318
|
throw new Error(this.progress.lastError);
|
|
301
319
|
}
|
|
302
320
|
|
|
303
|
-
return
|
|
321
|
+
return progress;
|
|
304
322
|
}
|
|
305
323
|
|
|
306
324
|
public attach(w: Watcher, callerId: string) {
|