bruce-models 5.6.8 → 5.6.9

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.
@@ -555,12 +555,6 @@
555
555
  if (this.ssidHeader) {
556
556
  params.headers[this.ssidHeader] = this.GetSessionId();
557
557
  }
558
- /**
559
- * If we support the legacy request and need it for progress, then we diverge there.
560
- */
561
- if (window && window["XMLHttpRequest"] && params.onProgress) {
562
- return legacyUpload(url, blob, params);
563
- }
564
558
  const formData = params.formData instanceof FormData ? params.formData : new FormData();
565
559
  if (formData.has("file")) {
566
560
  formData.delete("file");
@@ -582,60 +576,6 @@
582
576
  });
583
577
  }
584
578
  }
585
- /**
586
- * Performs a legacy upload with XMLHttpRequest.
587
- * Unfortunately, this is needed to track progress when it's supported.
588
- * Fetch doesn't have this capability.
589
- * @param url
590
- * @param blob
591
- * @param params
592
- */
593
- function legacyUpload(url, blob, params) {
594
- params = Object.assign({}, params);
595
- params.headers = Object.assign({}, params.headers);
596
- const formData = new FormData();
597
- formData.append("file", blob);
598
- if (params.formData && !(params.formData instanceof FormData)) {
599
- for (let key in params.formData) {
600
- if (key !== "file") {
601
- formData.append(key, params.formData[key]);
602
- }
603
- }
604
- }
605
- return new Promise((resolve, reject) => {
606
- const xhr = new window["XMLHttpRequest"]();
607
- xhr.open("POST", url, true);
608
- // Set custom headers.
609
- if (params.headers) {
610
- Object.entries(params.headers).forEach(([key, value]) => {
611
- xhr.setRequestHeader(key, value);
612
- });
613
- }
614
- // Progress event.
615
- xhr.upload.onprogress = (event) => {
616
- if ((params === null || params === void 0 ? void 0 : params.onProgress) && event.lengthComputable) {
617
- params.onProgress(event);
618
- }
619
- };
620
- // Success and error handling.
621
- xhr.onload = () => {
622
- if (xhr.status >= 200 && xhr.status < 300) {
623
- resolve(JSON.parse(xhr.responseText));
624
- }
625
- else {
626
- reject(new Error(`Failed to upload: ${xhr.status} ${xhr.statusText}`));
627
- }
628
- };
629
- xhr.onerror = () => reject(new Error("Network error occurred during file upload."));
630
- if (params.abortSignal) {
631
- params.abortSignal.addEventListener("abort", () => {
632
- xhr.abort();
633
- reject(new Error("Upload aborted."));
634
- });
635
- }
636
- xhr.send(formData);
637
- });
638
- }
639
579
 
640
580
  (function (MessageBroker) {
641
581
  let EAction;
@@ -8283,7 +8223,7 @@
8283
8223
  if (!api) {
8284
8224
  api = exports.ENVIRONMENT.Api().GetBruceApi();
8285
8225
  }
8286
- const FILE_PORTION_SIZE = 100000000; // 100MB.
8226
+ const FILE_PORTION_SIZE = 50000000; // 50MB.
8287
8227
  let fileSize = file.size;
8288
8228
  let fileOffset = 0;
8289
8229
  let filePartsCount = fileSize / FILE_PORTION_SIZE;
@@ -14968,7 +14908,7 @@
14968
14908
  })(exports.Scenario || (exports.Scenario = {}));
14969
14909
 
14970
14910
  // This is updated with the package.json version on build.
14971
- const VERSION = "5.6.8";
14911
+ const VERSION = "5.6.9";
14972
14912
 
14973
14913
  exports.VERSION = VERSION;
14974
14914
  exports.AbstractApi = AbstractApi;