easyproctor 0.0.63 → 0.0.64

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/esm/index.js CHANGED
@@ -49426,6 +49426,7 @@ var sas = "";
49426
49426
  var blobServiceClient;
49427
49427
  var message = "";
49428
49428
  var loadingInterval;
49429
+ var loadingBoolean = true;
49429
49430
  async function setConfiguration(_account, _cointainerName, _sas) {
49430
49431
  account = _account;
49431
49432
  containerName = _cointainerName;
@@ -49494,7 +49495,6 @@ async function uploadBackup(data, config2) {
49494
49495
  }
49495
49496
  });
49496
49497
  try {
49497
- let loadingBoolean = true;
49498
49498
  let i = 0;
49499
49499
  onProgress && onProgress(Math.round(0));
49500
49500
  loadingInterval = setInterval(() => {
@@ -49520,15 +49520,16 @@ async function uploadBackup(data, config2) {
49520
49520
  message += "\n\u2022 Error on AWS upload\n ";
49521
49521
  message += err;
49522
49522
  try {
49523
- download(data.file);
49523
+ download(data);
49524
49524
  } catch (err2) {
49525
49525
  throw err2;
49526
49526
  }
49527
49527
  throw err;
49528
49528
  }
49529
49529
  }
49530
- function download(file) {
49530
+ function download(data) {
49531
49531
  try {
49532
+ const { file, onProgress } = data;
49532
49533
  const url = URL.createObjectURL(file);
49533
49534
  const a = document.createElement("a");
49534
49535
  document.body.appendChild(a);
@@ -49537,9 +49538,12 @@ function download(file) {
49537
49538
  a.download = file.name;
49538
49539
  a.click();
49539
49540
  window.URL.revokeObjectURL(url);
49541
+ loadingBoolean = false;
49542
+ clearInterval(loadingInterval);
49543
+ onProgress && onProgress(Math.round(100));
49540
49544
  } catch (err) {
49541
49545
  message += `
49542
- \u2022 Error on machine download -> ${file.name}
49546
+ \u2022 Error on machine download
49543
49547
  `;
49544
49548
  throw err;
49545
49549
  }
package/index.js CHANGED
@@ -74187,6 +74187,7 @@ var sas = "";
74187
74187
  var blobServiceClient;
74188
74188
  var message = "";
74189
74189
  var loadingInterval;
74190
+ var loadingBoolean = true;
74190
74191
  async function setConfiguration(_account, _cointainerName, _sas) {
74191
74192
  account = _account;
74192
74193
  containerName = _cointainerName;
@@ -74255,7 +74256,6 @@ async function uploadBackup(data, config2) {
74255
74256
  }
74256
74257
  });
74257
74258
  try {
74258
- let loadingBoolean = true;
74259
74259
  let i = 0;
74260
74260
  onProgress && onProgress(Math.round(0));
74261
74261
  loadingInterval = setInterval(() => {
@@ -74281,15 +74281,16 @@ async function uploadBackup(data, config2) {
74281
74281
  message += "\n\u2022 Error on AWS upload\n ";
74282
74282
  message += err;
74283
74283
  try {
74284
- download(data.file);
74284
+ download(data);
74285
74285
  } catch (err2) {
74286
74286
  throw err2;
74287
74287
  }
74288
74288
  throw err;
74289
74289
  }
74290
74290
  }
74291
- function download(file) {
74291
+ function download(data) {
74292
74292
  try {
74293
+ const { file, onProgress } = data;
74293
74294
  const url = URL.createObjectURL(file);
74294
74295
  const a = document.createElement("a");
74295
74296
  document.body.appendChild(a);
@@ -74298,9 +74299,12 @@ function download(file) {
74298
74299
  a.download = file.name;
74299
74300
  a.click();
74300
74301
  window.URL.revokeObjectURL(url);
74302
+ loadingBoolean = false;
74303
+ clearInterval(loadingInterval);
74304
+ onProgress && onProgress(Math.round(100));
74301
74305
  } catch (err) {
74302
74306
  message += `
74303
- \u2022 Error on machine download -> ${file.name}
74307
+ \u2022 Error on machine download
74304
74308
  `;
74305
74309
  throw err;
74306
74310
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easyproctor",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
4
4
  "description": "Modulo web de gravação do EasyProctor",
5
5
  "main": "./index.js",
6
6
  "module": "./esm/index.js",