Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@uppy/aws-s3: remove deprecated prepareUploadParts option #5075

Merged
merged 5 commits into from Apr 11, 2024

Conversation

aduh95
Copy link
Member

@aduh95 aduh95 commented Apr 11, 2024

No description provided.

@aduh95 aduh95 changed the title @aws-s3: remove deprecated prepareUploadParts option @uppy/aws-s3: remove deprecated prepareUploadParts option Apr 11, 2024
Copy link
Contributor

Diff output files
diff --git a/packages/@uppy/aws-s3/lib/index.js b/packages/@uppy/aws-s3/lib/index.js
index 234780a..0ca0ff1 100644
--- a/packages/@uppy/aws-s3/lib/index.js
+++ b/packages/@uppy/aws-s3/lib/index.js
@@ -223,33 +223,6 @@ export default class AwsS3Multipart extends BasePlugin {
         this.opts[key] = dynamicDefaultOptions[key].bind(this);
       }
     }
-    if ((opts == null ? void 0 : opts.prepareUploadParts) != null && opts.signPart == null) {
-      this.opts.signPart = async (file, _ref3) => {
-        let {
-          uploadId,
-          key,
-          partNumber,
-          body,
-          signal,
-        } = _ref3;
-        const {
-          presignedUrls,
-          headers,
-        } = await opts.prepareUploadParts(file, {
-          uploadId,
-          key,
-          parts: [{
-            number: partNumber,
-            chunk: body,
-          }],
-          signal,
-        });
-        return {
-          url: presignedUrls == null ? void 0 : presignedUrls[partNumber],
-          headers: headers == null ? void 0 : headers[partNumber],
-        };
-      };
-    }
     this.requests = (_rateLimitedQueue = this.opts.rateLimitedQueue) != null
       ? _rateLimitedQueue
       : new RateLimitedQueue(this.opts.limit);
@@ -313,13 +286,13 @@ export default class AwsS3Multipart extends BasePlugin {
       signal,
     }).then(assertServerError);
   }
-  listParts(file, _ref4, oldSignal) {
+  listParts(file, _ref3, oldSignal) {
     var _signal;
     let {
       key,
       uploadId,
       signal,
-    } = _ref4;
+    } = _ref3;
     (_signal = signal) != null ? _signal : signal = oldSignal;
     this.assertHost("listParts");
     throwIfAborted(signal);
@@ -328,14 +301,14 @@ export default class AwsS3Multipart extends BasePlugin {
       signal,
     }).then(assertServerError);
   }
-  completeMultipartUpload(file, _ref5, oldSignal) {
+  completeMultipartUpload(file, _ref4, oldSignal) {
     var _signal2;
     let {
       key,
       uploadId,
       parts,
       signal,
-    } = _ref5;
+    } = _ref4;
     (_signal2 = signal) != null ? _signal2 : signal = oldSignal;
     this.assertHost("completeMultipartUpload");
     throwIfAborted(signal);
@@ -380,13 +353,13 @@ export default class AwsS3Multipart extends BasePlugin {
       },
     };
   }
-  signPart(file, _ref6) {
+  signPart(file, _ref5) {
     let {
       uploadId,
       key,
       partNumber,
       signal,
-    } = _ref6;
+    } = _ref5;
     this.assertHost("signPart");
     throwIfAborted(signal);
     if (uploadId == null || key == null || partNumber == null) {
@@ -400,13 +373,13 @@ export default class AwsS3Multipart extends BasePlugin {
       },
     ).then(assertServerError);
   }
-  abortMultipartUpload(file, _ref7, oldSignal) {
+  abortMultipartUpload(file, _ref6, oldSignal) {
     var _signal3;
     let {
       key,
       uploadId,
       signal,
-    } = _ref7;
+    } = _ref6;
     (_signal3 = signal) != null ? _signal3 : signal = oldSignal;
     this.assertHost("abortMultipartUpload");
     const filename = encodeURIComponent(key);
@@ -440,7 +413,7 @@ export default class AwsS3Multipart extends BasePlugin {
     });
     return _classPrivateFieldLooseBase(this, _client)[_client].get(`s3/params?${query}`, options);
   }
