Commit graph

96 commits

Author SHA1 Message Date
Antoine du Hamel
c223a1f204
@uppy/transloadit: remove IE 10 hack (#3777) 2022-05-30 18:32:53 +02:00
Renée Kooi
3121fae11b
transloadit: propagate error details when creating Assembly fails (#3794)
* transloadit: propagate error details when creating Assembly fails

Clients are expected to use `error.assembly` to inspect details about
failed Assemblies, but then we do need to always give that property
back.

I think we should have a test for this but not sure how to approach it,
since it depends on responses from the Transloadit API. I guess we'd
require a new e2e test for it?

* Apply suggestions from code review

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-05-30 16:50:30 +01:00
Antoine du Hamel
5a8a8d35be
meta: prepare test files for lint rule hardening (#3761) 2022-05-23 12:02:19 +02:00
Antoine du Hamel
3f5a03f504
@uppy/transloadit: refactor to ESM (#3725) 2022-05-17 15:17:50 +02:00
Antoine du Hamel
1413672f7c
@uppy/transloadit: add rate limiting for assembly creation and status polling (#3718)
Share one instance of `RateLimitedQueue` between Tus plugin and
Transloadit plugin, ensure all requests to transloadit.com go through
the `RateLimitedQueue` to handle rate limiting response globally.
2022-05-13 17:05:07 +02:00
Mikael Finstad
8ed210545c
proposal: Cancel assemblies optional (#3575)
* change cancel logic

to make canceling assemblies optional
possibly fixes #3547

* add forgotten file

* rewrite to reason='user'

* try to fix crash

* change reason to unmount

* Apply suggestions from code review

* add close+unmount in more code examples

also fix rule of hooks issue

* improve reason docs

* add tests

* add options also to reset

* update doc

* also prevent canceling uploads on unmount

* Update website/src/docs/transloadit.md

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

* remove conflicting file

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2022-05-06 01:53:46 +07:00
Antoine du Hamel
dceac85af5
@uppy/transloadit: improve fetch error handling (#3637)
Returning a non-2xx code is not a `NetworkError`, it's a rejection from
the server and we should handle it as such.
2022-04-19 19:15:40 +02:00
Renée Kooi
b22a812db3
Propagate isNetworkError through error wrappers (#3620)
The `ErrorWithCause` class uses the same signature as the builtin Error
does, but it supports the `{ cause }` option in older environments, and
it propagates the `isNetworkError` property from the underlying error.
2022-04-05 15:57:25 +02:00
Antoine du Hamel
aba7b29662
@uppy/transloadit: close assembly if upload is cancelled (#3591)
Fixes: https://github.com/transloadit/uppy/issues/3156
2022-03-24 13:57:00 +01:00
Antoine du Hamel
cc82f33137
@uppy/transloadit: fix handling of Tus errors and rate limiting (#3429) 2022-01-12 18:24:11 +03:00
Antoine du Hamel
fdb3c5e51d
@uppy/transloadit: simplify #onTusError (#3419)
And fixes few ESLint warnings
2022-01-11 14:02:07 +01:00
Antoine du Hamel
e2c62594a1
@uppy/transloadit: ignore rate limiting errors when polling (#3418)
Fixes: https://github.com/transloadit/uppy/issues/3156
2022-01-10 19:36:13 +01:00
Antoine du Hamel
fa140ead94
@uppy/transloadit: better defaults for rate limiting (#3414) 2022-01-10 15:33:05 +01:00
Antoine du Hamel
cd8af60bfb
examples: update angular-example to Angular v13 (#3325)
* examples: update angular-example to Angular v13

* meta: upgrade TS version accross the board

* meta: upgrade ESLint packages

* Fix angular-examples tests

* bump lock file

* fix type conflict

* Upgrade `ng-packagr`
2021-11-22 19:12:56 +01:00
Merlijn Vos
00094af525
Refactor locale scripts & generate types and docs (#3276)
Closes #3232 

### Summary

- Create `locale.js` for every plugin instead of `this.defaultLocale` in the class
- Complete refactor of locale scripts
  - No dynamic plugin class imports with hacks to mimic the environment in order to get the `defaultLocale`.
  - Separate tests and build in separate files
  - Add two modes for test file, `unused` (fails hard) and `warnings`
- Generate docs
  - Use remark to cleanly mutate the file
  - Rename some doc files to match the plugin name (such as `statusbar` --> `status-bar`)
  - Comments in `locale.js` are kept and are present in the docs as well.
- Generate types
2021-11-10 11:43:04 +01:00
Kevin van Zonneveld
bfe659820e
Upgrade linting to 2.0.0-0 (#3280)
* Upgrade linting to 2.0.0-0

* Adjust so we can pass without error

* Fix linting

* Update header-blacklist.js

* Update index.js

* Update Uppy.js

* Update Components.js

* Update StatusBar.js

* Update Assembly.js

* Upgrade to linting 2.0.0 (final release)
2021-11-09 11:19:05 +00:00
Antoine du Hamel
7cad0130dd
ci: fix tranloadit2 e2e tests (#3270)
* ci: fix tranloadit2 e2e tests

* ci: Re-enable tranloadit tests

* ci: update settings

* improve comments

* Remove cropping step from transloadit2 e2e test

* add steps back

* remove template id

* increase timeout

* transloadit2

* Re-enable all e2e tests

Co-authored-by: Artur Paikin <artur@arturpaikin.com>
2021-10-19 15:23:32 +01:00
Antoine du Hamel
8fbabe4223
@uppy/transloadit: pass fields to transloadit (#3228)
* @uppy/transloadit: pass fields to transloadit

Co-authored-by: Merlijn Vos <Murderlon@users.noreply.github.com>
Fixes: https://github.com/transloadit/uppy/issues/3189

* inline `normalizeAssemblyOptions`

Co-authored-by: Merlijn Vos <Murderlon@users.noreply.github.com>
2021-10-06 14:25:01 +02:00
Antoine du Hamel
d69031524c
@uppy/core: move Uppy class to its own module (#3225)
* @uppy/core: move `Uppy` class to its own module

Fixes: https://github.com/transloadit/uppy/issues/3220

* Rename snapshot file

* Update docs

* Update website/src/_posts/2021-08-2.0.md

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

* Update migration guide

* Do not bundle preact with non-UI plugin packages

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2021-09-28 19:04:33 +02:00
Antoine du Hamel
b364708715
@uppy/transloadit: fix unhandledPromiseRejection failures (#3197)
* @uppy/transloadit: fix unhandledPromiseRejection failures

Fixes: https://github.com/transloadit/uppy/issues/3189

* Add transloadit2 to end2end test matrix
2021-09-16 15:24:20 +02:00
Artur Paikin
86cb2294b0
remove resume option from transloadit plugin (#3149) 2021-09-03 01:55:23 +01:00
Antoine du Hamel
ec87b232e9
meta: enforce no-unused-vars linter rule (#3118)
* meta: enforce `no-unused-vars` linter rule

* meta: fix `@typescript-eslint/no-unused-vars` linter warnings

* meta: enforce `no-unused-expressions` lint rule

* @uppy/companion: fix `tsc` build
2021-08-23 13:10:17 +01:00
Antoine du Hamel
6b7ad5e7c7
Stricter linter (#3095)
* enforce some eslint rules

* enforce accessibility linter rules

* harden lint rules with only 1 or 2 warnings

* fix remaining rules with less than 3 warnings

* fix e2e tests

* fix remaining rules with less than 4 warnings

* fix remaining rules with less than 6 warnings

* fix `shuffleTaglines`

* fix companion build
2021-08-17 20:32:57 +02:00
Antoine du Hamel
1d62071b92
@uppy/transloadit: upgrade socket.io-client version (#3065)
* @uppy/transloadit: upgrade `socket.io-client` version

Fixes: https://github.com/transloadit/uppy/issues/2875

* Disable `import/no-extraneous-dependencies` linter rules on website and endtoend files

* fixup! Disable `import/no-extraneous-dependencies` linter rules on website and endtoend files

* fixup! Disable `import/no-extraneous-dependencies` linter rules on website and endtoend files
2021-08-02 20:42:18 +01:00
Antoine du Hamel
86a5572900 @uppy/transloadit: fix tests on v16.x 2021-08-02 16:12:14 +02:00
Artur Paikin
4ca78ab543
Set plugin titles from locale (#3023)
* What is happening "*"

* Instead of re-creating i18nInit, we could just make it part of the BasePlugin

* set plugin title and allow changing it from locale

* remove i18nInit method, since we now include it in BasePlugin

* All provider titles should come from locale

* Update en_US.js

* make translator private

//cc @aduh95

* init locale after calling setOptions

* Update en_US.js

* Update packages/@uppy/core/src/BasePlugin.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

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

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* Bind `i18n` functions

* Remove duplicate i18nInit — it’s in BasePlugin already

* fix formatting

* fix name

* Update en_US.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-07-30 13:02:32 +01:00
Antoine du Hamel
9a46b0d2da
@uppy/transloadit: refactor to use private properties (#3019) 2021-07-21 17:38:24 +02:00
Merlijn Vos
f01538ba41
Resolve all type TODO's (#2963) 2021-07-20 14:40:31 +02:00
Antoine du Hamel
d40b5241db
core: remove more IE hacks (#3015)
We can now use `Object.fromEntries`, `Object.values`, and `Symbol`.
Also changes polyfill suggestion for legacy browsers to use `core-js`
which includes almost all we need and more.
2021-07-16 09:27:51 +02:00
Artur Paikin
ce959456ed
companion: Remove deprecated serverHeaders in favour of companionHeaders (#2995)
* remove deprecated serverHeaders in favour of companionHeaders

* remove TL_UPPY_SERVER and exports.UPPY_SERVER

@kvz @goto-bus-stop ok to do this already, right?
2021-07-08 18:10:14 +01:00
Merlijn Vos
f0f1105ef0
Resolve or remove miscellaneous todos (#2967) 2021-06-29 12:54:19 +02:00
Antoine du Hamel
c315329399
Remove IE polyfills and special casing (#2947)
* Remove IE polyfills and special casing

* dashboard: remove `resize-observer-polyfill`

* deps: remove url-parse to use global `URL` instead

* Update documentation for browser support

* Add a migration guide

* Update e2e test platforms

* Remove polyfills from examples and add those missing in CDN bundle

* Use Node.js v16.x on CI because of `AbortController`

* Update bundle builder to produce two builds: `uppy.js` without polyfills, `uppy.legacy.js` with polyfills.

* Upgrade create-react-app deps

* remove null coalescing operator as it's not supported by the build chain

* disable Safari testing (for now)


Co-authored-by: Renée Kooi <renee@kooi.me>
2021-06-28 11:34:51 +02:00
Antoine du Hamel
9c26496a09
transloadit: fix unhandled promise rejections (#2948) 2021-06-21 13:53:16 +02:00
Merlijn Vos
ecec3d3213
Split Plugin into BasePlugin and extended UIPlugin (#2944) 2021-06-18 13:23:16 +02:00
Kevin van Zonneveld
764c2ccada
Update Linter (#2796)
* relocate .vscode

* Switch to transloadit linter

* Update .eslintrc.json

* autofix code

* unlink and install eslint-config-transloadit@1.1.1

* Change 0 to "off"

* Don't change 'use strict'

* Do not vertically align

* disable key-spacing

* add import/no-extraneous-dependencies per package

* add more react/a11y warnings

* Revert "autofix code"

This reverts commit 14c8a8cde8.

* add import/no-extraneous-dependencies per example and main package

* autofix code (2)

* Allow devDependencies in ./bin

* Change import/no-extraneous-dependencies to warn again

* upgrade linter

* Set import/no-extraneous-dependencies to warn
2021-03-15 16:25:17 +00:00
Ethan Willis
f4f8b157c6
Make url concatenation more robust (#2777) 2021-02-23 14:11:22 +01:00
Renée Kooi
26524270da
transloadit: fix upload-success handler using stale data 2021-02-12 11:41:42 +01:00
Renée Kooi
bba2a2543a
transloadit: fix polling fallback bugs (#2759)
* transloadit: fix polling attempts after Assembly completed

* core: mark postprocessing completion if upload is complete
2021-02-10 12:29:53 +00:00
Renée Kooi
63c49df92f
transloadit: fix #2626 (#2748) 2021-01-28 16:32:53 +00:00
Renée Kooi
f4eb113bbc
silence or fix lint warnings (#2665) 2020-11-30 10:58:33 +01:00
Carter Konz
970ac8df5b
companion,box: Box provider implementation (#2549)
* boilerplate for Box provider

TODO:
  - adapter
  - index
  - website/src/docs
  - tests

* Box provider implementation

- adapter
- index
- npm bufoonery
- lil' fixes

and MORE!

TODO:
- thumbnails 🤬
- tests
- docs

* Box provider: add brand icon, fix file icons

- token issues with thumbnail/logout

* Box provider: fix thumbnails, upload

- fix tokens for box
- implement `size()`
- make debug logging easier to find (bold blue)

learned:
- box needs cookie auth
- thumbnail requests come back as 202s

TODO:
- fix logout with form POST (zoom example)

* Box provider: fix logout

- add client info as formData to revoke post

TODO:
- tests cleanup
- package-lock fix
- docs

* Box provider: docs

TODO:
- tests

* Box provider: cleanup

TODO:
- tests

* fix error msg path for Box

- remove comment

* keeping up

- update ProviderViews import
- fix version string on Box package.json

* companion,box: exclude box from global module/examples while in beta

Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
2020-11-13 15:37:00 +01:00
Kevin van Zonneveld
e23106ebe4 Change status.transloadit.com to the more isolated transloaditstatus.com 2020-09-12 07:59:03 +02:00
Renée Kooi
6f5de4211c
transloadit: fully disable Tus fingerprinting (#2425)
In #2239, I added a backwards compatible implementation for the `resume`
option from tus-js-client v1, but forgot to disable it again in the
Transloadit plugin.

Fixes #2382
2020-08-03 13:27:11 +02:00
mokutsu-coursera
f1ef5bd809
companion,zoom: add implementation for Zoom plugin and Zoom Provider (#2342)
* [WIP] First pass at adding zoom plugin and zoom companion service for allowing imports from zoom cloud

* WIP. Remove zoom example and move zoom companion code into core companion package, update list endpoint to retrieve based on pagination token or dates available, and get size / download endpoint working.

TO DO:
- fix logout / token expiry
- investigate why test for loading config from file is not working as expected
- confirm pagination works

* Modify provider views to allow for cases with zoom provider when insufficient results exist to enable infinite scroll (but users may need to retrieve older results), update types tests. Linters failing on the provider views files

* Update uppy and companion for the zoom integration to use folders to represent months, and retrieve 1 month at a time.

- clean up code around response data items to explicitly show fields, and match style of other provider methods
- update license date to 2020 across repo
- enable download/uploado of json timeline files
- fix companion test to load credentials from file
- remove front end code no longer required now that folders are being used instead of loading more with button

* Change initial check for user authentication to use same endpoint so we can reuse the same app permission list (ie dont require additional permissions to read user data)

* Clean up zoom provider index file, add api call back to retrieve user account information such as created timestamp and email, fix file icons, remove unused strings, remove license date updates from branch

* Add permission list to grant configurations, remove undefined response body check, update error to match style of other providers, reorder svg attribute to match other icons

* Add request to get user email address for when we are retrieving user meetings and meeting recordings within zoom provider, clean up logout api call

* Update adapter to use meeting UUID when returning the meeting id to match the meeting ID associated with the recording file meeting. This should also resolve issues around reused meeting IDs from zoom.

* Fix companion test

* uppy,robodog: do not add zoom yet

* zoom: add publishConfig

* test: remove uppy.Zoom use from typescript e2e test

Co-authored-by: Renée Kooi <renee@kooi.me>
2020-07-30 11:01:21 +01:00
Marius
541feef81e
Update tus-js-client dependency to v2 (#2239)
Co-authored-by: Renée Kooi <renee@kooi.me>
2020-06-22 12:41:45 +02:00
Artur Paikin
948a17d86f add catch and error logging 2020-06-13 02:29:19 +01:00
Artur Paikin
ef5977643a Refactor to use fetchWithNetworkError 2020-06-12 15:27:00 +01:00
Artur Paikin
5273c46a06 Add NetworkError to Transloadit plugin, including socket.io’s connect_failed 2020-05-27 09:35:21 +02:00
Renée Kooi
52f8506632
transloadit: fix property name typo (#2287)
This was causing the `ASSEMBLY_COMPLETED` Assembly statuses to be stored
under an `undefined` key, so you wouldn't actually get the final status
in the result data for the upload.
2020-05-25 13:23:12 +02:00
Renée Kooi
aeae190b8b
transloadit: only cancel assemblies belonging to ongoing upload (#2277) 2020-05-25 11:34:10 +02:00