Commit graph

157 commits

Author SHA1 Message Date
Merlijn Vos
6e65cd8c51
Import types consistently from @uppy/core (#5589)
* Import types consistently from @uppy/core

* Add new eslint rule

* Clean up exports
2025-01-09 11:03:43 +01:00
Merlijn Vos
3e2aa9f3c8
Use .js(x) for all imports instead .ts(x) (#5573) 2025-01-06 13:29:55 +01:00
Mikael Finstad
afd4befee2
Google Picker (#5443)
* initial poc

* improvements

- split into two plugins
- implement photos picker
- auto login
- save access token in local storage
- document
- handle photos/files picked and send to companion
- add new hook useStore for making it easier to use localStorage data in react
- add new hook useUppyState for making it easier to use uppy state from react
- add new hook useUppyPluginState for making it easier to plugin state from react
- fix css error

* implement picker in companion

* type todo

* fix ts error

which occurs in dev when js has been built before build:ts gets called

* reuse docs

* imrpve type safety

* simplify async wrapper

* improve doc

* fix lint

* fix build error

* check if token is valid

* fix broken logging code

* pull logic out from react component

* remove docs

* improve auth ui

* fix bug

* remove unused useUppyState

* try to fix build error
2024-12-02 18:34:50 +08:00
Merlijn Vos
20291e19e8
@uppy/transloadit: fix multiple upload batches & run again (#5478)
* @uppy/transloadit: fix multiple upload batchs & run again

* Remove console.log
2024-09-30 11:22:38 +02:00
Merlijn Vos
23bf2298d8
@uppy/tus: correctly type tus on UppyFile (#5454)
* @uppy/tus: correctly type tus on UppyFile

* Fix @uppy/transloadit
2024-09-09 10:53:33 +02:00
Merlijn Vos
50feeae487
@uppy/transloadit: add execution_progress to AssemblyResponse type (#5420) 2024-08-20 16:54:20 +02:00
Merlijn Vos
a50c18f5e6
@uppy/transloadit: fix check if all files have been removed (#5419)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2024-08-20 10:58:46 +02:00
Mikael Finstad
013f4eab2b
@uppy/transloadit: fix issue with allowMultipleUploadBatches (#5400)
* fix issue with allowMultipleUploadBatches

fixes #5397
also refactor from promise.then to async/await
and fix what seems like broken logic with recursive this.#afterUpload call

* throw better error when all files have been canceled

after an assembly has been created
also rewrite #createAssembly to async/await

* wait for updateAssembly when restoring

fixes potential race condition
2024-08-15 20:10:01 +02:00
Mikael Finstad
f70e14a969
@uppy/transloadit: fix many lurking TypeError (#5399) 2024-08-15 19:35:28 +02:00
Antoine du Hamel
9e69b7fc26
meta: enforce .ts extension for relative import types (#5393) 2024-08-13 16:08:35 +02:00
Antoine du Hamel
0fd8065418
@uppy/transloadit: do not mark opts as mandatory (#5375) 2024-07-29 14:15:12 +02:00
Mikael Finstad
d536a3525f
@uppy/google-photos: fix various issues (#5275)
Fixes: https://github.com/transloadit/uppy/pull/5061#issuecomment-2188717555

Also change the type of `UppyFile.name`, because it can be `undefined`.
2024-06-27 10:31:30 +02:00
Antoine du Hamel
1b81a8a842
@uppy/transloadit: fix strict type errors (#5271) 2024-06-21 14:07:43 +02:00
Merlijn Vos
521d90344b
@uppy/transloadit: simplify plugin to always run a single assembly (#5158) 2024-06-21 13:32:57 +02:00
Merlijn Vos
88d508f7bf
TS strict mode (#5258)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2024-06-20 16:54:10 +02:00
Antoine du Hamel
a42b150639
Merge stable branch 2024-06-18 17:22:02 +02:00
Mikael Finstad
e6674a1eee
@uppy/google-photos: add plugin (#5061) 2024-06-18 11:13:23 +02:00
github-actions[bot]
36c15a3d57
Release: uppy@4.0.0-beta.11 (#5243)
| Package              |       Version | Package              |       Version |
| -------------------- | ------------- | -------------------- | ------------- |
| @uppy/aws-s3         |  4.0.0-beta.6 | @uppy/react          |  4.0.0-beta.6 |
| @uppy/locales        |  4.0.0-beta.3 | @uppy/transloadit    |  4.0.0-beta.8 |
| @uppy/provider-views |  4.0.0-beta.8 | uppy                 | 4.0.0-beta.11 |

- docs: clarify assemblyOptions for @uppy/transloadit (Merlijn Vos / #5226)
- @uppy/react: remove `react:` prefix from `id` & allow `id` as a prop (Merlijn Vos / #5228)
- docs: correct allowedMetaFields (Merlijn Vos / #5227)
- docs: remove `extraData` note from migration guide (Mikael Finstad / #5219)
- meta: fix AWS test suite (Antoine du Hamel / #5229)




| Package              | Version | Package              | Version |
| -------------------- | ------- | -------------------- | ------- |
| @uppy/locales        |   3.5.4 | @uppy/transloadit    |   3.7.1 |
| @uppy/provider-views |  3.12.1 | uppy                 |  3.26.1 |

- meta: Improve aws-node example readme (Artur Paikin / #4753)
- @uppy/locales: Added translation string (it_IT) (Samuel / #5237)
- @uppy/transloadit: fix transloadit:result event (Merlijn Vos / #5231)
- @uppy/provider-views: fix wrong font for files (Merlijn Vos / #5234)
2024-06-13 11:22:50 +00:00
Merlijn Vos
5695299a19
@uppy/transloadit: also fix outdated assembly transloadit:result (#5246)
Co-authored-by: Marius Kleidl <marius@transloadit.com>
2024-06-12 12:06:42 +02:00
Merlijn Vos
ce66e1259d
@uppy/transloadit: fix transloadit:result event (#5231)
Co-authored-by:: Marius Kleidl <marius@transloadit>
2024-06-10 09:28:17 +02:00
Antoine du Hamel
ae2ffb88cd
Merge stable branch 2024-06-04 17:17:01 +02:00
Merlijn Vos
fe0437aa7d
@uppy/transloadit: remove updateNumberOfFilesInAssembly (#5202) 2024-05-29 14:44:20 +02:00
Antoine du Hamel
f72138ff4b
@uppy/core: remove reason (#5159) 2024-05-23 18:52:48 +02:00
Antoine du Hamel
4298dd67ab
Merge branch 'main' of https://github.com/transloadit/uppy 2024-05-22 13:46:33 +02:00
Merlijn Vos
2597bb98dc
@uppy/transloadit: do not cancel assembly when removing all files (#5191) 2024-05-22 13:40:35 +02:00
github-actions[bot]
b8f8f8a9dd
Release: uppy@4.0.0-beta.4 (#5130)
| Package                |      Version | Package                |      Version |
| ---------------------- | ------------ | ---------------------- | ------------ |
| @uppy/angular          | 0.7.0-beta.4 | @uppy/instagram        | 4.0.0-beta.4 |
| @uppy/audio            | 2.0.0-beta.4 | @uppy/onedrive         | 4.0.0-beta.4 |
| @uppy/aws-s3-multipart | 4.0.0-beta.4 | @uppy/provider-views   | 4.0.0-beta.4 |
| @uppy/box              | 3.0.0-beta.4 | @uppy/react            | 4.0.0-beta.4 |
| @uppy/companion        | 5.0.0-beta.4 | @uppy/status-bar       | 4.0.0-beta.4 |
| @uppy/companion-client | 4.0.0-beta.4 | @uppy/store-redux      | 4.0.0-beta.2 |
| @uppy/compressor       | 2.0.0-beta.4 | @uppy/svelte           | 4.0.0-beta.2 |
| @uppy/core             | 4.0.0-beta.4 | @uppy/transloadit      | 4.0.0-beta.4 |
| @uppy/dashboard        | 4.0.0-beta.4 | @uppy/unsplash         | 4.0.0-beta.4 |
| @uppy/drop-target      | 3.0.0-beta.4 | @uppy/url              | 4.0.0-beta.4 |
| @uppy/dropbox          | 4.0.0-beta.4 | @uppy/utils            | 6.0.0-beta.4 |
| @uppy/facebook         | 4.0.0-beta.4 | @uppy/webcam           | 4.0.0-beta.4 |
| @uppy/file-input       | 4.0.0-beta.4 | @uppy/xhr-upload       | 4.0.0-beta.2 |
| @uppy/form             | 4.0.0-beta.2 | @uppy/zoom             | 3.0.0-beta.4 |
| @uppy/google-drive     | 4.0.0-beta.4 | uppy                   | 4.0.0-beta.4 |
| @uppy/image-editor     | 3.0.0-beta.2 |                        |              |

- meta: Upgrade Yarn to 4.x (Merlijn Vos / #4849)
- @uppy/utils: fix fetcher export (Murderlon)
- @uppy/xhr-upload: refactor to use `fetcher` (Merlijn Vos / #5074)
- docs: use StackBlitz for all examples/issue template (Merlijn Vos / #5125)
- meta: Update yarn.lock (Murderlon)
- @uppy/svelte: Add svelte 5 as peer dep (frederikhors / #5122)
- meta: Bump docker/setup-buildx-action from 2 to 3 (dependabot[bot] / #5124)
- meta: Bump actions/checkout from 3 to 4 (dependabot[bot] / #5123)
- @uppy/dashboard,@uppy/provider-views: Remove JSX global type everywhere (Merlijn Vos / #5117)
- @uppy/utils: improve return type of `dataURItoFile` (Antoine du Hamel / #5112)
- @uppy/drop-target: change drop event type to DragEvent (Alireza Heydari / #5107)
- @uppy/image-editor: fix label definitions (Antoine du Hamel / #5111)
- meta: bump Prettier version (Antoine du Hamel / #5114)
- @uppy/provider-views: bring back "loaded X files..." (Mikael Finstad / #5097)
- @uppy/dashboard: fix type of trigger option (Merlijn Vos / #5106)
- meta: fix linter (Antoine du Hamel)
- @uppy/companion: bump Node.js version support matrix (Antoine du Hamel / #5035)
- @uppy/form: fix `submitOnSuccess` and `triggerUploadOnSubmit` combination (Merlijn Vos / #5058)
- meta: Bump docker/build-push-action from 3 to 5 (dependabot[bot] / #5105)
- meta: Bump akhileshns/heroku-deploy from 3.12.12 to 3.13.15 (dependabot[bot] / #5102)
- meta: Bump docker/login-action from 2 to 3 (dependabot[bot] / #5101)
- meta: Bump actions/download-artifact from 3 to 4 (dependabot[bot])
- meta: Bump actions/upload-artifact from 3 to 4 (dependabot[bot])
- @uppy/react: remove `useUppy` & reintroduce `useUppyState` (Merlijn Vos / #5059)
- meta: docs: add back markdown files (Antoine du Hamel / #5064)
- meta: fix custom provider example (Merlijn Vos / #5079)
- @uppy/utils: add fetcher (Merlijn Vos / #5073)
- meta: Fix prettier (Murderlon)
- @uppy/dashboard: add missing `x-zip-compress` archive type (Younes / #5081)
- meta: Bump docker/metadata-action from 4 to 5 (dependabot[bot] / #5086)
- meta: Bump actions/setup-node from 3 to 4 (dependabot[bot] / #5087)
- meta: Bump docker/setup-qemu-action from 2 to 3 (dependabot[bot] / #5089)
- meta: bump supercharge/redis-github-action from 1.4.0 to 1.8.0 (dependabot[bot] / #5090)
- meta: bump actions/cache from 3 to 4 (dependabot[bot] / #5088)
- meta: add `dependabot.yml` to keep GHA up-to-date (Antoine du Hamel / #5083)
- @uppy/core: Release: uppy@3.24.2 (github-actions[bot] / #5084)
- @uppy/core: fix `setOptions` not re-rendereing plugin UI (Antoine du Hamel / #5082)
- meta: bump vite from 5.0.12 to 5.0.13 (dependabot[bot] / #5060)
- meta: bump tar from 6.1.11 to 6.2.1 (dependabot[bot] / #5068)
- @uppy/companion,@uppy/file-input: Release: uppy@3.24.1 (github-actions[bot] / #5069)
- @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)





| Package                | Version | Package                | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/audio            |   1.1.9 | @uppy/instagram        |   3.3.1 |
| @uppy/aws-s3-multipart |  3.11.1 | @uppy/onedrive         |   3.3.1 |
| @uppy/box              |   2.3.1 | @uppy/provider-views   |  3.12.0 |
| @uppy/companion-client |   3.8.1 | @uppy/react            |   3.3.1 |
| @uppy/compressor       |   1.1.3 | @uppy/status-bar       |   3.3.2 |
| @uppy/core             |  3.11.0 | @uppy/svelte           |   3.1.4 |
| @uppy/dashboard        |   3.8.2 | @uppy/transloadit      |   3.6.1 |
| @uppy/drop-target      |   2.1.0 | @uppy/unsplash         |   3.3.1 |
| @uppy/dropbox          |   3.3.1 | @uppy/url              |   3.6.1 |
| @uppy/facebook         |   3.3.1 | @uppy/utils            |   5.9.0 |
| @uppy/file-input       |   3.1.2 | @uppy/webcam           |   3.4.1 |
| @uppy/form             |   3.2.1 | @uppy/xhr-upload       |   3.6.5 |
| @uppy/google-drive     |   3.5.1 | @uppy/zoom             |   2.3.1 |
| @uppy/image-editor     |   2.4.5 | uppy                   |  3.25.0 |

- meta: enforce use of `.js` extension in `import type` declarations (Antoine du Hamel / #5126)
- @uppy/core: add instance ID to generated IDs (Merlijn Vos / #5080)
- @uppy/core: reference updated i18n in Restricter (Merlijn Vos / #5118)
- @uppy/xhr-upload: refactor to use `fetcher` (Merlijn Vos / #5074)
- meta: docs: use StackBlitz for all examples/issue template (Merlijn Vos / #5125)
- meta: Update yarn.lock (Murderlon)
- @uppy/svelte: Add svelte 5 as peer dep (frederikhors / #5122)
- meta: Bump docker/setup-buildx-action from 2 to 3 (dependabot[bot] / #5124)
- meta: Bump actions/checkout from 3 to 4 (dependabot[bot] / #5123)
- @uppy/dashboard,@uppy/provider-views: Remove JSX global type everywhere (Merlijn Vos / #5117)
- @uppy/utils: improve return type of `dataURItoFile` (Antoine du Hamel / #5112)
- @uppy/drop-target: change drop event type to DragEvent (Alireza Heydari / #5107)
- @uppy/image-editor: fix label definitions (Antoine du Hamel / #5111)
- meta: bump Prettier version (Antoine du Hamel / #5114)
- @uppy/provider-views: bring back "loaded X files..." (Mikael Finstad / #5097)
- @uppy/dashboard: fix type of trigger option (Merlijn Vos / #5106)
- meta: fix linter (Antoine du Hamel)
- @uppy/form: fix `submitOnSuccess` and `triggerUploadOnSubmit` combination (Merlijn Vos / #5058)
- meta: Bump docker/build-push-action from 3 to 5 (dependabot[bot] / #5105)
- meta: Bump akhileshns/heroku-deploy from 3.12.12 to 3.13.15 (dependabot[bot] / #5102)
- meta: Bump docker/login-action from 2 to 3 (dependabot[bot] / #5101)
- meta: Bump actions/download-artifact from 3 to 4 (dependabot[bot])
- meta: Bump actions/upload-artifact from 3 to 4 (dependabot[bot])
2024-04-29 20:12:59 +00:00
Antoine du Hamel
faceaf0da3
meta: enforce use of .js extension in import type declarations (#5126) 2024-04-29 16:23:28 +02:00
Merlijn Vos
c4455ebba7
@uppy/transloadit: remove deprecated options (#5056) 2024-04-03 10:09:39 +02:00
Merlijn Vos
700944e25b
@uppy/transloadit: migrate to TS (#4987)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2024-03-18 15:45:11 +01:00
Marius
7b492d7ff6
@uppy/transloadit: add clientName option (#4920) 2024-02-19 16:24:23 +01:00
Mikael Finstad
17826da517
Companion+client stability fixes, error handling and retry (#4734)
* respond with 500 if unhandled upload error

400 seems inappropriate

* add todo

* fix companion download error

respond with correct response code when calling /get
and request to the upstream server fail

also add a unit test for this

* forward 429 from provider

allows us to retry it

* rename fn

* add a way to test refresh tokens

* fix race condtiion with refreshing token

* implement retry and fix socket

- Make sure we don't instantiate a new Provider for every file uploaded (reuse the original provider instead) - this caused the refresh token synchronization not to work
- Retry most errors when uploading (`/get`) using companion, but for HTTP, only retry certain HTTP status codes
- Reimplement the websocket code to be more stable and retry as well

* remove unused socket wrapper

* remove useFastRemoteRetry

because it isn't supported in Companion as far as I can tell

* fix error handling

* remove unneeded logic

* apply review suggestion

* retry awaiting for companion socket too

* retry whole operation instead of individually

or else we risk getting stuck retrying just half of the operation, which might never recover

* improvements

- rewrite so we can use p-retry for exponential backoff for socket reconnect too
- improve logging
- simplify/reuse code

* Update packages/@uppy/utils/src/fetchWithNetworkError.js

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>

* Explain requestClient Symbol with comment

Co-authored-by: Mikael Finstad <finstaden@gmail.com>

* Update packages/@uppy/provider-views/src/View.js

* fixes

preventing socket.send when the socket is not in the connected state
catch errors in handlers

* log if trying to refresh with no token

* log whether we got a refresh token

* dont log retrying when in reality not

* always prompt: consent

for google drive

* add signal to post

* refactor away eventmanager

and event handler error catching

* don't fail with upload-error

if a file is canceled

* fix expect

* add capabilities support

* make requestClient non-enumerable

---------

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2023-11-02 21:31:34 +09:00
Antoine du Hamel
2c432b12cd
test: migrate to Vitest for Uppy core and Uppy plugins (#4700) 2023-09-26 17:23:17 +02:00
Marius
44d7a5e88f
@uppy/transloadit: Emit assembly progress events (#4603) 2023-09-05 09:46:31 +02:00
Antoine du Hamel
8a32e8e2e7
@uppy/transloadit: remove Socket.io (#4281)
* @uppy/transloadit: implement Server-sent event API

* pass events from event stream to JS

* @uppy/transloadit: remove Socket.io

Now that SSE is available, WebSockets do not bring much to the table.

---------

Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2023-09-04 18:59:22 +01:00
Antoine du Hamel
fa389f2409
use uppercase HTTP method names (#4612) 2023-08-08 18:27:06 +02:00
Antoine du Hamel
d09145f97e
@uppy/transloadit: fix error message (#4572) 2023-07-13 18:12:57 +02:00
Antoine du Hamel
9ac5842fbe
@uppy/transloadit: implement Server-sent event API (#4098) 2023-07-13 17:18:39 +02:00
Antoine du Hamel
c377379019
@uppy/transloadit: ensure fields is not nullish when there no uploaded files (#4487)
Refs: https://github.com/transloadit/uppy/pull/4059
2023-06-19 15:02:13 +02:00
Merlijn Vos
6e17e263f5
@uppy/transloadit: clean up event listener to prevent cancelled assemblies (#4447) 2023-05-15 15:28:39 +08:00
Artur Paikin
acf2c8efeb
@uppy/transloadit: Reset tus key in the file on error, so retried files are re-uploaded (#4421)
* Reset `tus` key in the file on error, so retried files are re-uploaded

* add a test

* Use one file, try to set headers

* Pass Upload-Length and Upload-Offset, so tus knows when upload is complete

* test clean up

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-04-27 12:11:16 +01:00
Artur Paikin
5ec7187825
@uppy/transloadit: fix socket error message (#4352)
* Fix error message being lost when emitted via socket

* Emit global error, set StatusBar to error state when there's an error, show error at the Dashboard top

* Update packages/@uppy/transloadit/src/index.js

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* Refactor onError

* Prevent error ? button from shrinking like a weirdo

---------

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2023-04-03 12:44:23 +01:00
Antoine du Hamel
2ef662140b
@uppy/transloadit: fix assemblyOptions option (#4316) 2023-02-13 18:33:42 +01:00
Merlijn Vos
2e825346b6
@uppy/transloadit: introduce assemblyOptions, deprecate other options (#4059) 2022-12-01 16:46:43 -03:00
Antoine du Hamel
4e26eb0212
@uppy/transloadit: improve deprecation notice (#4056) 2022-08-30 10:10:19 +02:00
Antoine du Hamel
e0f17e3753
meta: fix linter warnings (#4039) 2022-08-23 16:08:08 +02:00
Merlijn Vos
d7180dbb3c
@uppy/tus, @uppy/xhr-upload, @uppy/aws-s3: metaFields -> allowedMetaFields (#4023) 2022-08-22 16:48:39 +02:00
Antoine du Hamel
1efa053e45
@uppy/transloadit: deprecate static properties, export new names (#3987) 2022-08-16 18:01:17 +02:00
Antoine du Hamel
e65db58b29
@uppy/utils: use exports map (#3985) 2022-08-16 15:40:35 +02:00
Merlijn Vos
9a213b59da
Fix all breaking todo comments for 3.0 (#3907)
- `@uppy/aws/s3-multipart`: remove `client` getter and setter.
  - reason: internal usage only
  - migrate: use exposed options only
- `@uppy/core`: remove `AggregateError` polyfill
  - reason: [should be polyfilled by the user](https://github.com/transloadit/uppy/pull/3532#discussion_r818602636)
  - migrate: install `AggregateError` polyfill or use `core-js`
- `@uppy/core`: remove `reset()` method
  - reason: it's a duplicate of `cancelAll`, but with a less intention revealing name
  - migrate: use `cancelAll`
- `@uppy/core`: remove backwards compatible exports (static properties on `Uppy`)
  - reason: transition to ESM
  - migrate: import the `Uppy` class by default and/or use named exports for everything else.
- `@uppy/react`: don't expose `validProps`
  - reason: internal only
  - migrate: do not depend on this
- `@uppy/store-redux`: remove backwards compatible exports (static properties on `ReduxStore`)
  - reason: transition to ESM
  - migrate: use named imports
- `@uppy/thumbnail-generator`: remove `rotateImage`, `protect`, and `canvasToBlob` from prototype.
  - reason: internal only
  - migrate: don't depend on this
2022-08-03 20:07:24 +02:00
Antoine du Hamel
003b9518b3 Merge stable branch 2022-08-03 11:54:15 +02:00