bruce-models 4.0.6 → 4.0.8

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.
@@ -273,13 +273,28 @@ function parseResult(data) {
273
273
  else if (encoding === "iso-8859-1") {
274
274
  encoding = "utf-8";
275
275
  }
276
- const text = yield (encoding && encoding !== "utf-8"
276
+ let text = yield (encoding && encoding !== "utf-8"
277
277
  ? new TextDecoder(encoding).decode(yield data.arrayBuffer())
278
278
  : data.text());
279
279
  if (!(text === null || text === void 0 ? void 0 : text.trim())) {
280
280
  return null;
281
281
  }
282
- return (type === null || type === void 0 ? void 0 : type.includes("text/csv")) ? text : JSON.parse(text);
282
+ if (!type) {
283
+ type = "";
284
+ }
285
+ if (type.includes("application/octet-stream")) {
286
+ return new Blob([text]);
287
+ }
288
+ else if (type.includes("text/csv")) {
289
+ return text;
290
+ }
291
+ if (text && typeof text == "string") {
292
+ text = text.trim();
293
+ }
294
+ if (text && text.startsWith("{") && text.endsWith("}")) {
295
+ return JSON.parse(text);
296
+ }
297
+ return text;
283
298
  });
284
299
  }
285
300
  /**
@@ -9480,6 +9495,23 @@ var PendingAction;
9480
9495
  });
9481
9496
  }
9482
9497
  PendingAction.GetMessages = GetMessages;
9498
+ /**
9499
+ * Requests to cancel a pending action.
9500
+ * @param params
9501
+ */
9502
+ function Cancel(params) {
9503
+ return __awaiter(this, void 0, void 0, function* () {
9504
+ let { api, actionId, req: reqParams } = params;
9505
+ if (!actionId) {
9506
+ throw ("Action ID is required.");
9507
+ }
9508
+ if (!api) {
9509
+ api = ENVIRONMENT.Api().GetBruceApi();
9510
+ }
9511
+ yield api.DELETE(`pendingAction/${actionId}`, Api.PrepReqParams(reqParams));
9512
+ });
9513
+ }
9514
+ PendingAction.Cancel = Cancel;
9483
9515
  })(PendingAction || (PendingAction = {}));
9484
9516
 
9485
9517
  /**
@@ -11889,7 +11921,7 @@ var DataSource;
11889
11921
  })(DataSource || (DataSource = {}));
11890
11922
 
11891
11923
  // This is updated with the package.json version on build.
11892
- const VERSION = "4.0.6";
11924
+ const VERSION = "4.0.8";
11893
11925
 
11894
11926
  export { VERSION, AnnDocument, CustomForm, AbstractApi, Api, BruceApi, GlobalApi, GuardianApi, ApiGetters, Calculator, Bounds, BruceEvent, CacheControl, Camera, Cartes, Carto, Color, DelayQueue, Geometry, UTC, BruceVariable, LRUCache, EntityAttachmentType, EntityAttachment, EntityComment, EntityLink, EntityLod, EntityLodCategory, EntityRelationType, EntityRelation, EntitySource, EntityTag, EntityType, Entity, EntityCoords, EntityTypeVisualSettings, EntityAttribute, EntityHistoricData, ClientFile, ProgramKey, ZoomControl, MenuItem, ProjectViewBookmark, ProjectView, ProjectViewLegacyTile, ProjectViewTile, ProjectViewLegacy, ProjectViewLegacyBookmark, PendingAction, MessageBroker, HostingLocation, Style, Tileset, Permission, Session, UserGroup, User, Account, AccountInvite, AccountFeatures, EncryptUtils, MathUtils, ObjectUtils, PathUtils, UrlUtils, DataLab, ImportCad, ImportCsv, ImportJson, ImportKml, ImportedFile, Markup, Uploader, Plugin, ENVIRONMENT, DataSource };
11895
11927
  //# sourceMappingURL=bruce-models.es5.js.map