mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
coalesce options bucket and getKey (#5169)
* coalesce options `bucket` and `getKey` this is a breaking change! also: - remove `req` because it's an internal, unstable api that might change any time and should not be used directly - use an params object for getKey/bucket functions instead of positional arguments, to make it more clean, and easier to add more data in the future - add metadata to `bucket` whenever we are aware of it * fix lint * Apply suggestions from code review Co-authored-by: Antoine du Hamel <antoine@transloadit.com> * add back `Request` object also add filename to `bucket` for consistency * add migration steps * fix lint * Update docs/guides/migration-guides.md Co-authored-by: Antoine du Hamel <antoine@transloadit.com> --------- Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
This commit is contained in:
parent
087d8f07f0
commit
151da8bdfe
9 changed files with 71 additions and 47 deletions
|
|
@ -29,7 +29,7 @@ const options = {
|
|||
},
|
||||
},
|
||||
s3: {
|
||||
getKey: (req, filename) => `${crypto.randomUUID()}-${filename}`,
|
||||
getKey: ({ filename }) => `${crypto.randomUUID()}-${filename}`,
|
||||
key: process.env.COMPANION_AWS_KEY,
|
||||
secret: process.env.COMPANION_AWS_SECRET,
|
||||
bucket: process.env.COMPANION_AWS_BUCKET,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ const { app: companionApp } = companion.app({
|
|||
s3: {
|
||||
// This is the crucial part; set an endpoint template for the service you want to use.
|
||||
endpoint: 'https://{region}.digitaloceanspaces.com',
|
||||
getKey: (req, filename) => `${crypto.randomUUID()}-${filename}`,
|
||||
getKey: ({ filename }) => `${crypto.randomUUID()}-${filename}`,
|
||||
|
||||
key: process.env.COMPANION_AWS_KEY,
|
||||
secret: process.env.COMPANION_AWS_SECRET,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue