@social-mail/social-mail-client 1.8.29 → 1.8.31

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.
@@ -38,7 +38,7 @@ self.addEventListener('fetch', (event) => {
38
38
  if (url.host !== location.host) {
39
39
  return;
40
40
  }
41
- if (url.pathname.startsWith("/api/")) {
41
+ if (/^\/(api|social-mail\/api)\//.test(url.pathname)) {
42
42
  return;
43
43
  }
44
44
  const requestCopy = request.clone();
@@ -23218,22 +23218,20 @@ System.register(["tslib", "@web-atoms/core/dist/core/XNode", "@web-atoms/core/di
23218
23218
 
23219
23219
  AmdLoader.instance.setup("@social-mail/social-mail-client/dist/common/FileUploader");
23220
23220
 
23221
- System.register(["tslib", "@web-atoms/entity/dist/models/TaskManager"], function (_export, _context) {
23221
+ System.register(["tslib"], function (_export, _context) {
23222
23222
  "use strict";
23223
23223
 
23224
- var __awaiter, TaskManager, FileUploader;
23224
+ var __awaiter, FileUploader;
23225
23225
  _export("default", void 0);
23226
23226
  return {
23227
23227
  setters: [function (_tslib) {
23228
23228
  __awaiter = _tslib.__awaiter;
23229
- }, function (_webAtomsEntityDistModelsTaskManager) {
23230
- TaskManager = _webAtomsEntityDistModelsTaskManager.default;
23231
23229
  }],
23232
23230
  execute: function () {
23233
23231
  ;
23234
- _export("default", FileUploader = class FileUploader extends TaskManager {
23235
- constructor() {
23236
- super(...arguments);
23232
+ _export("default", FileUploader = class FileUploader {
23233
+ constructor(tm) {
23234
+ this.tm = tm;
23237
23235
  this.rateLimit = 4;
23238
23236
  }
23239
23237
  upload(req) {
@@ -23250,7 +23248,7 @@ System.register(["tslib", "@web-atoms/entity/dist/models/TaskManager"], function
23250
23248
  result.done = n;
23251
23249
  progress === null || progress === void 0 ? void 0 : progress(n);
23252
23250
  };
23253
- result.promise = this.queueRun(() => this.tryUpload3(req));
23251
+ result.promise = this.tm.queueRun(() => this.tryUpload3(req));
23254
23252
  return result;
23255
23253
  }
23256
23254
  sha256(blob) {
@@ -23587,7 +23585,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
23587
23585
  const tasks = [];
23588
23586
  const maxSize = 4 * 1024 * 1024;
23589
23587
  let start = 0;
23590
- const fud = new FileUploader();
23588
+ const fud = new FileUploader(this);
23591
23589
  while (size > 0) {
23592
23590
  const blobSize = Math.min(maxSize, file.size - start);
23593
23591
  const part = new File([file.slice(start, start + blobSize)], "file.dat");
@@ -23734,7 +23732,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
23734
23732
  error: "",
23735
23733
  progress: 0
23736
23734
  };
23737
- uploadFile.promise = this.queueRun(() => __awaiter(this, void 0, void 0, function* () {
23735
+ uploadFile.promise = (() => __awaiter(this, void 0, void 0, function* () {
23738
23736
  var _a, _b;
23739
23737
  let targetFile = file;
23740
23738
  if (convert) {
@@ -23760,7 +23758,7 @@ System.register(["tslib", "@web-atoms/core/dist/App", "@web-atoms/core/dist/core
23760
23758
  if (lastError) {
23761
23759
  upload.error += "\n" + lastError;
23762
23760
  }
23763
- }));
23761
+ }))();
23764
23762
  tasks.push(uploadFile);
23765
23763
  }
23766
23764
  return upload;