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.
@@ -278,13 +278,28 @@
278
278
  else if (encoding === "iso-8859-1") {
279
279
  encoding = "utf-8";
280
280
  }
281
- const text = yield (encoding && encoding !== "utf-8"
281
+ let text = yield (encoding && encoding !== "utf-8"
282
282
  ? new TextDecoder(encoding).decode(yield data.arrayBuffer())
283
283
  : data.text());
284
284
  if (!(text === null || text === void 0 ? void 0 : text.trim())) {
285
285
  return null;
286
286
  }
287
- return (type === null || type === void 0 ? void 0 : type.includes("text/csv")) ? text : JSON.parse(text);
287
+ if (!type) {
288
+ type = "";
289
+ }
290
+ if (type.includes("application/octet-stream")) {
291
+ return new Blob([text]);
292
+ }
293
+ else if (type.includes("text/csv")) {
294
+ return text;
295
+ }
296
+ if (text && typeof text == "string") {
297
+ text = text.trim();
298
+ }
299
+ if (text && text.startsWith("{") && text.endsWith("}")) {
300
+ return JSON.parse(text);
301
+ }
302
+ return text;
288
303
  });
289
304
  }
290
305
  /**
@@ -9283,6 +9298,23 @@
9283
9298
  });
9284
9299
  }
9285
9300
  PendingAction.GetMessages = GetMessages;
9301
+ /**
9302
+ * Requests to cancel a pending action.
9303
+ * @param params
9304
+ */
9305
+ function Cancel(params) {
9306
+ return __awaiter(this, void 0, void 0, function* () {
9307
+ let { api, actionId, req: reqParams } = params;
9308
+ if (!actionId) {
9309
+ throw ("Action ID is required.");
9310
+ }
9311
+ if (!api) {
9312
+ api = exports.ENVIRONMENT.Api().GetBruceApi();
9313
+ }
9314
+ yield api.DELETE(`pendingAction/${actionId}`, exports.Api.PrepReqParams(reqParams));
9315
+ });
9316
+ }
9317
+ PendingAction.Cancel = Cancel;
9286
9318
  })(exports.PendingAction || (exports.PendingAction = {}));
9287
9319
 
9288
9320
  (function (Style) {
@@ -11630,7 +11662,7 @@
11630
11662
  })(exports.DataSource || (exports.DataSource = {}));
11631
11663
 
11632
11664
  // This is updated with the package.json version on build.
11633
- const VERSION = "4.0.6";
11665
+ const VERSION = "4.0.8";
11634
11666
 
11635
11667
  exports.VERSION = VERSION;
11636
11668
  exports.AbstractApi = AbstractApi;