Commit graph

30 commits

Author SHA1 Message Date
Prakash
2d429a8aef
@uppy/aws-s3: remote uploads and golden retriever (#6186)
- add support for remote uploads
- add support for restore using golden-retriever
- update examples
- #6181 still persists

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2026-06-17 13:54:48 +05:30
Merlijn Vos
5684efa64e
Introduce @uppy/image-generator (#6056)
Closes #5378 

- Introduce `@uppy/image-generator`, a new plugin to generate images
based on a prompt via Transloadit
- until we have "golden templates" the idea is to just send
[steps](https://transloadit.com/docs/topics/templates/#overruling-templates-at-runtime)
- because we must send steps and since we must use signature
authentication for security, which is signed based on the params we
send, we can't reuse the `assemblyOptions` the consumers is already
passing to `@uppy/transloadit` (if they use that uploaders, not needed).
- Remove `SearchInput` (this component was trying to be too many things,
all with conditional boolean props, which is bad practise) in favor of
`useSearchForm` and reuse this hook in two new components `SearchView`
and `FilterInput`
- Reuse all the styles from `SearchProviderView`. This deviates from the
design in #5378. It felt too inconsistent to me to do another UI here
again. For the initial version, I think it's best to stay consistent and
then redesign with search providers taken into account too.
- Because the service is so slow, I went a bit further with the loading
state to show funny messages that rotate while loading mostly because
users will start thinking it is broken after 5 seconds while it fact we
are still loading. But open to ideas here.

This unfortunately means the integration for the consumer is not as lean
and pretty as you would hope. On the upside, it does give them complete
freedom.

```ts
.use(ImageGenerator, {
  assemblyOptions: async (prompt) => {
    const res = await fetch(`/assembly-options?prompt=${encodeURIComponent(prompt)}`)
    return res.json()
  }
})
```

on the consumer's server:

```ts
import crypto from 'node:crypto'

const utcDateString = (ms) => {
  return new Date(ms)
    .toISOString()
    .replace(/-/g, '/')
    .replace(/T/, ' ')
    .replace(/\.\d+Z$/, '+00:00')
}

// expire 1 hour from now (this must be milliseconds)
const expires = utcDateString(Date.now() + 1 * 60 * 60 * 1000)
const authKey = 'YOUR_TRANSLOADIT_KEY'
const authSecret = 'YOUR_TRANSLOADIT_SECRET'

const params = JSON.stringify({
  auth: {
    key: authKey,
    expires,
  },
  // can not contain any more steps, the only step must be /image/generate
  steps: {
    generated_image: { // can be named different
      robot: '/image/generate',
      result: true, // mandatory
      aspect_ratio: '2:3', // up to them
      model: 'flux-1.1-pro-ultra', // up to them
      prompt, // mandatory
      num_outputs: 2, // up to them
    },
  },
})
const signatureBytes = crypto.createHmac('sha384', authSecret).update(Buffer.from(params, 'utf-8'))
// The final signature needs the hash name in front, so
// the hashing algorithm can be updated in a backwards-compatible
// way when old algorithms become insecure.
const signature = `sha384:${signatureBytes.digest('hex')}`

// respond with { params, signature } JSON to the client
```


https://github.com/user-attachments/assets/9217e457-b38b-48ac-81f0-37a417309e98



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds AI image generation plugin using Transloadit, exports low-level
Transloadit APIs, and replaces SearchInput with new
FilterInput/SearchView + useSearchForm across provider views.
> 
> - **New plugin: `@uppy/image-generator`**
> - UI plugin to generate images from a prompt via Transloadit
(`src/index.tsx`, styles, locale, build configs).
> - Integrated into dev Dashboard and included in `uppy` bundle and
global styles.
> - **Provider Views refactor**
> - Remove `SearchInput`; introduce `useSearchForm`, `SearchView`, and
`FilterInput` components.
> - Update `ProviderView`, `SearchProviderView`, and `Webdav` to use new
components; export them from `@uppy/provider-views`.
> - **Transloadit updates**
> - Export `Assembly`, `AssemblyError`, and `Client` from
`@uppy/transloadit`.
>   - Minor internal change: normalize `assemblyOptions.fields`.
> - **Locales**
> - Add strings for image generation and minor additions (e.g.,
`chooseFiles`).
>   - Ensure locales build depends on `@uppy/image-generator`.
> - **Build config**
> - Turborepo: add `uppy#build:css` and hook `image-generator` into
locales build.
> - **Changesets**
> - `@uppy/image-generator` major; `@uppy/transloadit` minor;
`@uppy/locales` and `uppy` minor; `@uppy/provider-views` and
`@uppy/webdav` patch.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4b1b729069. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Prakash <qxprakash@gmail.com>
2025-12-03 11:59:52 +01:00
Prakash
e8692434d6
Merge @uppy/status-bar into @uppy/dashboard (#5825)
This pull request removes the `@uppy/status-bar` plugin and integrates
it directly into the `@uppy/dashboard` plugin.

### Breakdown of the merge

- The `StatusBar` class was refactored from a `UIPlugin` into a Preact
Class component.
- The `locale` strings from status-bar were merged into dashboard's
locale file.
- The Dashboard plugin now integrates the `StatusBar` component
directly, controlling its visibility and passing down all props ( i.e.
options that were specific to StatusBar (like showProgressDetails).
- The standalone StatusBar wrappers for React , Vue , svelte , Angular
were removed.
- every reference to the @uppy/status-bar package from the monorepo
(including in package.json and tsconfig.json files).
- fixed failing tests and removed redundant tests.

---------

Co-authored-by: Mikael Finstad <finstaden@gmail.com>
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2025-08-05 13:17:29 +02:00
Merlijn Vos
78299475ae
Migrate from Eslint/Prettier/Stylelint to Biome (#5794) 2025-07-01 14:55:41 +02:00
Mikael Finstad
c764961cc1
remove google photos 😢 (#5690)
we spent a lot of time on implementing it but google decided to remove it,
so we have no choice
closes #5469
2025-03-24 13:17:23 +00:00
Merlijn Vos
9164ad5feb
Add @uppy/webdav (#5551)
Co-authored-by: Dominik Schmidt <dev@dominik-schmidt.de>
2024-12-17 09:27:12 +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
Murderlon
b0c5dacbc5
meta: fix AwsS3 endpoint option in private/dev 2024-09-19 12:49:17 +02:00
Merlijn Vos
a750140335
Fix locale-pack for en_US (#5431) 2024-08-29 09:44:31 +02:00
Merlijn Vos
cd1a73627b
Add tsconfig to packages in private/ (#5432)
* Add tsconfig to packages in private/

* Remove `AwsS3Multipart` import

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-08-28 16:31:32 +02:00
Evgenia Karunus
b9582e1e67
Transform the accept prop into a string everywhere (#5380)
* `/dev/Dashboard.js` - add all restrictions for the development environment

* `AddFiles.tsx` - turn `accept` into a string

* everywhere - make `accept` a string across uppy
2024-08-01 15:18:55 +05:00
Mikael Finstad
e6674a1eee
@uppy/google-photos: add plugin (#5061) 2024-06-18 11:13:23 +02:00
Mikael Finstad
b910f84fe2
add test endpoint for dynamic oauth creds (#4667)
* add test endpoint for dynamic oauth creds

this allows us to test it on uppy.io (we can enable it for one provider like google drive for example)

* add to env.example
2023-09-20 18:09:47 +08:00
Mikael Finstad
a16e22eb6b
fix VITE_COMPANION_ALLOWED_HOSTS (#4690)
it was broken
2023-09-20 17:53:22 +08:00
Merlijn Vos
ef613e6a9f
Move remote file upload logic into companion-client (#4573) 2023-08-24 14:27:28 +02:00
Artur Paikin
1ab4db5e7c
Readme improvements (#4622)
* Make logo fit on the right of the table on laptop screens+

* Move table

* Update README.md

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

* No need to make logo smaller on all packages after all

* Accidental change

---------

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-08-15 14:39:04 +01:00
Mikael Finstad
90f7fb9197
@uppy/core: improve performance of validating & uploading files (#4402)
* 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>
2023-04-15 23:50:19 +08:00
Mikael Finstad
3dd1e5e68c
@uppy/provider-views: fix race condition when adding folders (#4384)
* fix race condtion when adding files

don't call addFolder from listAllFiles
because that would call addFile before all folders were loaded

also remove unused selectedFolders state

* fix also the case of adding multiple folders

* fix todo: remove SharedHandler

* remove loaderWrapper

* fix logic

* fix the last race condition

* fix broken duplicate file check

* fix logic

* prettiyfy loop

* add user feedback

so they know that something is happening

* run corepack yarn run build:locale-pack

* Revert "run corepack yarn run build:locale-pack"

This reverts commit 85548ce2fc.

* Revert "add user feedback"

This reverts commit 4060019c35.

* use async generator instead of p-map

* re-fix race-condition

* remove providerFileToId

as suggested by @arturi

* use addFiles instead of addFile

* rename function

* use provider-supplied file ID

instead of generating an ID, for providers that we whitelsit
this allows adding the same time many times (with a different path)

* call core directly

* improve dev dashboard

* disable experimental getAsFileSystemHandle

it seems to be causing problems when dropping folders with subfolders in newest chrome
e.g a folder with 50 files and a subfolder which in turn has another 50 files

also refactor and document the code more

* Update packages/@uppy/provider-views/src/ProviderView/ProviderView.jsx

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

* mov eto utils

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-04-04 12:13:39 +09:00
Antoine du Hamel
2ef662140b
@uppy/transloadit: fix assemblyOptions option (#4316) 2023-02-13 18:33:42 +01:00
Antoine du Hamel
bf1ff229fa
meta: fix transloadit-xhr dev example (#4149) 2022-10-18 21:46:13 +02:00
Mikael Finstad
35812ca378
Companion: rewrite request and purest to got (#3953)
* rewrite to async

* rewrite box and dropbox to got

(not yet working due to jest esm issues)

* downgrade got

* update developer notes

* rewrite

- rewrite remaining providers to got
- rewrite to async/await
- pull out adapt code into adapters
- provider/companion tests still todo

* add zoom to dev dashboard

* rewrites

- rewrite remaining providers to got and reuse code
- port tests
- remove request
- remove purest
- rewrite periodic ping job to got
- rewrite uploader to got
- rewrite "url" to got
- rewrite getRedirectEvaluator/request to got
- rewrite http/https agent/request to got
- rewrite credentials.js to got
- fix "todo: handle failures differently to return 400 for this case instead"
- add test for http/https agent
- improve test for credentials (remote/local)
- make /zoom/logout return 424 instead of 500 on credentials error
- remove useless http-agent tests
- fix various eslint warnings

* work around ts error

* remove forgotten change
2022-08-16 18:44:04 +07: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
Mikael Finstad
3277ac3589
@uppy/provider-views: improve logging (#3638)
* add testing dynamic oauth example

* improve logging levels

Log origin errors with error level

* Update Dashboard.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-06 16:28:58 +02:00
Artur Paikin
9a597114fd
Add @uppy/remote-sources preset/plugin (#3676)
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-06-07 18:56:02 +02:00
Antoine du Hamel
a77b039efc
dev: sign requests sent to Transloadit (#3517)
* dev: sign requests sent to Transloadit

* Address review comments
2022-04-21 16:08:28 +02:00
Artur Paikin
953ae5c929
@uppy/compressor: ignore remote files, calculate savings correctly (#3578) 2022-03-16 20:17:16 +00:00
Antoine du Hamel
f4f1b810b7
meta: use a single .env file for config (#3498)
Fixes: https://github.com/transloadit/uppy/issues/3473
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2022-02-17 15:47:15 +01:00
Renée Kooi
db47700321
Finishing touches on Companion dynamic Oauth (#2802)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2022-02-14 11:07:52 +01:00
Antoine du Hamel
2f15f61536
dev: move configuration to a .env file (#3430)
Putting the dev config in a git-ignored files improves DX and lower the
risk of a private dev key being committed by mistake.
2022-01-11 19:38:41 +01:00
Antoine du Hamel
b0bf1a3eb4
meta: move dev workspace to private/ (#3368)
* meta: move dev workspace to `private/`

* `DragDrop.html` -> `dragdrop.html`
2021-12-14 12:53:34 +01:00
Renamed from examples/dev/Dashboard.js (Browse further)