* stream upload unknown size files
behind a new option streamingUploadSizeless
COMPANION_STREAMING_UPLOAD_SIZELESS
for tus
* allow for all upload protocols
seems to be working
closes#5305
* refactor
and fix bug where progress was not always emitted
* fix type
* fix progress throttling
only do it on total progress
* Improve progress in UI
- only show progress percent and total bytes for files that we know the size of. (but all files will still be included in number of files)
- use `null` as an unknown value for progress and ETA, allowing us to remove ETA from UI when unknown
- `percentage` make use of `undefined` when progress is not yet known - don't show percentage in UI when unknown
- add a new state field `progress` that's the same as `totalProgress` but can also be `null`
* fix build error
* format
* fix progress when upload complete
* use execa for companion load balancer
if not, then it leaves zombie companion instances running in the background when e2e stops
have to be manually killed before running e2e again
* update docs and tests for new state.progress
* revert progress/totalProgress
* improve doc
* remove option streamingUploadSizeless
we agreed that this can be considered not a breaking change
* change progress the to "of unknown"
* revert
* remove companion doc
* add e2e test
* 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
* 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
New concept "simple auth" - authentication that happens immediately (in one http request) without redirecting to any third party.
uppyAuthToken initially used to simply contain an encrypted & json encoded OAuth2 access_token for a specific provider. Then we added refresh tokens as well inside uppyAuthToken #4448. Now we also allow storing other state or parameters needed for that specific provider, like username, password, host name, webdav URL etc... This is needed for providers like webdav, ftp etc, where the user needs to give some more input data while authenticating
Companion:
- `providerTokens` has been renamed to `providerUserSession` because it now includes not only tokens, but a user's session with a provider.
Companion `Provider` class:
- New `hasSimpleAuth` static boolean property - whether this provider uses simple auth
- uppyAuthToken expiry default 24hr again for providers that don't support refresh tokens
- make uppyAuthToken expiry configurable per provider - new `authStateExpiry` static property (defaults to 24hr)
- new static property `grantDynamicToUserSession`, allows providers to specify which state from Grant `dynamic` to include into the provider's `providerUserSession`.
* Dashboard: auto discover plugins no matter when they were installed
* Remove target from RemoteSoruces, making it compatible with @uppy/react
* Update packages/@uppy/dashboard/src/Dashboard.jsx
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* Removed comments, added comments
* better comment
* Change type — otherwise gets listed on Dashboard sources
* Add RemoteSources to React test
* Add RemoteSources to React example
* Add tests
* Refactor for less iteration for each plugin, rename functions
* Prevent error when opts are undefined
* remove console.logs
* prettier
---------
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
JS files are ignored for now because we want to migrate them to TS
anyway.
MD files are also ignored to minimize the diff.
ESLint is run twice twice on TS files in case it conflicts with Prettier.
When pausing the upload, we don't want to remove the cached `uploadId`,
otherwise Uppy needs to re-upload the file from the begininng, even if
it has already uploaded some chunks.
* @uppy/companion: fix 500 when file name contains non-ASCII chars
* Update packages/@uppy/companion/src/server/controllers/s3.js
* fixup! @uppy/companion: fix 500 when file name contains non-ASCII chars
* we need a lint rule for this
* Use filename from content-disposition instead of relying on url, with fallback
* Update packages/@uppy/companion/src/server/helpers/request.js
* Update packages/@uppy/companion/src/server/helpers/request.js
* Add random string to file name coming from basename in case ?param is a differentiator
* Add e2e test for Companion /url/meta file name + mock server with Content-Disposition
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Update e2e/cypress/integration/dashboard-xhr.spec.ts
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* Update e2e/mock-server.mjs
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Update package.json
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Update e2e/mock-server.mjs
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Update e2e/cypress/integration/dashboard-xhr.spec.ts
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* Add comment about why randomUUID is added to file name
* yarn
* res vs response
---------
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* 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>
* show how many files are added when loading
remake of https://github.com/transloadit/uppy/pull/4388
* add french (cherry pick)
* implement concurrent file listing
* refactor / fix lint
* refactor/reduce duplication
* pull out totals validation
don't do it for every file added, as it's very slow
instead do the check at the end when all files are added.
this allows us to easily work with 10k+ files
fixes#4389
* Update packages/@uppy/core/src/Uppy.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* make restricter.validate validate everything
instead make more specific methods for sub-validation
also rename validateTotals to validateAggregateRestrictions
* improve errors and user feedback
- handle errors centrally so that we can limit the amount of toasts (informers) sent to the users (prevent flooding hundreds/thousands of them)
- introduce FileRestrictionError which is a restriction error for a specific file
- introduce isUserFacing field for RestrictionError
* fix performance issue reintroduced
* improvements
- show "%{count} additional restrictions were not fulfilled" for any restriction errors more than 4
- refactor/rename methods
- improve ghost logic/comments
* improve performance when uploading
- introduce new event "upload-start" that can contain multiple files
- make a new patchFilesState method to allow updating more files
- unify "upload-start" logic in all plugins (send it before files start uploading)
- defer slicing buffer until we need the data
- refactor to reuse code
* fix e2e build issue
* try to upgrade cypress
maybe it fixes the error
* Revert "fix e2e build issue"
This reverts commit ff3e580c0f.
* upgrade parcel
* move mutation logic to end
* remove FileRestrictionError
merge it with RestrictionError
* fix silly bug
looks like the e2e tests are doing its job 👏
---------
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>