bruce-models 0.3.9 → 0.4.1

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.
@@ -116,6 +116,7 @@
116
116
  ECacheKey["UserGroup"] = "usergroup";
117
117
  ECacheKey["Account"] = "account";
118
118
  ECacheKey["CustomForm"] = "customform";
119
+ ECacheKey["ImportedFile"] = "importedfile";
119
120
  })(ECacheKey = Api.ECacheKey || (Api.ECacheKey = {}));
120
121
  Api.DEFAULT_CACHE_DURATION = 60 * 5; // 5 minutes.
121
122
  Api.TEMPLATE_ACCOUNT_ID = "template";
@@ -607,6 +608,11 @@
607
608
  xhr_1.setRequestHeader(_this.ssidHeader, _this.ssid);
608
609
  }
609
610
  var formData = new FormData();
611
+ if (params === null || params === void 0 ? void 0 : params.formData) {
612
+ for (var key in params.formData) {
613
+ formData.append(key, params.formData[key]);
614
+ }
615
+ }
610
616
  formData.append("file", blob);
611
617
  xhr_1.send(formData);
612
618
  }
@@ -3655,13 +3661,20 @@
3655
3661
  });
3656
3662
  }
3657
3663
  ClientFile.Delete = Delete;
3658
- function Upload(api, file, onProgress) {
3664
+ function Upload(api, file, purpose, onProgress) {
3659
3665
  return __awaiter(this, void 0, void 0, function () {
3666
+ var formData;
3660
3667
  return __generator(this, function (_a) {
3661
3668
  if (!file) {
3662
3669
  throw ("File is required.");
3663
3670
  }
3664
- return [2 /*return*/, api.UPLOAD("file/uploadNew", file, { onProgress: onProgress })];
3671
+ formData = null;
3672
+ if (purpose) {
3673
+ formData = {
3674
+ "Purpose": purpose
3675
+ };
3676
+ }
3677
+ return [2 /*return*/, api.UPLOAD("file/uploadNew", file, { onProgress: onProgress, formData: formData })];
3665
3678
  });
3666
3679
  });
3667
3680
  }