Преглед изворни кода

update docs, tests, and examples with companionUrl rename

Ifedapo Olarewaju пре 6 година
родитељ
комит
adeb2fecfa

+ 2 - 2
README.md

@@ -33,8 +33,8 @@ const Tus = require('@uppy/tus')
 
 
 const uppy = Uppy({ autoProceed: false })
 const uppy = Uppy({ autoProceed: false })
   .use(Dashboard, { trigger: '#select-files' })
   .use(Dashboard, { trigger: '#select-files' })
-  .use(GoogleDrive, { target: Dashboard, serverUrl: 'https://companion.uppy.io' })
-  .use(Instagram, { target: Dashboard, serverUrl: 'https://companion.uppy.io' })
+  .use(GoogleDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
+  .use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
   .use(Webcam, { target: Dashboard })
   .use(Webcam, { target: Dashboard })
   .use(Tus, { endpoint: 'https://master.tus.io/files/' })
   .use(Tus, { endpoint: 'https://master.tus.io/files/' })
   .on('complete', (result) => {
   .on('complete', (result) => {

+ 2 - 2
examples/aws-companion/main.js

@@ -10,7 +10,7 @@ const uppy = Uppy({
 })
 })
 
 
 uppy.use(GoogleDrive, {
 uppy.use(GoogleDrive, {
-  serverUrl: 'http://localhost:3020'
+  companionUrl: 'http://localhost:3020'
 })
 })
 uppy.use(Webcam)
 uppy.use(Webcam)
 uppy.use(Dashboard, {
 uppy.use(Dashboard, {
@@ -19,5 +19,5 @@ uppy.use(Dashboard, {
   plugins: ['GoogleDrive', 'Webcam']
   plugins: ['GoogleDrive', 'Webcam']
 })
 })
 uppy.use(AwsS3, {
 uppy.use(AwsS3, {
-  serverUrl: 'http://localhost:3020'
+  companionUrl: 'http://localhost:3020'
 })
 })

+ 3 - 3
examples/bundled/index.js

@@ -33,9 +33,9 @@ const uppy = Uppy({
     proudlyDisplayPoweredByUppy: true,
     proudlyDisplayPoweredByUppy: true,
     note: '2 files, images and video only'
     note: '2 files, images and video only'
   })
   })
-  .use(GoogleDrive, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Instagram, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Url, { target: Dashboard, serverUrl: 'http://localhost:3020' })
+  .use(GoogleDrive, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Instagram, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Url, { target: Dashboard, companionUrl: 'http://localhost:3020' })
   .use(Webcam, { target: Dashboard })
   .use(Webcam, { target: Dashboard })
   .use(Tus, { endpoint: TUS_ENDPOINT })
   .use(Tus, { endpoint: TUS_ENDPOINT })
 
 

+ 1 - 1
examples/custom-provider/client/MyCustomProvider.js

@@ -18,7 +18,7 @@ module.exports = class MyCustomProvider extends Plugin {
     // writing out the key explicitly for readability the key used to store
     // writing out the key explicitly for readability the key used to store
     // the provider instance must be equal to this.id.
     // the provider instance must be equal to this.id.
     this[this.id] = new Provider(uppy, {
     this[this.id] = new Provider(uppy, {
-      serverUrl: this.opts.serverUrl,
+      companionUrl: this.opts.companionUrl,
       provider: 'mycustomprovider'
       provider: 'mycustomprovider'
     })
     })
 
 

+ 2 - 2
examples/custom-provider/client/main.js

@@ -9,11 +9,11 @@ const uppy = Uppy({
 })
 })
 
 
 uppy.use(GoogleDrive, {
 uppy.use(GoogleDrive, {
-  serverUrl: 'http://localhost:3020'
+  companionUrl: 'http://localhost:3020'
 })
 })
 
 
 uppy.use(MyCustomProvider, {
 uppy.use(MyCustomProvider, {
-  serverUrl: 'http://localhost:3020'
+  companionUrl: 'http://localhost:3020'
 })
 })
 
 
 uppy.use(Dashboard, {
 uppy.use(Dashboard, {

+ 4 - 4
examples/dev/main.js

@@ -31,10 +31,10 @@ const uppy = Uppy({
     proudlyDisplayPoweredByUppy: true,
     proudlyDisplayPoweredByUppy: true,
     note: '2 files, images and video only'
     note: '2 files, images and video only'
   })
   })
-  .use(GoogleDrive, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Instagram, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Dropbox, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Url, { target: Dashboard, serverUrl: 'http://localhost:3020' })
+  .use(GoogleDrive, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Instagram, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Dropbox, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Url, { target: Dashboard, companionUrl: 'http://localhost:3020' })
   .use(Webcam, { target: Dashboard })
   .use(Webcam, { target: Dashboard })
   .use(Tus, { endpoint: TUS_ENDPOINT })
   .use(Tus, { endpoint: TUS_ENDPOINT })
   // .use(XHRUpload, { endpoint: XHR_ENDPOINT })
   // .use(XHRUpload, { endpoint: XHR_ENDPOINT })

+ 1 - 1
examples/digitalocean-spaces/main.js

@@ -12,4 +12,4 @@ uppy.use(Dashboard, {
 })
 })
 
 
 // No client side changes needed!
 // No client side changes needed!
-uppy.use(AwsS3, { serverUrl: '/companion' })
+uppy.use(AwsS3, { companionUrl: '/companion' })

+ 1 - 1
examples/react-example/App.js

@@ -16,7 +16,7 @@ module.exports = class App extends React.Component {
 
 
     this.uppy = new Uppy({ id: 'uppy1', autoProceed: true, debug: true })
     this.uppy = new Uppy({ id: 'uppy1', autoProceed: true, debug: true })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })
-      .use(GoogleDrive, { serverUrl: 'https://companion.uppy.io' })
+      .use(GoogleDrive, { companionUrl: 'https://companion.uppy.io' })
 
 
     this.uppy2 = new Uppy({ id: 'uppy2', autoProceed: false, debug: true })
     this.uppy2 = new Uppy({ id: 'uppy2', autoProceed: false, debug: true })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })

