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/tus: set response from tus-js-client #5456

Merged
merged 3 commits into from
Sep 19, 2024
Merged

@uppy/tus: set response from tus-js-client #5456

merged 3 commits into from
Sep 19, 2024

Conversation

Murderlon
Copy link
Member

@Murderlon Murderlon commented Sep 11, 2024

Closes #5444

@Murderlon Murderlon self-assigned this Sep 11, 2024
Copy link
Contributor

Diff output files
diff --git a/packages/@uppy/tus/lib/index.js b/packages/@uppy/tus/lib/index.js
index c39418d..58cc391 100644
--- a/packages/@uppy/tus/lib/index.js
+++ b/packages/@uppy/tus/lib/index.js
@@ -225,12 +225,14 @@ function _uploadLocalFile2(file) {
         bytesTotal,
       });
     };
-    uploadOptions.onSuccess = () => {
+    uploadOptions.onSuccess = payload => {
       var _upload$url;
       const uploadResp = {
         uploadURL: (_upload$url = upload.url) != null ? _upload$url : undefined,
         status: 200,
-        body: {},
+        body: {
+          xhr: payload.lastResponse.getUnderlyingObject(),
+        },
       };
       this.resetUploaderReferences(file.id);
       queuedRequest.done();
@@ -242,7 +244,7 @@ function _uploadLocalFile2(file) {
         this.uppy.log(`Download ${name} from ${upload.url}`);
       }
       if (typeof opts.onSuccess === "function") {
-        opts.onSuccess();
+        opts.onSuccess(payload);
       }
       resolve(upload);
     };

Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher

🚮 Removed packages: npm/lodash@4.17.21

View full report↗︎

@Murderlon Murderlon merged commit f665a5a into main Sep 19, 2024
21 checks passed
@Murderlon Murderlon deleted the tus-body branch September 19, 2024 08:44
@github-actions github-actions bot mentioned this pull request Sep 20, 2024
github-actions bot added a commit that referenced this pull request Sep 20, 2024
| Package           | Version | Package           | Version |
| ----------------- | ------- | ----------------- | ------- |
| @uppy/companion   |   5.1.1 | @uppy/tus         |   4.1.1 |
| @uppy/svelte      |   4.0.2 | @uppy/xhr-upload  |   4.2.0 |
| @uppy/transloadit |   4.1.1 | uppy              |   4.4.0 |

- @uppy/tus: fix retry check for status code 400 (Merlijn Vos / #5461)
- meta: Merge branch 'main' of https://github.com/transloadit/uppy (Murderlon)
- meta: fix AwsS3 endpoint option in private/dev (Murderlon)
- examples: build(deps): bump body-parser from 1.20.2 to 1.20.3 (dependabot[bot] / #5462)
- examples: build(deps-dev): bump vite from 5.3.1 to 5.3.6 (dependabot[bot] / #5459)
- @uppy/tus: set response from tus-js-client (Merlijn Vos / #5456)
- docs: fix assemblyOptions example for React (Merlijn Vos / #5450)
- docs: rename Edgly to Smart CDN (Merlijn Vos / #5449)
- @uppy/tus: correctly type tus on UppyFile (Merlijn Vos / #5454)
- docs: remove old legacy CDN reference (Murderlon)
- @uppy/xhr-upload: pass files to onBeforeRequest (Merlijn Vos / #5447)
- @uppy/svelte: fix generated module to not bundle Svelte (Antoine du Hamel / #5446)
- examples,@uppy/svelte: Bump svelte from 4.2.18 to 4.2.19 (dependabot[bot] / #5440)
- meta: bump Yarn to 4.4.1 (Antoine du Hamel / #5445)
- docs: fix broken links in locale docs (Serghei Cebotari / #5441)
Murderlon added a commit that referenced this pull request Oct 7, 2024
* main: (319 commits)
  build(deps): bump docker/build-push-action from 6.8.0 to 6.9.0 (#5483)
  Release: uppy@4.4.1 (#5479)
  @uppy/transloadit: fix multiple upload batches & run again (#5478)
  build(deps): bump docker/build-push-action from 6.7.0 to 6.8.0 (#5477)
  build(deps): bump vite from 5.2.11 to 5.4.8 (#5471)
  build(deps-dev): bump rollup from 4.18.0 to 4.22.4 (#5470)
  build(deps): bump vite from 5.2.11 to 5.4.6 (#5466)
  Release: uppy@4.4.0 (#5467)
  @uppy/tus: fix retry check for status code 400 (#5461)
  meta: fix AwsS3 endpoint option in private/dev
  build(deps): bump body-parser from 1.20.2 to 1.20.3 (#5462)
  build(deps-dev): bump vite from 5.3.1 to 5.3.6 (#5459)
  @uppy/tus: set response from tus-js-client (#5456)
  docs: fix assemblyOptions example for React (#5450)
  docs: rename Edgly to Smart CDN (#5449)
  @uppy/tus: correctly type tus on UppyFile (#5454)
  docs: remove old legacy CDN reference
  @uppy/xhr-upload: pass files to onBeforeRequest (#5447)
  @uppy/svelte: fix generated module to not bundle Svelte (#5446)
  Bump svelte from 4.2.18 to 4.2.19 (#5440)
  ...
Murderlon added a commit that referenced this pull request Oct 15, 2024
* main: (65 commits)
  `.handleInputChange()` - use `.currentTarget`; clear the input using `''` (#5381)
  build(deps): bump @blakeembrey/template from 1.1.0 to 1.2.0 (#5448)
  Update packages/@uppy/locales/src/fr_FR.ts (#5472)
  @uppy/svelte: use SvelteKit as the build tool (#5484)
  @uppy/xhr-upload: add response to upload-error callback (#5486)
  tus: Avoid duplicate `upload-error` event (#5485)
  Fix redis emitter (#5474)
  build(deps): bump docker/build-push-action from 6.8.0 to 6.9.0 (#5483)
  Release: uppy@4.4.1 (#5479)
  @uppy/transloadit: fix multiple upload batches & run again (#5478)
  build(deps): bump docker/build-push-action from 6.7.0 to 6.8.0 (#5477)
  build(deps): bump vite from 5.2.11 to 5.4.8 (#5471)
  build(deps-dev): bump rollup from 4.18.0 to 4.22.4 (#5470)
  build(deps): bump vite from 5.2.11 to 5.4.6 (#5466)
  Release: uppy@4.4.0 (#5467)
  @uppy/tus: fix retry check for status code 400 (#5461)
  meta: fix AwsS3 endpoint option in private/dev
  build(deps): bump body-parser from 1.20.2 to 1.20.3 (#5462)
  build(deps-dev): bump vite from 5.3.1 to 5.3.6 (#5459)
  @uppy/tus: set response from tus-js-client (#5456)
  ...
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.

@uppy/tus: add response to upload-success
1 participant