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.
@@ -111,6 +111,7 @@ var Api;
111
111
  ECacheKey["UserGroup"] = "usergroup";
112
112
  ECacheKey["Account"] = "account";
113
113
  ECacheKey["CustomForm"] = "customform";
114
+ ECacheKey["ImportedFile"] = "importedfile";
114
115
  })(ECacheKey = Api.ECacheKey || (Api.ECacheKey = {}));
115
116
  Api.DEFAULT_CACHE_DURATION = 60 * 5; // 5 minutes.
116
117
  Api.TEMPLATE_ACCOUNT_ID = "template";
@@ -612,6 +613,11 @@ var AbstractApi = /** @class */ (function () {
612
613
  xhr_1.setRequestHeader(_this.ssidHeader, _this.ssid);
613
614
  }
614
615
  var formData = new FormData();
616
+ if (params === null || params === void 0 ? void 0 : params.formData) {
617
+ for (var key in params.formData) {
618
+ formData.append(key, params.formData[key]);
619
+ }
620
+ }
615
621
  formData.append("file", blob);
616
622
  xhr_1.send(formData);
617
623
  }
@@ -3758,13 +3764,20 @@ var ClientFile;
3758
3764
  });
3759
3765
  }
3760
3766
  ClientFile.Delete = Delete;
3761
- function Upload(api, file, onProgress) {
3767
+ function Upload(api, file, purpose, onProgress) {
3762
3768
  return __awaiter(this, void 0, void 0, function () {
3769
+ var formData;
3763
3770
  return __generator(this, function (_a) {
3764
3771
  if (!file) {
3765
3772
  throw ("File is required.");
3766
3773
  }
3767
- return [2 /*return*/, api.UPLOAD("file/uploadNew", file, { onProgress: onProgress })];
3774
+ formData = null;
3775
+ if (purpose) {
3776
+ formData = {
3777
+ "Purpose": purpose
3778
+ };
3779
+ }
3780
+ return [2 /*return*/, api.UPLOAD("file/uploadNew", file, { onProgress: onProgress, formData: formData })];
3768
3781
  });
3769
3782
  });
3770
3783
  }