+ 2 - 2
examples/uppy-with-companion/client/index.html

@@ -12,8 +12,8 @@
     <script>
     <script>
       const uppy = Uppy.Core({debug: true, autoProceed: false})
       const uppy = Uppy.Core({debug: true, autoProceed: false})
         .use(Uppy.Dashboard, { trigger: '#uppyModalOpener' })
         .use(Uppy.Dashboard, { trigger: '#uppyModalOpener' })
-        .use(Uppy.Instagram, { target: Uppy.Dashboard, serverUrl: 'http://localhost:3020' })
-        .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, serverUrl: 'http://localhost:3020' })
+        .use(Uppy.Instagram, { target: Uppy.Dashboard, companionUrl: 'http://localhost:3020' })
+        .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, companionUrl: 'http://localhost:3020' })
         .use(Uppy.Tus, { endpoint: 'https://master.tus.io/files/' })
         .use(Uppy.Tus, { endpoint: 'https://master.tus.io/files/' })
 
 
       uppy.on('success', (fileCount) => {
       uppy.on('success', (fileCount) => {

+ 2 - 2
packages/uppy/types/uppy-tests.ts

@@ -17,8 +17,8 @@ import * as Uppy from '../';
 (() => {
 (() => {
   const uppy = Uppy.Core({ autoProceed: false })
   const uppy = Uppy.Core({ autoProceed: false })
     .use(Uppy.Dashboard, { trigger: '#select-files' })
     .use(Uppy.Dashboard, { trigger: '#select-files' })
-    .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, serverUrl: 'https://companion.uppy.io' })
-    .use(Uppy.Instagram, { target: Uppy.Dashboard, serverUrl: 'https://companion.uppy.io' })
+    .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, companionUrl: 'https://companion.uppy.io' })
+    .use(Uppy.Instagram, { target: Uppy.Dashboard, companionUrl: 'https://companion.uppy.io' })
     .use(Uppy.Webcam, { target: Uppy.Dashboard })
     .use(Uppy.Webcam, { target: Uppy.Dashboard })
     .use(Uppy.Tus, { endpoint: 'https://master.tus.io/files/' })
     .use(Uppy.Tus, { endpoint: 'https://master.tus.io/files/' })
     .on('complete', (result) => {
     .on('complete', (result) => {

+ 1 - 1
test/endtoend/create-react-app/src/App.js

@@ -15,7 +15,7 @@ class App extends Component {
 
 
     this.uppy = new Uppy({ id: 'uppy1', autoProceed: true, debug: true })
     this.uppy = new Uppy({ id: 'uppy1', autoProceed: true, debug: true })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })
-      .use(GoogleDrive, { serverUrl: 'https://companion.uppy.io' })
+      .use(GoogleDrive, { companionUrl: 'https://companion.uppy.io' })
 
 
     this.uppy2 = new Uppy({ id: 'uppy2', autoProceed: false, debug: true })
     this.uppy2 = new Uppy({ id: 'uppy2', autoProceed: false, debug: true })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })

+ 3 - 3
test/endtoend/providers/main.js

@@ -16,7 +16,7 @@ Uppy({
     target: '#uppyDashboard',
     target: '#uppyDashboard',
     inline: true
     inline: true
   })
   })
-  .use(GoogleDrive, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Instagram, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Dropbox, { target: Dashboard, serverUrl: 'http://localhost:3020' })
+  .use(GoogleDrive, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Instagram, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Dropbox, { target: Dashboard, companionUrl: 'http://localhost:3020' })
   .use(Tus, { endpoint: 'https://master.tus.io/files/' })
   .use(Tus, { endpoint: 'https://master.tus.io/files/' })

+ 4 - 4
test/endtoend/typescript/main.ts

@@ -32,10 +32,10 @@ const uppy = Core({
     proudlyDisplayPoweredByUppy: true,
     proudlyDisplayPoweredByUppy: true,
     note: '2 files, images and video only'
     note: '2 files, images and video only'
   })
   })
-  .use(GoogleDrive, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Instagram, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Dropbox, { target: Dashboard, serverUrl: 'http://localhost:3020' })
-  .use(Url, { target: Dashboard, serverUrl: 'http://localhost:3020' })
+  .use(GoogleDrive, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Instagram, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Dropbox, { target: Dashboard, companionUrl: 'http://localhost:3020' })
+  .use(Url, { target: Dashboard, companionUrl: 'http://localhost:3020' })
   .use(Webcam, { target: Dashboard })
   .use(Webcam, { target: Dashboard })
   .use(Tus, { endpoint: TUS_ENDPOINT })
   .use(Tus, { endpoint: TUS_ENDPOINT })
   .use(Form, { target: '#upload-form' })
   .use(Form, { target: '#upload-form' })

+ 1 - 1
test/endtoend/url-plugin/main.js

@@ -16,7 +16,7 @@ function initUrlPlugin (companionUrl) {
     })
     })
     .use(Url, {
     .use(Url, {
       target: Dashboard,
       target: Dashboard,
-      serverUrl: companionUrl
+      companionUrl: companionUrl
     })
     })
     .use(Tus, { endpoint: 'https://master.tus.io/files/' })
     .use(Tus, { endpoint: 'https://master.tus.io/files/' })
 }
 }

