Skip to content

Commit

Permalink
Merge stable branch
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jun 18, 2024
2 parents 287764f + b5df7d0 commit a42b150
Show file tree
Hide file tree
Showing 52 changed files with 3,526 additions and 244 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ module.exports = {
'packages/@uppy/form/src/**/*.js',
'packages/@uppy/golden-retriever/src/**/*.js',
'packages/@uppy/google-drive/src/**/*.js',
'packages/@uppy/google-photos/src/**/*.js',
'packages/@uppy/image-editor/src/**/*.js',
'packages/@uppy/informer/src/**/*.js',
'packages/@uppy/instagram/src/**/*.js',
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/companion-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ jobs:
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- uses: docker/setup-buildx-action@v3
- name: Log in to DockerHub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Build and push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
push: true
context: .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ jobs:
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- uses: docker/setup-buildx-action@v3
- name: Log in to DockerHub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Build and push
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
push: true
context: .
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,29 @@ Released: 2024-03-28
- @uppy/vue: [v4.x] remove manual types (Antoine du Hamel / #4803)
- meta: prepare release workflow for beta versions (Antoine du Hamel)

## 3.27.0

Released: 2024-06-18

| Package | Version | Package | Version |
| -------------------- | ------- | -------------------- | ------- |
| @uppy/box | 2.4.0 | @uppy/onedrive | 3.4.0 |
| @uppy/companion | 4.14.0 | @uppy/provider-views | 3.13.0 |
| @uppy/core | 3.13.0 | @uppy/react | 3.4.0 |
| @uppy/dashboard | 3.9.0 | @uppy/remote-sources | 1.3.0 |
| @uppy/dropbox | 3.4.0 | @uppy/transloadit | 3.8.0 |
| @uppy/google-drive | 3.6.0 | uppy | 3.27.0 |
| @uppy/google-photos | 0.1.0 | | |

- @uppy/google-photos: add plugin (Mikael Finstad / #5061)
- examples: updating aws-nodejs example listParts logic for resuming uploads (Mitchell Rhoads / #5192)
- meta: Bump docker/login-action from 3.1.0 to 3.2.0 (dependabot\[bot] / #5217)
- meta: Bump docker/build-push-action from 5.3.0 to 5.4.0 (dependabot\[bot] / #5252)
- @uppy/transloadit: also fix outdated assembly transloadit:result (Merlijn Vos / #5246)
- docs: fix typo in the url (Evgenia Karunus)
- @uppy/companion: Bump ws from 8.8.1 to 8.17.1 (dependabot\[bot] / #5256)


## 3.26.1

Released: 2024-06-11
Expand Down
85 changes: 43 additions & 42 deletions README.md

Large diffs are not rendered by default.

25 changes: 14 additions & 11 deletions docs/companion.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ OAuth.
## When should I use it?

If you want to let users download files from [Box][], [Dropbox][], [Facebook][],
[Google Drive][googledrive], [Instagram][], [OneDrive][], [Unsplash][], [Import
from URL][url], or [Zoom][] — you need Companion.
[Google Drive][googledrive], [Google Photos][googlephotos], [Instagram][],
[OneDrive][], [Unsplash][], [Import from URL][url], or [Zoom][] — you need
Companion.

Companion supports the same [uploaders](/docs/guides/choosing-uploader) as Uppy:
[Tus](/docs/tus), [AWS S3](/docs/aws-s3), and [regular multipart](/docs/tus).
Expand Down Expand Up @@ -432,15 +433,16 @@ the secret, nothing else.

:::

| Service | Key | Environment variables |
| ------------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Box | `box` | `COMPANION_BOX_KEY`, `COMPANION_BOX_SECRET`, `COMPANION_BOX_SECRET_FILE` |
| Dropbox | `dropbox` | `COMPANION_DROPBOX_KEY`, `COMPANION_DROPBOX_SECRET`, `COMPANION_DROPBOX_SECRET_FILE` |
| Facebook | `facebook` | `COMPANION_FACEBOOK_KEY`, `COMPANION_FACEBOOK_SECRET`, `COMPANION_FACEBOOK_SECRET_FILE` |
| Google Drive | `drive` | `COMPANION_GOOGLE_KEY`, `COMPANION_GOOGLE_SECRET`, `COMPANION_GOOGLE_SECRET_FILE` |
| Instagram | `instagram` | `COMPANION_INSTAGRAM_KEY`, `COMPANION_INSTAGRAM_SECRET`, `COMPANION_INSTAGRAM_SECRET_FILE` |
| OneDrive | `onedrive` | `COMPANION_ONEDRIVE_KEY`, `COMPANION_ONEDRIVE_SECRET`, `COMPANION_ONEDRIVE_SECRET_FILE`, `COMPANION_ONEDRIVE_DOMAIN_VALIDATION` (Settings this variable to `true` enables a route that can be used to validate your app with OneDrive) |
| Zoom | `zoom` | `COMPANION_ZOOM_KEY`, `COMPANION_ZOOM_SECRET`, `COMPANION_ZOOM_SECRET_FILE`, `COMPANION_ZOOM_VERIFICATION_TOKEN` |
| Service | Key | Environment variables |
| ------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Box | `box` | `COMPANION_BOX_KEY`, `COMPANION_BOX_SECRET`, `COMPANION_BOX_SECRET_FILE` |
| Dropbox | `dropbox` | `COMPANION_DROPBOX_KEY`, `COMPANION_DROPBOX_SECRET`, `COMPANION_DROPBOX_SECRET_FILE` |
| Facebook | `facebook` | `COMPANION_FACEBOOK_KEY`, `COMPANION_FACEBOOK_SECRET`, `COMPANION_FACEBOOK_SECRET_FILE` |
| Google Drive | `drive` | `COMPANION_GOOGLE_KEY`, `COMPANION_GOOGLE_SECRET`, `COMPANION_GOOGLE_SECRET_FILE` |
| Google Photos | `googlephotos` | `COMPANION_GOOGLE_KEY`, `COMPANION_GOOGLE_SECRET`, `COMPANION_GOOGLE_SECRET_FILE` |
| Instagram | `instagram` | `COMPANION_INSTAGRAM_KEY`, `COMPANION_INSTAGRAM_SECRET`, `COMPANION_INSTAGRAM_SECRET_FILE` |
| OneDrive | `onedrive` | `COMPANION_ONEDRIVE_KEY`, `COMPANION_ONEDRIVE_SECRET`, `COMPANION_ONEDRIVE_SECRET_FILE`, `COMPANION_ONEDRIVE_DOMAIN_VALIDATION` (Settings this variable to `true` enables a route that can be used to validate your app with OneDrive) |
| Zoom | `zoom` | `COMPANION_ZOOM_KEY`, `COMPANION_ZOOM_SECRET`, `COMPANION_ZOOM_SECRET_FILE`, `COMPANION_ZOOM_VERIFICATION_TOKEN` |

#### `s3`

Expand Down Expand Up @@ -912,6 +914,7 @@ automatically restart when files are changed.
[dropbox]: /docs/dropbox
[facebook]: /docs/facebook
[googledrive]: /docs/google-drive
[googlephotos]: /docs/google-photos
[instagram]: /docs/instagram
[onedrive]: /docs/onedrive
[unsplash]: /docs/unsplash
Expand Down
17 changes: 9 additions & 8 deletions docs/guides/migration-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -829,14 +829,15 @@ to:

<div class="table-responsive">

| Provider | New Redirect URI |
| ------------ | ------------------------------------------------- |
| Dropbox | `https://$COMPANION_HOST_NAME/dropbox/redirect` |
| Google Drive | `https://$COMPANION_HOST_NAME/drive/redirect` |
| OneDrive | `https://$COMPANION_HOST_NAME/onedrive/redirect` |
| Box | `https://$YOUR_COMPANION_HOST_NAME/box/redirect` |
| Facebook | `https://$COMPANION_HOST_NAME/facebook/redirect` |
| Instagram | `https://$COMPANION_HOST_NAME/instagram/redirect` |
| Provider | New Redirect URI |
| ------------- | ---------------------------------------------------- |
| Dropbox | `https://$COMPANION_HOST_NAME/dropbox/redirect` |
| Google Drive | `https://$COMPANION_HOST_NAME/drive/redirect` |
| Google Photos | `https://$COMPANION_HOST_NAME/googlephotos/redirect` |
| OneDrive | `https://$COMPANION_HOST_NAME/onedrive/redirect` |
| Box | `https://$YOUR_COMPANION_HOST_NAME/box/redirect` |
| Facebook | `https://$COMPANION_HOST_NAME/facebook/redirect` |
| Instagram | `https://$COMPANION_HOST_NAME/instagram/redirect` |

</div>

Expand Down
16 changes: 8 additions & 8 deletions docs/sources/companion-plugins/google-drive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UppyCdnExample from '/src/components/UppyCdnExample';
# Google Drive

The `@uppy/google-drive` plugin lets users import files from their
[Google Drive](https://www.drive.google.com) account.
[Google Drive](https://drive.google.com) account.

:::tip

Expand All @@ -22,7 +22,7 @@ The `@uppy/google-drive` plugin lets users import files from their
## When should I use this?

When you want to let users import files from their
[Google Drive](https://www.drive.google.com) account.
[Google Drive](https://drive.google.com) account.

A [Companion](/docs/companion) instance is required for the Google Drive plugin
to work. Companion handles authentication with Google Drive, downloads the
Expand Down Expand Up @@ -112,12 +112,12 @@ https://api2.transloadit.com/companion/drive/redirect

Google will give you an OAuth client ID and client secret.

Configure the Google Drive key and secret in Companion. With the standalone
Companion server, specify environment variables:
Configure the Google key and secret in Companion. With the standalone Companion
server, specify environment variables:

```shell
export COMPANION_GOOGLE_KEY="Google Drive OAuth client ID"
export COMPANION_GOOGLE_SECRET="Google Drive OAuth client secret"
export COMPANION_GOOGLE_KEY="Google OAuth client ID"
export COMPANION_GOOGLE_SECRET="Google OAuth client secret"
```

When using the Companion Node.js API, configure these options:
Expand All @@ -126,8 +126,8 @@ When using the Companion Node.js API, configure these options:
companion.app({
providerOptions: {
drive: {
key: 'Google Drive OAuth client ID',
secret: 'Google Drive OAuth client secret',
key: 'Google OAuth client ID',
secret: 'Google OAuth client secret',
},
},
});
Expand Down
185 changes: 185 additions & 0 deletions docs/sources/companion-plugins/google-photos.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
---
slug: /google-photos
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import UppyCdnExample from '/src/components/UppyCdnExample';

# Google Photos

The `@uppy/google-photos` plugin lets users import files from their
[Google Photos](https://photos.google.com) account.

:::tip

[Try out the live example](/examples) or take it for a spin in
[StackBlitz](https://stackblitz.com/edit/vitejs-vite-zaqyaf?file=main.js).

:::

## When should I use this?

When you want to let users import files from their
[Google Photos](https://photos.google.com) account.

A [Companion](/docs/companion) instance is required for the Google Photos plugin
to work. Companion handles authentication with Google Photos, downloads the
photos/videos, and uploads them to the destination. This saves the user
bandwidth, especially helpful if they are on a mobile connection.

You can self-host Companion or get a hosted version with any
[Transloadit plan](https://transloadit.com/pricing/).

<Tabs>
<TabItem value="npm" label="NPM" default>

```shell
npm install @uppy/google-photos
```

</TabItem>

<TabItem value="yarn" label="Yarn">

```shell
yarn add @uppy/google-photos
```

</TabItem>

<TabItem value="cdn" label="CDN">
<UppyCdnExample>
{`
import { Uppy, GooglePhotos } from "{{UPPY_JS_URL}}"
const uppy = new Uppy()
uppy.use(GooglePhotos, {
// Options
})
`}
</UppyCdnExample>
</TabItem>
</Tabs>

## Use

Using Google Photos requires setup in both Uppy and Companion.

### Use in Uppy

```js {10-13} showLineNumbers
import Uppy from '@uppy/core';
import Dashboard from '@uppy/dashboard';
import GooglePhotos from '@uppy/google-photos';

import '@uppy/core/dist/style.min.css';
import '@uppy/dashboard/dist/style.min.css';

new Uppy()
.use(Dashboard, { inline: true, target: '#dashboard' })
.use(GooglePhotos, {
target: Dashboard,
companionUrl: 'https://your-companion.com',
});
```

### Use in Companion

To sign up for API keys, go to the
[Google Developer Console](https://console.developers.google.com/).

Create a project for your app if you don’t have one yet.

- On the project’s dashboard,
[enable the Google Photos API](https://developers.google.com/photos).
- [Set up OAuth authorization](https://developers.google.com/photos/library/guides/authorization).

The app page has a `"Redirect URIs"` field. Here, add:

```
https://$YOUR_COMPANION_HOST_NAME/googlephotos/redirect
```

If you are using Transloadit hosted Companion:

```
https://api2.transloadit.com/companion/googlephotos/redirect
```

Google will give you an OAuth client ID and client secret.

Configure the Google key and secret in Companion. With the standalone Companion
server, specify environment variables:

```shell
export COMPANION_GOOGLE_KEY="Google OAuth client ID"
export COMPANION_GOOGLE_SECRET="Google OAuth client secret"
```

When using the Companion Node.js API, configure these options:

```js
companion.app({
providerOptions: {
googlephotos: {
key: 'Google OAuth client ID',
secret: 'Google OAuth client secret',
},
},
});
```

## API

### Options

#### `id`

A unique identifier for this plugin (`string`, default: `'GooglePhotos'`).

#### `title`

Title / name shown in the UI, such as Dashboard tabs (`string`, default:
`'GooglePhotos'`).

#### `target`

DOM element, CSS selector, or plugin to place the drag and drop area into
(`string` or `Element`, default: `null`).

#### `companionUrl`

URL to a [Companion](/docs/companion) instance (`string`, default: `null`).

#### `companionHeaders`

Custom headers that should be sent along to [Companion](/docs/companion) on
every request (`Object`, default: `{}`).

#### `companionAllowedHosts`

The valid and authorised URL(s) from which OAuth responses should be accepted
(`string` or `RegExp` or `Array`, default: `companionUrl`).

This value can be a `string`, a `RegExp` pattern, or an `Array` of both. This is
useful when you have your [Companion](/docs/companion) running on several hosts.
Otherwise, the default value should do fine.

#### `companionCookiesRule`

This option correlates to the
[RequestCredentials value](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials)
(`string`, default: `'same-origin'`).

This tells the plugin whether to send cookies to [Companion](/docs/companion).

#### `locale`

```js
export default {
strings: {
pluginNameGooglePhotos: 'GooglePhotos',
},
};
```
2 changes: 1 addition & 1 deletion docs/sources/companion-plugins/instagram.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ When using the Companion Node.js API, configure these options:
```js
companion.app({
providerOptions: {
drive: {
instagram: {
key: 'Instagram OAuth client ID',
secret: 'Instagram OAuth client secret',
},
Expand Down
2 changes: 2 additions & 0 deletions docs/user-interfaces/dashboard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,8 @@ all Uppy plugins.
[Facebook](https://facebook.com).
- [`@uppy/google-drive`](/docs/google-drive) — import from
[Google Drive](https://drive.google.com).
- [`@uppy/google-photos`](/docs/google-photos) — import from
[Google Photos](https://photos.google.com).
- [`@uppy/instagram`](/docs/instagram) — import from
[Instagram](https://instagram.com).
- [`@uppy/onedrive`](/docs/onedrive) — import from
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/integration/dashboard-transloadit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ describe('Dashboard with Transloadit', () => {
client_ip: null,
client_referer: null,
transloadit_client:
'uppy-core:3.2.0,uppy-transloadit:3.1.3,uppy-tus:3.1.0,uppy-dropbox:3.1.1,uppy-box:2.1.1,uppy-facebook:3.1.1,uppy-google-drive:3.1.1,uppy-instagram:3.1.1,uppy-onedrive:3.1.1,uppy-zoom:2.1.1,uppy-url:3.3.1',
'uppy-core:3.2.0,uppy-transloadit:3.1.3,uppy-tus:3.1.0,uppy-dropbox:3.1.1,uppy-box:2.1.1,uppy-facebook:3.1.1,uppy-google-drive:3.1.1,uppy-google-photos:0.0.1,uppy-instagram:3.1.1,uppy-onedrive:3.1.1,uppy-zoom:2.1.1,uppy-url:3.3.1',
start_date: new Date().toISOString(),
upload_meta_data_extracted: false,
warnings: [],
Expand Down
Loading

0 comments on commit a42b150

Please sign in to comment.