@milaboratories/pl-drivers 1.3.11 → 1.3.13

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": "@milaboratories/pl-drivers",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
4
4
  "description": "Drivers and a low-level clients for log streaming, downloading and uploading files from and to pl",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -27,9 +27,9 @@
27
27
  "undici": "^6.20.1",
28
28
  "zod": "^3.23.8",
29
29
  "@milaboratories/ts-helpers": "^1.1.1",
30
+ "@milaboratories/pl-client": "^2.5.9",
30
31
  "@milaboratories/computable": "^2.2.1",
31
- "@milaboratories/pl-client": "^2.5.8",
32
- "@milaboratories/pl-tree": "^1.4.9",
32
+ "@milaboratories/pl-tree": "^1.4.10",
33
33
  "@milaboratories/pl-model-common": "^1.5.2"
34
34
  },
35
35
  "devDependencies": {
@@ -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 this.progress;
321
+ return progress;
304
322
  }
305
323
 
306
324
  public attach(w: Watcher, callerId: string) {