+ 2 - 2
website/src/docs/aws-s3-multipart.md

@@ -13,7 +13,7 @@ The `@uppy/aws-s3-multipart` plugin can be used to upload files directly to an S
 const AwsS3Multipart = require('@uppy/aws-s3-multipart')
 const AwsS3Multipart = require('@uppy/aws-s3-multipart')
 uppy.use(AwsS3Multipart, {
 uppy.use(AwsS3Multipart, {
   limit: 4,
   limit: 4,
-  serverUrl: 'https://uppy-companion.myapp.net/'
+  companionUrl: 'https://uppy-companion.myapp.net/'
 })
 })
 ```
 ```
 
 
@@ -41,7 +41,7 @@ The `@uppy/aws-s3-multipart` plugin has the following configurable options:
 
 
 The maximum amount of chunks to upload simultaneously. Set to `0` to disable limiting.
 The maximum amount of chunks to upload simultaneously. Set to `0` to disable limiting.
 
 
-### serverUrl: null
+### companionUrl: null
 
 
 The Companion URL to use for proxying calls to the S3 Multipart API.
 The Companion URL to use for proxying calls to the S3 Multipart API.
 
 

+ 3 - 3
website/src/docs/aws-s3.md

@@ -17,7 +17,7 @@ const ms = require('ms')
 uppy.use(AwsS3, {
 uppy.use(AwsS3, {
   limit: 2,
   limit: 2,
   timeout: ms('1 minute'),
   timeout: ms('1 minute'),
-  serverUrl: 'https://uppy-companion.myapp.com/'
+  companionUrl: 'https://uppy-companion.myapp.com/'
 })
 })
 ```
 ```
 
 
@@ -49,13 +49,13 @@ The `@uppy/aws-s3` plugin has the following configurable options:
 
 
 A unique identifier for this plugin. Defaults to `'AwsS3'`.
 A unique identifier for this plugin. Defaults to `'AwsS3'`.
 
 
-### `serverUrl`
+### `companionUrl`
 
 
 When using [Companion][companion docs] to sign S3 uploads, set this option to the root URL of the Companion instance.
 When using [Companion][companion docs] to sign S3 uploads, set this option to the root URL of the Companion instance.
 
 
 ```js
 ```js
 uppy.use(AwsS3, {
 uppy.use(AwsS3, {
-  serverUrl: 'https://uppy-companion.my-app.com/'
+  companionUrl: 'https://uppy-companion.my-app.com/'
 })
 })
 ```
 ```
 
 

+ 3 - 3
website/src/docs/dropbox.md

@@ -52,7 +52,7 @@ The `@uppy/dropbox` plugin has the following configurable options:
 ```js
 ```js
 uppy.use(Dropbox, {
 uppy.use(Dropbox, {
   target: Dashboard,
   target: Dashboard,
-  serverUrl: 'https://companion.uppy.io/',
+  companionUrl: 'https://companion.uppy.io/',
 })
 })
 ```
 ```
 
 
@@ -68,7 +68,7 @@ Title / name shown in the UI, such as Dashboard tabs. It defaults to `'Dropbox'`
 
 
 DOM element, CSS selector, or plugin to mount the Dropbox provider into. This should normally be the Dashboard.
 DOM element, CSS selector, or plugin to mount the Dropbox provider into. This should normally be the Dashboard.
 
 
-### `serverUrl: null`
+### `companionUrl: null`
 
 
 URL to a [Companion](/docs/companion) instance.
 URL to a [Companion](/docs/companion) instance.
 
 
@@ -76,7 +76,7 @@ URL to a [Companion](/docs/companion) instance.
 
 
 Custom headers that should be sent along to [Companion](/docs/companion) on every request.
 Custom headers that should be sent along to [Companion](/docs/companion) on every request.
 
 
-### `serverPattern: serverUrl`
+### `companionAllowedHosts: companionUrl`
 
 
 The valid and authorised URL(s) from which OAuth responses should be accepted.
 The valid and authorised URL(s) from which OAuth responses should be accepted.
 
 

+ 3 - 3
website/src/docs/google-drive.md

@@ -51,7 +51,7 @@ The `@uppy/google-drive` plugin has the following configurable options:
 ```js
 ```js
 uppy.use(GoogleDrive, {
 uppy.use(GoogleDrive, {
   target: Dashboard,
   target: Dashboard,
-  serverUrl: 'https://companion.uppy.io/',
+  companionUrl: 'https://companion.uppy.io/',
 })
 })
 ```
 ```
 
 
@@ -67,7 +67,7 @@ Configures the title / name shown in the UI, for instance, on Dashboard tabs. It
 
 
 DOM element, CSS selector, or plugin to mount the Google Drive provider into. This should normally be the the [`@uppy/dashboard`](/docs/dashboard) plugin.
 DOM element, CSS selector, or plugin to mount the Google Drive provider into. This should normally be the the [`@uppy/dashboard`](/docs/dashboard) plugin.
 
 
-### `serverUrl: null`
+### `companionUrl: null`
 
 
 URL to a [Companion](/docs/companion) instance.
 URL to a [Companion](/docs/companion) instance.
 
 
@@ -75,7 +75,7 @@ URL to a [Companion](/docs/companion) instance.
 
 
 Custom headers that should be sent along to [Companion](/docs/companion) on every request.
 Custom headers that should be sent along to [Companion](/docs/companion) on every request.
 
 
-### `serverPattern: serverUrl`
+### `companionAllowedHosts: companionUrl`
 
 
 The valid and authorised URL(s) from which OAuth responses should be accepted.
 The valid and authorised URL(s) from which OAuth responses should be accepted.
 
 

+ 3 - 3
website/src/docs/instagram.md

