@social-mail/social-mail-client 1.8.324 → 1.8.325

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.
@@ -25759,9 +25759,6 @@ System.register(["tslib"], function (_export, _context) {
25759
25759
  tryUpload3(req) {
25760
25760
  return __awaiter(this, void 0, void 0, function* () {
25761
25761
  let lastError;
25762
- if (!req.sha256) {
25763
- req.sha256 = yield this.sha256(req.file);
25764
- }
25765
25762
  for (let index = 0; index < 3; index++) {
25766
25763
  try {
25767
25764
  return yield this.tryUpload(req);
@@ -25775,7 +25772,6 @@ System.register(["tslib"], function (_export, _context) {
25775
25772
  tryUpload({
25776
25773
  file,
25777
25774
  url,
25778
- sha256,
25779
25775
  extra,
25780
25776
  folder,
25781
25777
  cancelToken,
@@ -25784,7 +25780,6 @@ System.register(["tslib"], function (_export, _context) {
25784
25780
  return new Promise((resolve, reject) => {
25785
25781
  const body = new FormData();
25786
25782
  body.append(file.name, file, file.name);
25787
- body.append("sha256", sha256);
25788
25783
  const xhr = new XMLHttpRequest();
25789
25784
  const onError = () => {
25790
25785
  reject(new Error(xhr.responseText || "Error"));
@@ -26065,7 +26060,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
26065
26060
  return detail.files;
26066
26061
  });
26067
26062
  }
26068
- sha256(blob) {
26063
+ getSha256(blob) {
26069
26064
  return __awaiter(this, void 0, void 0, function* () {
26070
26065
  const msgBuffer = yield blob.arrayBuffer();
26071
26066
  const hashBuffer = yield crypto.subtle.digest('SHA-256', msgBuffer);
@@ -26074,7 +26069,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
26074
26069
  return hashHex;
26075
26070
  });
26076
26071
  }
26077
- uploadFileParts(file, extra, cancelToken, progress) {
26072
+ uploadFileParts(file, extra, sha256, cancelToken, progress) {
26078
26073
  return __awaiter(this, void 0, void 0, function* () {
26079
26074
  let size = file.size;
26080
26075
  const parts = [];
@@ -26107,7 +26102,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
26107
26102
  appFileID,
26108
26103
  folder
26109
26104
  } = extra;
26110
- const appFile = yield FetchBuilder.post(apiPath("/api/upload")).form("name", name).form("tempKeys", JSON.stringify(tempKeys)).form("contentType", file.type).query("parentID", parentID).query("appFileID", appFileID).query("folder", folder).asJson();
26105
+ const appFile = yield FetchBuilder.post(apiPath("/api/upload")).form("name", name).form("sha256", sha256).form("tempKeys", JSON.stringify(tempKeys)).form("contentType", file.type).query("parentID", parentID).query("appFileID", appFileID).query("folder", folder).asJson();
26111
26106
  return {
26112
26107
  url: appFile.url,
26113
26108
  downloadUrl: appFile.url,
@@ -26131,7 +26126,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
26131
26126
  if (typeof extra === "string") {
26132
26127
  extra = JSON.parse(extra);
26133
26128
  }
26134
- const sha256 = yield this.sha256(file);
26129
+ const sha256 = yield this.getSha256(file);
26135
26130
  if (extra === null || extra === void 0 ? void 0 : extra.parentID) {
26136
26131
  const existing = yield this.entityService.query(AppFile, "children", extra.parentID, folder ? folder + "/" + file.name : file.name, sha256).firstOrDefault();
26137
26132
  if (existing) {
@@ -26151,7 +26146,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
26151
26146
  extra !== null && extra !== void 0 ? extra : extra = {};
26152
26147
  extra.folder = folder;
26153
26148
  }
26154
- return yield this.uploadFileParts(file, extra, ct, progress);
26149
+ return yield this.uploadFileParts(file, extra, sha256, ct, progress);
26155
26150
  }
26156
26151
  return new Promise((resolve, reject) => {
26157
26152
  const body = new FormData();