Commit graph

9502 commits

Author SHA1 Message Date
Antoine du Hamel
f43ff477da
meta: minify the output watcher diff further 2024-01-19 10:52:28 +01:00
Mikael Finstad
ed7b4d4401
meta: remove comments from output watcher (#4875)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2024-01-19 10:40:00 +01:00
Antoine du Hamel
d53171d85b
@uppy/utils: improve types for findDOMElement (#4873) 2024-01-18 16:23:52 +01:00
Antoine du Hamel
218c6d160b
@uppy/code: allow plugins to type PluginState (#4872) 2024-01-18 12:25:49 +01:00
dependabot[bot]
93053e320f
build(deps): bump follow-redirects from 1.15.1 to 1.15.4 (#4862) 2024-01-17 14:44:45 +01:00
Antoine du Hamel
71b6511029
meta: add output-watcher GHA to help check output diff (#4868) 2024-01-17 12:19:31 +01:00
Antoine du Hamel
cecd68f9c8
meta: generate locale pack from output file (#4867) 2024-01-17 10:45:10 +01:00
Artur Paikin
4753a05754
meta: Comment on what we want to do about close, resetProgress, clearUploadedFiles, etc in the next major (#4865)
Comment on what we want to do about close, resetProgress, clearUploadedFiles, etc in the next major
2024-01-17 00:17:21 +07:00
Antoine du Hamel
06371a9d1a
meta: fix yarn build:clean (#4866) 2024-01-16 17:11:51 +01:00
Antoine du Hamel
984bdc135d
meta: use explicit-module-boundary-types lint rule (#4858)
* meta: use `explicit-module-boundary-types` instead of `explicit-function-return-type`

It seems to better align with what we are after: stability of public API types. We likely don't need explicit types for all functions, and it's a bit tedious to have when converting an existing plugin.
2024-01-08 13:57:02 +01:00
Merlijn Vos
7694ead67e
@uppy/form: use requestSubmit (#4852) 2024-01-04 10:44:35 +01:00
Merlijn Vos
0cb965e720
@uppy/provider-views: add referrerpolicy to images (#4853) 2024-01-04 10:36:19 +01:00
Antoine du Hamel
a356f10a9e
@uppy/core: add debugLogger as export in manual types (#4831) 2024-01-03 18:54:41 +01:00
Antoine du Hamel
2c05594511
meta: fix js2ts script (#4846) 2024-01-03 14:52:26 +01:00
Merlijn Vos
353c7cbfda
@uppy/xhr-upload: show remove button (#4851) 2024-01-03 11:53:27 +01:00
Antoine du Hamel
75b2e2363a
upgrade @transloadit/prettier-bytes (#4850) 2024-01-03 09:43:13 +01:00
darthf1
0b3f9bde2e
@uppy/core: add missing requiredMetaFields key in restrictions (#4819) 2024-01-03 09:36:35 +01:00
Merlijn Vos
b396d6fca4
bump tus-js-client version range (#4848) 2024-01-02 17:05:14 +01:00
dependabot[bot]
f781d4e41a
build(deps): bump aws/aws-sdk-php from 3.272.1 to 3.288.1 in /examples/aws-php (#4838)
build(deps): bump aws/aws-sdk-php in /examples/aws-php

Bumps [aws/aws-sdk-php](https://github.com/aws/aws-sdk-php) from 3.272.1 to 3.288.1.
- [Release notes](https://github.com/aws/aws-sdk-php/releases)
- [Commits](https://github.com/aws/aws-sdk-php/compare/3.272.1...3.288.1)

---
updated-dependencies:
- dependency-name: aws/aws-sdk-php
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 13:30:08 +01:00
Antoine du Hamel
5596369303
@uppy/dashboard: fix TypeError when file.remote is nullish (#4825) 2024-01-02 11:34:04 +01:00
Antoine du Hamel
df6043da0c
meta: fix js2ts script (#4844) 2023-12-30 12:42:59 +01:00
Žan Žlender
ba707fcd2d
fix "Save" button translation in hr_HR.ts (#4830)
The "Save" button when in ImageEditor mode is not properly translated because of the missing "save" property in locale.
2023-12-30 07:18:42 +00:00
Antoine du Hamel
57e6a7ea0f
meta: fix linting of .tsx files (#4843)
Those should be linted as `.ts` files, except with JSX support.
2023-12-29 11:44:16 +01:00
Antoine du Hamel
725bdc5a16
@uppy/core: fix types (#4842) 2023-12-28 17:06:39 +01:00
Antoine du Hamel
f76d76bafd
@uppy/utils: improve preprocess and postprocess types (#4841) 2023-12-28 17:03:15 +01:00
Mikael Finstad
aa6eb0a318
meta: fix yarn build:clean (#4840) 2023-12-28 11:57:58 +01:00
Antoine du Hamel
c7bb57b7f8
dev: remove extensions from Vite aliases
This started causing issues as we are transitioning to TS. By removing the file extension, Vite is able to pick up the correct file.
2023-12-18 15:18:33 +01:00
Antoine du Hamel
fefcb1c311
meta: fix "e2e" script 2023-12-15 23:13:16 +01:00
Murderlon
c48aa82a8a
@uppy/core: refactor to TS
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-12-14 19:39:43 +01:00
Antoine du Hamel
d0cc5b43e6
meta: fix TypeScript CI 2023-12-14 19:38:57 +01:00
Mikael Finstad
c66ad287ac
meta: fix clean script (#4820)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-12-14 11:10:54 +01:00
Antoine du Hamel
c2cb2a3a58
@uppy/companion-client: fix TypeError
`companionUrl` might be undefined if not provided by the user.
2023-12-13 11:22:04 +01:00
github-actions[bot]
49fa351b78
Release: uppy@3.21.0 (#4823)
| Package                | Version | Package                | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/aws-s3           |   3.6.0 | @uppy/instagram        |   3.2.0 |
| @uppy/aws-s3-multipart |  3.10.0 | @uppy/onedrive         |   3.2.0 |
| @uppy/box              |   2.2.0 | @uppy/provider-views   |   3.8.0 |
| @uppy/companion        |  4.12.0 | @uppy/store-default    |   3.2.0 |
| @uppy/companion-client |   3.7.0 | @uppy/tus              |   3.5.0 |
| @uppy/core             |   3.8.0 | @uppy/url              |   3.5.0 |
| @uppy/dropbox          |   3.2.0 | @uppy/utils            |   5.7.0 |
| @uppy/facebook         |   3.2.0 | @uppy/xhr-upload       |   3.6.0 |
| @uppy/google-drive     |   3.4.0 | @uppy/zoom             |   2.2.0 |
| @uppy/image-editor     |   2.4.0 | uppy                   |  3.21.0 |

- @uppy/provider-views: fix uploadRemoteFile undefined (Mikael Finstad / #4814)
- @uppy/companion: fix double tus uploads (Mikael Finstad / #4816)
- @uppy/companion: fix accelerated endpoints for presigned POST  (Mikael Finstad / #4817)
- @uppy/companion: fix `authProvider` property inconsistency (Mikael Finstad / #4672)
- @uppy/companion:  send certain onedrive errors to the user (Mikael Finstad / #4671)
- meta: fix typo in `lockfile_check.yml` name (Antoine du Hamel)
- @uppy/aws-s3: change Companion URL in tests (Antoine du Hamel)
- @uppy/set-state: fix types (Antoine du Hamel)
- @uppy/companion: Provider user sessions (Mikael Finstad / #4619)
- meta: fix `js2ts` script on Node.js 20+ (Merlijn Vos / #4802)
- @uppy/companion-client: avoid unnecessary preflight requests (Antoine du Hamel / #4462)
- meta: Migrate to AWS-SDK V3 syntax (Artur Paikin / #4810)
- @uppy/utils: fix import in test files (Antoine du Hamel / #4806)
- @uppy/core: Fix onBeforeFileAdded with Golden Retriever (Merlijn Vos / #4799)
- @uppy/image-editor: respect `cropperOptions.initialAspectRatio` (Lucklj521 / #4805)
2023-12-12 22:39:49 +00:00
Mikael Finstad
eb8a806908
fix uploadRemoteFile undefined (#4814)
* fix uploadRemoteFile undefined

for some reason, only when testing locally using VITE_COMPANION_URL=https://api2.transloadit.com/companion only
we get this error...
i'm thinking for some reason, the remote file gets serialized into state and then de-serialized again
causing remote.requestClient to be gone
so I solve it by instead storing the request clients in Uppy

fixes #4791

* fix bugs

* remove unrelated space changes

* apply suggestions

* Update Uppy.js

* fix lint

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-12-12 19:51:06 +00:00
Mikael Finstad
df36e12fb7
@uppy/companion: fix double tus uploads (#4816)
* fix double uploads

fixes #4815
also improve error logging when canceling

* don't close socket when pausing

because it prevented us from canceling an upload that is paused
note that we here sacrifice the ability to pause uploads and have other uploads take over the paused upload's rate limit queue spot.
this is sacrificed because we will soon remove the ability to pause/resume uploads anyways

* Update packages/@uppy/companion/src/server/Uploader.js

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

* Revert "don't close socket when pausing"

This reverts commit e4dbe77d2f.

---------

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2023-12-12 19:20:20 +00:00
Mikael Finstad
de987014a7
@uppy/companion: fix accelerated endpoints for presigned POST (#4817)
create a separate s3 client

for `createPresignedPost`
fixes #4809
2023-12-12 19:38:53 +08:00
Mikael Finstad
a329a15f33
@uppy/companion: fix authProvider property inconsistency (#4672)
* remove useless line

* fix broken cookie removal logic

related #4426

* fix mime type of thumbnails

not critical but some browsers might have problems

* simplify/speedup token generation

so we don't have to decode/decrypt/encode/encrypt so many times

* use instanceof instead of prop check

* Implement alternative provider auth

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`.

* refactor

* use respondWithError

also for thumbnails
for consistency

* fix prepareStream

it wasn't returning the status code (like `got` does on error)
it's needed to respond properly with a http error

* don't throw when missing i18n key

instead log error and show the key
this in on par with other i18n frameworks

* fix bugged try/catch

* allow aborting login too

and don't replace the whole view with a loader when plugin state loading
it will cause auth views to lose state
an inter-view loading text looks much more graceful and is how SearchProviderView works too

* add json http error support

add support for passing objects and messages from companion to uppy
this allows companion to for example give a more detailed error when authenticating

* don't tightly couple auth form with html form

don't force the user to use html form
and use preact for it, for flexibility

* fix i18n

* make contentType parameterized

* allow sending certain errors to the user

this is useful because:

      // onedrive gives some errors here that the user might want to know about
      // e.g. these happen if you try to login to a users in an organization,
      // without an Office365 licence or OneDrive account setup completed
      // 400: Tenant does not have a SPO license
      // 403: You do not have access to create this personal site or you do not have a valid license

* make `authProvider` consistent

always use the static property
ignoring the instance propety

fixes #4460

* fix bug

* fix test also

* don't have default content-type

* make a loginSimpleAuth api too

* make removeAuthToken protected

(cherry picked from commit 4be2b6fd91)

* fix lint

* run yarn format

* Apply suggestions from code review

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

* fix broken merge conflict

* improve inheritance

* fix bug

* fix bug with dynamic grant config

* use duck typing for error checks

see discussion here: https://github.com/transloadit/uppy/pull/4619#discussion_r1406225982

* Apply suggestions from code review

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

* fix broken lint fix script

* fix broken merge code

* try to fix flakey tets

* fix lint

* fix merge issue

---------

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-12-12 18:59:30 +08:00
Mikael Finstad
1b6c260cd5
send certain onedrive errors to the user (#4671)
* remove useless line

* fix broken cookie removal logic

related #4426

* fix mime type of thumbnails

not critical but some browsers might have problems

* simplify/speedup token generation

so we don't have to decode/decrypt/encode/encrypt so many times

* use instanceof instead of prop check

* Implement alternative provider auth

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`.

* refactor

* use respondWithError

also for thumbnails
for consistency

* fix prepareStream

it wasn't returning the status code (like `got` does on error)
it's needed to respond properly with a http error

* don't throw when missing i18n key

instead log error and show the key
this in on par with other i18n frameworks

* fix bugged try/catch

* allow aborting login too

and don't replace the whole view with a loader when plugin state loading
it will cause auth views to lose state
an inter-view loading text looks much more graceful and is how SearchProviderView works too

* add json http error support

add support for passing objects and messages from companion to uppy
this allows companion to for example give a more detailed error when authenticating

* don't tightly couple auth form with html form

don't force the user to use html form
and use preact for it, for flexibility

* fix i18n

* make contentType parameterized

* allow sending certain errors to the user

this is useful because:

      // onedrive gives some errors here that the user might want to know about
      // e.g. these happen if you try to login to a users in an organization,
      // without an Office365 licence or OneDrive account setup completed
      // 400: Tenant does not have a SPO license
      // 403: You do not have access to create this personal site or you do not have a valid license

* sending certain onedrive errors to the user

this is useful because:

      // onedrive gives some errors here that the user might want to know about
      // e.g. these happen if you try to login to a users in an organization,
      // without an Office365 licence or OneDrive account setup completed
      // 400: Tenant does not have a SPO license
      // 403: You do not have access to create this personal site or you do not have a valid license

* don't have default content-type

* make a loginSimpleAuth api too

* make removeAuthToken protected

(cherry picked from commit 4be2b6fd91)

* fix lint

* run yarn format

* Apply suggestions from code review

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

* fix broken merge conflict

* improve inheritance

* fix bug

* fix bug with dynamic grant config

* use duck typing for error checks

see discussion here: https://github.com/transloadit/uppy/pull/4619#discussion_r1406225982

* Apply suggestions from code review

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

* fix broken lint fix script

* fix broken merge code

* try to fix flakey tets

* fix lint

---------

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-12-07 22:29:42 +08:00
Antoine du Hamel
468d52f0f2
meta: fix typo in lockfile_check.yml name 2023-12-07 14:31:45 +01:00
Antoine du Hamel
3ec1f6a2ef
@uppy/aws-s3: change Companion URL in tests
Co-authored-by: Murderlon <merlijn@soverin.net>
2023-12-06 14:31:14 +01:00
Antoine du Hamel
b1a7644920
@uppy/set-state: fix types
Co-authored-by: Murderlon <merlijn@soverin.net>
2023-12-06 10:42:21 +01:00
Mikael Finstad
ec4bc58508
Provider user sessions (#4619)
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`.
2023-12-05 22:55:41 +01:00
Merlijn Vos
0bea173c2a
meta: fix js2ts script on Node.js 20+ (#4802)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-12-05 12:51:57 +01:00
Antoine du Hamel
f55b24c378
@uppy/companion-client: avoid unnecessary preflight requests (#4462)
According to https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests, we have so many preflight requests because we add `Uppy-Versions` header and `Content-Type: application/json` to each request. It's particularly not useful for for requests with no body / an empty body because the remote Companion doesn't check `Content-Type`.

It was added in b25f243627, and since f0f1105ef0, it is only used for log 
purposes.

Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2023-12-05 12:30:41 +01:00
Artur Paikin
a116db5147
Migrate to AWS-SDK V3 syntax (#4810) 2023-12-04 17:14:04 +00:00
Antoine du Hamel
58869e6287
@uppy/utils: fix import in test files (#4806) 2023-11-30 14:39:51 +01:00
Merlijn Vos
90da98d3d0
Fix onBeforeFileAdded with Golden Retriever (#4799) 2023-11-28 13:33:42 +01:00
Lucklj521
f2cce79898
@uppy/image-editor: respect cropperOptions.initialAspectRatio (#4805)
Co-authored-by: lijie <lijie@shangyuan.biz>
2023-11-27 13:25:29 +01:00
github-actions[bot]
de1b4abe47
Release: uppy@3.20.0 (#4804)
| Package                | Version | Package                | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/companion-client |   3.6.1 | @uppy/store-default    |   3.1.0 |
| @uppy/locales          |   3.5.0 | uppy                   |  3.20.0 |

- meta: uppy CDN: Export UIPlugin and BasePlugin (Artur Paikin / #4774)
- @uppy/locales: Add missing translations to de_DE (Leonhard Melzer / #4800)
- @uppy/store-default: refactor to typescript (Antoine du Hamel / #4785)
- meta: improve js2ts script (Antoine du Hamel / #4786)
- @uppy/companion-client: fix log type error (Mikael Finstad / #4766)
- @uppy/companion-client: revert breaking change (Antoine du Hamel / #4801)
- @uppy/locales: use TypeScript for source files (Antoine du Hamel / #4779)
- meta: migrate AWS SDK v2 to v3 in `bin/uploadcdn` (Trivikram Kamat / #4776)
2023-11-24 00:32:49 +00:00
Artur Paikin
df8eeaa46b
uppy CDN: Export UIPlugin and BasePlugin (#4774)
Export UIPlugin and BasePlugin
2023-11-22 14:29:08 +00:00