@@ -53,7 +53,7 @@ The `@uppy/instagram` plugin has the following configurable options:
 ```js
 ```js
 uppy.use(Instagram, {
 uppy.use(Instagram, {
   target: Dashboard,
   target: Dashboard,
-  serverUrl: 'https://companion.uppy.io/',
+  companionUrl: 'https://companion.uppy.io/',
 })
 })
 ```
 ```
 
 
@@ -69,7 +69,7 @@ Configures the title / name shown in the UI, for instance, on Dashboard tabs. It
 
 
 DOM element, CSS selector, or plugin to mount the Instagram provider into. This should normally be the Dashboard.
 DOM element, CSS selector, or plugin to mount the Instagram provider into. This should normally be the Dashboard.
 
 
-### `serverUrl: null`
+### `companionUrl: null`
 
 
 URL to a [Companion](/docs/companion) instance.
 URL to a [Companion](/docs/companion) instance.
 
 
@@ -77,7 +77,7 @@ URL to a [Companion](/docs/companion) instance.
 
 
 Custom headers that should be sent along to [Companion](/docs/companion) on every request.
 Custom headers that should be sent along to [Companion](/docs/companion) on every request.
 
 
-### `serverPattern: serverUrl`
+### `companionAllowedHosts: companionUrl`
 
 
 The valid and authorised URL(s) from which OAuth responses should be accepted.
 The valid and authorised URL(s) from which OAuth responses should be accepted.
 
 

+ 5 - 5
website/src/docs/providers.md

@@ -10,7 +10,7 @@ The Provider plugins help you connect to your accounts with remote file provider
 
 
 As of now, the supported providers are [**Dropbox**](/docs/dropbox), [**GoogleDrive**](/docs/google-drive), [**Instagram**](/docs/instagram), and [**URL**](/docs/url).
 As of now, the supported providers are [**Dropbox**](/docs/dropbox), [**GoogleDrive**](/docs/google-drive), [**Instagram**](/docs/instagram), and [**URL**](/docs/url).
 
 
-Usage of the Provider plugins is not that different from any other *acquirer* plugin, except that it takes an extra option `serverUrl`, which specifies the URL to the Companion that you are running. This allows Uppy to know what server to connect to when datacenter operations are required by the provider plugin.
+Usage of the Provider plugins is not that different from any other *acquirer* plugin, except that it takes an extra option `companionUrl`, which specifies the URL to the Companion that you are running. This allows Uppy to know what server to connect to when datacenter operations are required by the provider plugin.
 
 
 Here's a quick example:
 Here's a quick example:
 
 
@@ -24,19 +24,19 @@ uppy.use(Dashboard, {
 
 
 // for Google Drive
 // for Google Drive
 const GoogleDrive = require('@uppy/google-drive')
 const GoogleDrive = require('@uppy/google-drive')
-uppy.use(GoogleDrive, {target: Dashboard, serverUrl: 'http://localhost:3020'})
+uppy.use(GoogleDrive, {target: Dashboard, companionUrl: 'http://localhost:3020'})
 
 
 // for Dropbox
 // for Dropbox
 const Dropbox = require('@uppy/dropbox')
 const Dropbox = require('@uppy/dropbox')
-uppy.use(Dropbox, {target: Dashboard, serverUrl: 'http://localhost:3020'})
+uppy.use(Dropbox, {target: Dashboard, companionUrl: 'http://localhost:3020'})
 
 
 // for Instagram
 // for Instagram
 const Instagram = require('@uppy/instagram')
 const Instagram = require('@uppy/instagram')
-uppy.use(Instagram, {target: Dashboard, serverUrl: 'http://localhost:3020'})
+uppy.use(Instagram, {target: Dashboard, companionUrl: 'http://localhost:3020'})
 
 
 // for URL
 // for URL
 const Url = require('@uppy/url')
 const Url = require('@uppy/url')
-uppy.use(Url, {target: Dashboard, serverUrl: 'http://localhost:3020'})
+uppy.use(Url, {target: Dashboard, companionUrl: 'http://localhost:3020'})
 ```
 ```
 
 
 ⚠️ The [Dashboard](/docs/dashboard) plugin is recommended as a universal container to all Provider plugins. It also comes with file previews, progress reporting and more. If you are using the Dashboard, it already [comes with all the nessesary styles](/docs/dashboard/#CSS) and functionality for Providers to work well.
 ⚠️ The [Dashboard](/docs/dashboard) plugin is recommended as a universal container to all Provider plugins. It also comes with file previews, progress reporting and more. If you are using the Dashboard, it already [comes with all the nessesary styles](/docs/dashboard/#CSS) and functionality for Providers to work well.

+ 2 - 2
website/src/docs/robodog-picker.md

@@ -77,11 +77,11 @@ Array of providers to use. Each entry is the name of a provider. The available o
 - `'url'` – Import files from public Web URLs using [Uppy Companion][companion].
 - `'url'` – Import files from public Web URLs using [Uppy Companion][companion].
 - `'webcam'` – Take photos and record videos using thee user's device camera.
 - `'webcam'` – Take photos and record videos using thee user's device camera.
 
 
-### `serverUrl: Transloadit.COMPANION`
+### `companionUrl: Transloadit.COMPANION`
 
 
 The URL to a [Uppy Companion][companion] server to use.
 The URL to a [Uppy Companion][companion] server to use.
 
 
-### `serverPattern: Transloadit.COMPANION_PATTERN`
+### `companionAllowedHosts: Transloadit.COMPANION_PATTERN`
 
 
 The valid and authorised URL(s) from which OAuth responses should be accepted.
 The valid and authorised URL(s) from which OAuth responses should be accepted.
 
 

+ 9 - 9
website/src/docs/transloadit.md

@@ -59,38 +59,38 @@ const Dropbox = require('@uppy/dropbox')
 const Transloadit = require('@uppy/transloadit')
 const Transloadit = require('@uppy/transloadit')
 
 
 uppy.use(Dropbox, {
 uppy.use(Dropbox, {
-  serverUrl: Transloadit.COMPANION
-  serverPattern: Transloadit.COMPANION_PATTERN
+  companionUrl: Transloadit.COMPANION
+  companionAllowedHosts: Transloadit.COMPANION_PATTERN
 })
 })
 ```
 ```
 
 
-When using `Transloadit.COMPANION`, you should also configure [`serverPattern: Transloadit.COMPANION_PATTERN`](#Transloadit-COMPANION-PATTERN).
+When using `Transloadit.COMPANION`, you should also configure [`companionAllowedHosts: Transloadit.COMPANION_PATTERN`](#Transloadit-COMPANION-PATTERN).
 
 
 The value of this constant is `https://api2.transloadit.com/companion`. If you are using a custom [`service`](#service) option, you should also set a custom host option in your provider plugins, by taking a Transloadit API url and appending `/companion`:
 The value of this constant is `https://api2.transloadit.com/companion`. If you are using a custom [`service`](#service) option, you should also set a custom host option in your provider plugins, by taking a Transloadit API url and appending `/companion`:
 
 
 ```js
 ```js
 uppy.use(Dropbox, {
 uppy.use(Dropbox, {
-  serverUrl: 'https://api2-us-east-1.transloadit.com/companion'
+  companionUrl: 'https://api2-us-east-1.transloadit.com/companion'
 })
 })
 ```
 ```
 
 
 ### `Transloadit.COMPANION_PATTERN`
 ### `Transloadit.COMPANION_PATTERN`
 
 
-A RegExp pattern matching Transloadit's hosted companion endpoints. The pattern is used in remote provider `serverPattern` options, to ensure that third party authentication messages cannot be faked by an attacker's page, but can only originate from Transloadit's servers.
+A RegExp pattern matching Transloadit's hosted companion endpoints. The pattern is used in remote provider `companionAllowedHosts` options, to ensure that third party authentication messages cannot be faked by an attacker's page, but can only originate from Transloadit's servers.
 
 
-Use it whenever you use `serverUrl: Transloadit.COMPANION`, like so:
+Use it whenever you use `companionUrl: Transloadit.COMPANION`, like so:
 
 
 ```js
 ```js
 const Dropbox = require('@uppy/dropbox')
 const Dropbox = require('@uppy/dropbox')
 const Transloadit = require('@uppy/transloadit')
 const Transloadit = require('@uppy/transloadit')
 
 
 uppy.use(Dropbox, {
 uppy.use(Dropbox, {
-  serverUrl: Transloadit.COMPANION
-  serverPattern: Transloadit.COMPANION_PATTERN
+  companionUrl: Transloadit.COMPANION
+  companionAllowedHosts: Transloadit.COMPANION_PATTERN
 })
 })
 ```
 ```
 
 
-The value of this constant covers _all_ Transloadit's Companion servers, so it does not need to be changed if you are using a custom [`service`](#service) option. However, if you are not using the Transloadit Companion servers at `*.transloadit.com`, make sure to set the `serverPattern` option to something that matches what you do use.
+The value of this constant covers _all_ Transloadit's Companion servers, so it does not need to be changed if you are using a custom [`service`](#service) option. However, if you are not using the Transloadit Companion servers at `*.transloadit.com`, make sure to set the `companionAllowedHosts` option to something that matches what you do use.
 
 
 ## Options
 ## Options
 
 

+ 2 - 2
website/src/docs/url.md

@@ -56,7 +56,7 @@ The `@uppy/url` plugin has the following configurable options:
 ```js
 ```js
 uppy.use(Url, {
 uppy.use(Url, {
   target: Dashboard,
   target: Dashboard,
-  serverUrl: 'https://companion.uppy.io/',
+  companionUrl: 'https://companion.uppy.io/',
   locale: {}
   locale: {}
 })
 })
 ```
 ```
@@ -73,7 +73,7 @@ Configures the title / name shown in the UI, for instance, on Dashboard tabs. It
 
 
 DOM element, CSS selector, or plugin to mount the URL provider into. This should normally be the Dashboard.
 DOM element, CSS selector, or plugin to mount the URL provider into. This should normally be the Dashboard.
 
 
-### `serverUrl: null`
+### `companionUrl: null`
 
 
 URL to an Companion instance.
 URL to an Companion instance.
 
 

+ 4 - 4
website/src/examples/dashboard/app.es6

@@ -52,19 +52,19 @@ function uppyInit () {
   })
   })
 
 
   if (opts.GoogleDrive) {
   if (opts.GoogleDrive) {
-    uppy.use(GoogleDrive, { target: Dashboard, serverUrl: COMPANION })
+    uppy.use(GoogleDrive, { target: Dashboard, companionUrl: COMPANION })
   }
   }
 
 
   if (opts.Dropbox) {
   if (opts.Dropbox) {
-    uppy.use(Dropbox, { target: Dashboard, serverUrl: COMPANION })
+    uppy.use(Dropbox, { target: Dashboard, companionUrl: COMPANION })
   }
   }
 
 
   if (opts.Instagram) {
   if (opts.Instagram) {
-    uppy.use(Instagram, { target: Dashboard, serverUrl: COMPANION })
+    uppy.use(Instagram, { target: Dashboard, companionUrl: COMPANION })
   }
   }
 
 
   if (opts.Url) {
   if (opts.Url) {
-    uppy.use(Url, { target: Dashboard, serverUrl: COMPANION })
+    uppy.use(Url, { target: Dashboard, companionUrl: COMPANION })
   }
   }
 
 
   if (opts.Webcam) {
   if (opts.Webcam) {

+ 3 - 3
website/src/examples/dashboard/index.ejs

@@ -52,9 +52,9 @@ const uppy = Uppy({
   ],
   ],
   browserBackButtonClose: true
   browserBackButtonClose: true
 })
 })
-.use(GoogleDrive, { target: Dashboard, serverUrl: 'https://companion.uppy.io' })
-.use(Dropbox, { target: Dashboard, serverUrl: 'https://companion.uppy.io' })
-.use(Instagram, { target: Dashboard, serverUrl: 'https://companion.uppy.io' })
+.use(GoogleDrive, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
+.use(Dropbox, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
+.use(Instagram, { target: Dashboard, companionUrl: 'https://companion.uppy.io' })
 .use(Webcam, { target: Dashboard })
 .use(Webcam, { target: Dashboard })
 .use(Tus, { endpoint: 'https://master.tus.io/files/' })
 .use(Tus, { endpoint: 'https://master.tus.io/files/' })
 
 

+ 2 - 2
website/src/examples/transloadit/app.es6

@@ -61,8 +61,8 @@ function initUppy () {
     })
     })
     .use(Instagram, {
     .use(Instagram, {
       target: Dashboard,
       target: Dashboard,
-      serverUrl: 'https://api2.transloadit.com/companion',
-      serverPattern: Transloadit.COMPANION_PATTERN
+      companionUrl: 'https://api2.transloadit.com/companion',
+      companionAllowedHosts: Transloadit.COMPANION_PATTERN
     })
     })
     .use(Webcam, { target: Dashboard })
     .use(Webcam, { target: Dashboard })
 
 

+ 1 - 1
website/src/examples/transloadit/index.ejs

@@ -126,7 +126,7 @@ uppy
     },
     },
     waitForEncoding: true
     waitForEncoding: true
   })
   })