-  static async uploadPartBytes(_ref8) {
+  static async uploadPartBytes(_ref7) {
     let {
       signature: {
         url,
@@ -453,7 +426,7 @@ export default class AwsS3Multipart extends BasePlugin {
       onProgress,
       onComplete,
       signal,
-    } = _ref8;
+    } = _ref7;
     throwIfAborted(signal);
     if (url == null) {
       throw new Error("Cannot upload to an undefined URL");
@@ -492,7 +465,7 @@ export default class AwsS3Multipart extends BasePlugin {
         };
         reject(error);
       });
-      xhr.addEventListener("load", ev => {
+      xhr.addEventListener("load", () => {
         cleanup();
         if (xhr.status === 403 && xhr.responseText.includes("<Message>Request has expired</Message>")) {
           const error = new Error("Request has expired");

@aduh95 aduh95 merged commit f6734fe into 4.x Apr 11, 2024
16 checks passed
@aduh95 aduh95 deleted the aws-deprecated-byebye branch April 11, 2024 16:19
github-actions bot added a commit that referenced this pull request Apr 11, 2024
| Package                   |      Version | Package                   |      Version |
| ------------------------- | ------------ | ------------------------- | ------------ |
| @uppy/angular             | 0.7.0-beta.2 | @uppy/instagram           | 4.0.0-beta.2 |
| @uppy/audio               | 2.0.0-beta.2 | @uppy/onedrive            | 4.0.0-beta.2 |
| @uppy/aws-s3              | 4.0.0-beta.2 | @uppy/progress-bar        | 4.0.0-beta.2 |
| @uppy/aws-s3-multipart    | 4.0.0-beta.2 | @uppy/provider-views      | 4.0.0-beta.2 |
| @uppy/box                 | 3.0.0-beta.2 | @uppy/react               | 4.0.0-beta.2 |
| @uppy/companion           | 5.0.0-beta.2 | @uppy/remote-sources      | 2.0.0-beta.2 |
| @uppy/companion-client    | 4.0.0-beta.2 | @uppy/screen-capture      | 4.0.0-beta.2 |
| @uppy/compressor          | 2.0.0-beta.2 | @uppy/status-bar          | 4.0.0-beta.2 |
| @uppy/core                | 4.0.0-beta.2 | @uppy/thumbnail-generator | 4.0.0-beta.2 |
| @uppy/dashboard           | 4.0.0-beta.2 | @uppy/transloadit         | 4.0.0-beta.2 |
| @uppy/drag-drop           | 4.0.0-beta.2 | @uppy/tus                 | 4.0.0-beta.2 |
| @uppy/drop-target         | 3.0.0-beta.2 | @uppy/unsplash            | 4.0.0-beta.2 |
| @uppy/dropbox             | 4.0.0-beta.2 | @uppy/url                 | 4.0.0-beta.2 |
| @uppy/facebook            | 4.0.0-beta.2 | @uppy/utils               | 6.0.0-beta.2 |
| @uppy/file-input          | 4.0.0-beta.2 | @uppy/webcam              | 4.0.0-beta.2 |
| @uppy/golden-retriever    | 4.0.0-beta.2 | @uppy/zoom                | 3.0.0-beta.2 |
| @uppy/google-drive        | 4.0.0-beta.2 | uppy                      | 4.0.0-beta.2 |

- @uppy/aws-s3: default to multipart depending on the size of input (Antoine du Hamel / #5076)
- @uppy/aws-s3: remove deprecated `prepareUploadParts` option (Antoine du Hamel / #5075)
- @uppy/core: use variadic arguments for `uppy.use` (Antoine du Hamel / #4888)
- @uppy/aws-s3: remove legacy plugin (Antoine du Hamel / #5070)
- @uppy/locales: do not build `dist/` folder (Merlijn Vos / #5055)
- @uppy/angular: fix Angular version requirement in peerDeps (Antoine du Hamel / #5067)
- @uppy/transloadit: remove deprecated options (Merlijn Vos / #5056)




| Package          | Version | Package          | Version |
| ---------------- | ------- | ---------------- | ------- |
| @uppy/companion  |  4.13.1 | uppy             |  3.24.1 |
| @uppy/file-input |   3.1.1 |                  |         |

- @uppy/companion: upgrade redis (Mikael Finstad / #5065)
- meta: fix `watch:*` scripts (Antoine du Hamel / #5046)
- meta: include more packages in `compare_diff` CI (Antoine du Hamel / #5044)
- @uppy/file-input: add missing export (Antoine du Hamel / #5045)
- meta: Bump express from 4.18.1 to 4.19.2 in /packages/@uppy/companion (dependabot[bot] / #5036)
- @uppy/companion: Bump express from 4.18.1 to 4.19.2 (dependabot[bot] / #5037)
Murderlon added a commit that referenced this pull request Apr 17, 2024
* 4.x: (34 commits)
  Release: uppy@3.24.3 (#5091)
  docs: add back markdown files (#5064)
  meta: fix custom provider example (#5079)
  @uppy/utils: add fetcher (#5073)
  Fix prettier
  @uppy/dashboard: add missing `x-zip-compress` archive type (#5081)
  Bump docker/metadata-action from 4 to 5 (#5086)
  Bump actions/setup-node from 3 to 4 (#5087)
  Bump docker/setup-qemu-action from 2 to 3 (#5089)
  meta: bump supercharge/redis-github-action from 1.4.0 to 1.8.0 (#5090)
  meta: bump actions/cache from 3 to 4 (#5088)
  Release: uppy@4.0.0-beta.3 (#5085)
  meta: add `dependabot.yml` to keep GHA up-to-date (#5083)
  Release: uppy@3.24.2 (#5084)
  @uppy/core: fix `setOptions` not re-rendereing plugin UI (#5082)
  Release: uppy@4.0.0-beta.2 (#5077)
  @uppy/aws-s3: default to multipart depending on the size of input (#5076)
  @uppy/aws-s3: remove deprecated `prepareUploadParts` option (#5075)
  fixup! @uppy/core: use variadic arguments for `uppy.use` (#4888)
  @uppy/core: use variadic arguments for `uppy.use` (#4888)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant