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.
@@ -550,12 +550,6 @@ class AbstractApi {
550
550
  if (this.ssidHeader) {
551
551
  params.headers[this.ssidHeader] = this.GetSessionId();
552
552
  }
553
- /**
554
- * If we support the legacy request and need it for progress, then we diverge there.
555
- */
556
- if (window && window["XMLHttpRequest"] && params.onProgress) {
557
- return legacyUpload(url, blob, params);
558
- }
559
553
  const formData = params.formData instanceof FormData ? params.formData : new FormData();
560
554
  if (formData.has("file")) {
561
555
  formData.delete("file");
@@ -577,60 +571,6 @@ class AbstractApi {
577
571
  });
578
572
  }
579
573
  }
580
- /**
581
- * Performs a legacy upload with XMLHttpRequest.
582
- * Unfortunately, this is needed to track progress when it's supported.
583
- * Fetch doesn't have this capability.
584
- * @param url
585
- * @param blob
586
- * @param params
587
- */
588
- function legacyUpload(url, blob, params) {
589
- params = Object.assign({}, params);
590
- params.headers = Object.assign({}, params.headers);
591
- const formData = new FormData();
592
- formData.append("file", blob);
593
- if (params.formData && !(params.formData instanceof FormData)) {
594
- for (let key in params.formData) {
595
- if (key !== "file") {
596
- formData.append(key, params.formData[key]);
597
- }
598
- }
599
- }
600
- return new Promise((resolve, reject) => {
601
- const xhr = new window["XMLHttpRequest"]();
602
- xhr.open("POST", url, true);
603
- // Set custom headers.
604
- if (params.headers) {
605
- Object.entries(params.headers).forEach(([key, value]) => {
606
- xhr.setRequestHeader(key, value);
607
- });
608
- }
609
- // Progress event.
610
- xhr.upload.onprogress = (event) => {
611
- if ((params === null || params === void 0 ? void 0 : params.onProgress) && event.lengthComputable) {
612
- params.onProgress(event);
613
- }
614
- };
615
- // Success and error handling.
616
- xhr.onload = () => {
617
- if (xhr.status >= 200 && xhr.status < 300) {
618
- resolve(JSON.parse(xhr.responseText));
619
- }
620
- else {
621
- reject(new Error(`Failed to upload: ${xhr.status} ${xhr.statusText}`));
622
- }
623
- };
624
- xhr.onerror = () => reject(new Error("Network error occurred during file upload."));
625
- if (params.abortSignal) {
626
- params.abortSignal.addEventListener("abort", () => {
627
- xhr.abort();
628
- reject(new Error("Upload aborted."));
629
- });
630
- }
631
- xhr.send(formData);
632
- });
633
- }
634
574
 
635
575
  /**
636
576
  * TODO: rewrite.
@@ -8436,7 +8376,7 @@ var Uploader;
8436
8376
  if (!api) {
8437
8377
  api = ENVIRONMENT.Api().GetBruceApi();
8438
8378
  }
8439
- const FILE_PORTION_SIZE = 100000000; // 100MB.
8379
+ const FILE_PORTION_SIZE = 50000000; // 50MB.
8440
8380
  let fileSize = file.size;
8441
8381
  let fileOffset = 0;
8442
8382
  let filePartsCount = fileSize / FILE_PORTION_SIZE;
@@ -15271,7 +15211,7 @@ var Scenario;
15271
15211
  })(Scenario || (Scenario = {}));
15272
15212
 
15273
15213
  // This is updated with the package.json version on build.
15274
- const VERSION = "5.6.8";
15214
+ const VERSION = "5.6.9";
15275
15215
 
15276
15216
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, GeoJson, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityAttribute, EntityHistoricData, EntityTableView, Comment, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, ProjectViewBookmarkGroup, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, AccountLimits, AccountTemplate, AccountType, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, DataLabGroup, ImportAssembly, ImportCad, ImportCsv, ImportJson, ImportGeoJson, ImportKml, ImportedFile, ExportBrz, ExportUsd, Markup, Uploader, Plugin, ENVIRONMENT, DataSource, Scenario };
15277
15217
  //# sourceMappingURL=bruce-models.es5.js.map