-  .use(Instagram, { target: Dashboard, serverUrl: 'https://api2.transloadit.com/companion', serverPattern: /\.transloadit\.com$/ })
+  .use(Instagram, { target: Dashboard, companionUrl: 'https://api2.transloadit.com/companion', companionAllowedHosts: /\.transloadit\.com$/ })
   .use(Dashboard, {
   .use(Dashboard, {
     inline: true,
     inline: true,
     maxHeight: 400,
     maxHeight: 400,

+ 1 - 1
website/src/frontpage-code-sample.ejs

@@ -22,7 +22,7 @@ Uppy()
   })
   })
   .use(Instagram, {
   .use(Instagram, {
     target: Dashboard,
     target: Dashboard,
-    serverUrl: 'https://companion.uppy.io'
+    companionUrl: 'https://companion.uppy.io'
   })
   })
   .use(Tus, { endpoint: 'https://master.tus.io/files/' })
   .use(Tus, { endpoint: 'https://master.tus.io/files/' })
   .on('complete', (result) => {
   .on('complete', (result) => {

+ 3 - 3
website/themes/uppy/layout/index.ejs

@@ -102,10 +102,10 @@
         { id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
         { id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
       ]
       ]
     })
     })
-    .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, serverUrl: COMPANION_ENDPOINT })
-    .use(Uppy.Instagram, { target: Uppy.Dashboard, serverUrl: COMPANION_ENDPOINT })
+    .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
+    .use(Uppy.Instagram, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
     .use(Uppy.Webcam, { target: Uppy.Dashboard })
     .use(Uppy.Webcam, { target: Uppy.Dashboard })
-    .use(Uppy.Url, { target: Uppy.Dashboard, serverUrl: COMPANION_ENDPOINT })
+    .use(Uppy.Url, { target: Uppy.Dashboard, companionUrl: COMPANION_ENDPOINT })
     .use(Uppy.Tus, { endpoint: TUS_ENDPOINT})
     .use(Uppy.Tus, { endpoint: TUS_ENDPOINT})
 
 
   uppy.on('success', (files) => {
   uppy.on('success', (files) => {

+ 1 - 1
website/themes/uppy/layout/partials/frontpage-code-sample.html

@@ -12,7 +12,7 @@
   <span class="token punctuation">}</span><span class="token punctuation">)</span>
   <span class="token punctuation">}</span><span class="token punctuation">)</span>
   <span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Instagram<span class="token punctuation">,</span> <span class="token punctuation">{</span>
   <span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Instagram<span class="token punctuation">,</span> <span class="token punctuation">{</span>
     target<span class="token punctuation">:</span> Dashboard<span class="token punctuation">,</span>
     target<span class="token punctuation">:</span> Dashboard<span class="token punctuation">,</span>
-    serverUrl<span class="token punctuation">:</span> <span class="token string">&apos;https://companion.uppy.io&apos;</span>
+    companionUrl<span class="token punctuation">:</span> <span class="token string">&apos;https://companion.uppy.io&apos;</span>
   <span class="token punctuation">}</span><span class="token punctuation">)</span>
   <span class="token punctuation">}</span><span class="token punctuation">)</span>
   <span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Tus<span class="token punctuation">,</span> <span class="token punctuation">{</span> endpoint<span class="token punctuation">:</span> <span class="token string">&apos;https://master.tus.io/files/&apos;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
   <span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Tus<span class="token punctuation">,</span> <span class="token punctuation">{</span> endpoint<span class="token punctuation">:</span> <span class="token string">&apos;https://master.tus.io/files/&apos;</span> <span class="token punctuation">}</span><span class="token punctuation">)</span>
   <span class="token punctuation">.</span><span class="token function">on</span><span class="token punctuation">(</span><span class="token string">&apos;complete&apos;</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">result</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
   <span class="token punctuation">.</span><span class="token function">on</span><span class="token punctuation">(</span><span class="token string">&apos;complete&apos;</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">result</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>