Browse Source

refactor: rename host option to serverUrl

Ifedapo Olarewaju 6 năm trước cách đây
mục cha
commit
c48c8fcb70
36 tập tin đã thay đổi với 80 bổ sung80 xóa
  1. 2 2
      README.md
  2. 2 2
      examples/aws-uppy-server/main.js
  3. 1 1
      examples/aws-uppy-server/server.js
  4. 2 2
      examples/bundled-example/main.js
  5. 1 1
      examples/custom-provider/client/MyCustomProvider.js
  6. 2 2
      examples/custom-provider/client/main.js
  7. 1 1
      examples/digitalocean-spaces/main.js
  8. 1 1
      examples/digitalocean-spaces/server.js
  9. 1 1
      examples/react-example/App.js
  10. 2 2
      examples/uppy-with-server/client/index.html
  11. 3 3
      src/plugins/AwsS3/Multipart.js
  12. 3 3
      src/plugins/AwsS3/index.js
  13. 3 3
      src/plugins/Dropbox/index.js
  14. 3 3
      src/plugins/GoogleDrive/index.js
  15. 2 2
      src/plugins/Instagram/index.js
  16. 3 3
      src/plugins/Transloadit/index.js
  17. 1 1
      src/plugins/Tus.js
  18. 3 3
      src/plugins/Url/index.js
  19. 1 1
      src/plugins/XHRUpload.js
  20. 2 2
      src/server/RequestClient.js
  21. 2 2
      src/server/RequestClient.test.js
  22. 3 3
      src/views/ProviderView/index.js
  23. 5 5
      types/index.d.ts
  24. 2 2
      types/uppy-tests.ts
  25. 2 2
      website/src/docs/aws-s3-multipart.md
  26. 3 3
      website/src/docs/aws-s3.md
  27. 2 2
      website/src/docs/dropbox.md
  28. 2 2
      website/src/docs/google-drive.md
  29. 2 2
      website/src/docs/instagram.md
  30. 5 5
      website/src/docs/providers.md
  31. 2 2
      website/src/docs/transloadit.md
  32. 2 2
      website/src/docs/url.md
  33. 4 4
      website/src/examples/dashboard/app.es6
  34. 3 3
      website/src/examples/dashboard/index.ejs
  35. 1 1
      website/src/examples/transloadit/app.es6
  36. 1 1
      website/src/examples/transloadit/index.ejs

+ 2 - 2
README.md

@@ -33,8 +33,8 @@ const Tus = require('uppy/lib/plugins/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, host: 'https://server.uppy.io' })
-  .use(Instagram, { target: Dashboard, host: 'https://server.uppy.io' })
+  .use(GoogleDrive, { target: Dashboard, serverUrl: 'https://server.uppy.io' })
+  .use(Instagram, { target: Dashboard, serverUrl: 'https://server.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-uppy-server/main.js

@@ -10,7 +10,7 @@ const uppy = Uppy({
 })
 })
 
 
 uppy.use(GoogleDrive, {
 uppy.use(GoogleDrive, {
-  host: 'http://localhost:3020'
+  serverUrl: '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, {
-  host: 'http://localhost:3020'
+  serverUrl: 'http://localhost:3020'
 })
 })

+ 1 - 1
examples/aws-uppy-server/server.js

@@ -31,7 +31,7 @@ const options = {
       region: process.env.UPPYSERVER_AWS_REGION
       region: process.env.UPPYSERVER_AWS_REGION
     }
     }
   },
   },
-  server: { host: 'localhost:3020' },
+  server: { serverUrl: 'localhost:3020' },
   filePath: DATA_DIR,
   filePath: DATA_DIR,
   secret: 'blah blah',
   secret: 'blah blah',
   debug: true
   debug: true

+ 2 - 2
examples/bundled-example/main.js

@@ -28,8 +28,8 @@ 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, host: 'http://localhost:3020' })
-  .use(Instagram, { target: Dashboard, host: 'http://localhost:3020' })
+  .use(GoogleDrive, { target: Dashboard, serverUrl: 'http://localhost:3020' })
+  .use(Instagram, { target: Dashboard, serverUrl: '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
examples/custom-provider/client/MyCustomProvider.js

@@ -16,7 +16,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, {
-      host: this.opts.host,
+      serverUrl: this.opts.serverUrl,
       provider: 'mycustomprovider'
       provider: 'mycustomprovider'
     })
     })
 
 

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

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

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

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

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

@@ -39,7 +39,7 @@ app.use('/uppy-server', uppy.app({
       region: process.env.UPPYSERVER_AWS_REGION
       region: process.env.UPPYSERVER_AWS_REGION
     }
     }
   },
   },
-  server: { host: `localhost:${PORT}` }
+  server: { serverUrl: `localhost:${PORT}` }
 }))
 }))
 
 
 // Serve the built CSS file.
 // Serve the built CSS file.

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

@@ -20,7 +20,7 @@ module.exports = class App extends React.Component {
   componentWillMount () {
   componentWillMount () {
     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, { host: 'https://server.uppy.io' })
+      .use(GoogleDrive, { serverUrl: 'https://server.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-server/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, host: 'http://localhost:3020' })
-        .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, host: 'http://localhost:3020' })
+        .use(Uppy.Instagram, { target: Uppy.Dashboard, serverUrl: 'http://localhost:3020' })
+        .use(Uppy.GoogleDrive, { target: Uppy.Dashboard, serverUrl: '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) => {

+ 3 - 3
src/plugins/AwsS3/Multipart.js

@@ -89,8 +89,8 @@ module.exports = class AwsS3Multipart extends Plugin {
   }
   }
 
 
   assertHost () {
   assertHost () {
-    if (!this.opts.host) {
-      throw new Error('Expected a `host` option containing an uppy-server address.')
+    if (!this.opts.serverUrl) {
+      throw new Error('Expected a `serverUrl` option containing an uppy-server address.')
     }
     }
   }
   }
 
 
@@ -287,7 +287,7 @@ module.exports = class AwsS3Multipart extends Plugin {
   connectToServerSocket (file) {
   connectToServerSocket (file) {
     return new Promise((resolve, reject) => {
     return new Promise((resolve, reject) => {
       const token = file.serverToken
       const token = file.serverToken
-      const host = getSocketHost(file.remote.host)
+      const host = getSocketHost(file.remote.serverUrl)
       const socket = new UppySocket({ target: `${host}/api/${token}` })
       const socket = new UppySocket({ target: `${host}/api/${token}` })
       this.uploaderSockets[socket] = socket
       this.uploaderSockets[socket] = socket
       this.uploaderEvents[file.id] = createEventTracker(this.uppy)
       this.uploaderEvents[file.id] = createEventTracker(this.uppy)

+ 3 - 3
src/plugins/AwsS3/index.js

@@ -46,13 +46,13 @@ module.exports = class AwsS3 extends Plugin {
   }
   }
 
 
   getUploadParameters (file) {
   getUploadParameters (file) {
-    if (!this.opts.host) {
-      throw new Error('Expected a `host` option containing an uppy-server address.')
+    if (!this.opts.serverUrl) {
+      throw new Error('Expected a `serverUrl` option containing an uppy-server address.')
     }
     }
 
 
     const filename = encodeURIComponent(file.name)
     const filename = encodeURIComponent(file.name)
     const type = encodeURIComponent(file.type)
     const type = encodeURIComponent(file.type)
-    return fetch(`${this.opts.host}/s3/params?filename=${filename}&type=${type}`, {
+    return fetch(`${this.opts.serverUrl}/s3/params?filename=${filename}&type=${type}`, {
       method: 'get',
       method: 'get',
       headers: { accept: 'application/json' }
       headers: { accept: 'application/json' }
     }).then((response) => response.json())
     }).then((response) => response.json())

+ 3 - 3
src/plugins/Dropbox/index.js

@@ -21,7 +21,7 @@ module.exports = class Dropbox 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, {
-      host: this.opts.host,
+      serverUrl: this.opts.serverUrl,
       provider: 'dropbox'
       provider: 'dropbox'
     })
     })
 
 
@@ -35,7 +35,7 @@ module.exports = class Dropbox extends Plugin {
 
 
     // merge default options with the ones set by user
     // merge default options with the ones set by user
     this.opts = Object.assign({}, defaultOptions, opts)
     this.opts = Object.assign({}, defaultOptions, opts)
-    this.opts.hostPattern = opts.hostPattern || opts.host
+    this.opts.serverPattern = opts.serverPattern || opts.serverUrl
   }
   }
 
 
   install () {
   install () {
@@ -111,7 +111,7 @@ module.exports = class Dropbox extends Plugin {
   }
   }
 
 
   getItemThumbnailUrl (item) {
   getItemThumbnailUrl (item) {
-    return `${this.opts.host}/${this.Dropbox.id}/thumbnail/${this.getItemRequestPath(item)}`
+    return `${this.opts.serverUrl}/${this.Dropbox.id}/thumbnail/${this.getItemRequestPath(item)}`
   }
   }
 
 
   render (state) {
   render (state) {

+ 3 - 3
src/plugins/GoogleDrive/index.js

@@ -15,7 +15,7 @@ module.exports = class GoogleDrive extends Plugin {
       </svg>
       </svg>
 
 
     this[this.id] = new Provider(uppy, {
     this[this.id] = new Provider(uppy, {
-      host: this.opts.host,
+      serverUrl: this.opts.serverUrl,
       provider: 'drive',
       provider: 'drive',
       authProvider: 'google'
       authProvider: 'google'
     })
     })
@@ -30,7 +30,7 @@ module.exports = class GoogleDrive extends Plugin {
 
 
     // merge default options with the ones set by user
     // merge default options with the ones set by user
     this.opts = Object.assign({}, defaultOptions, opts)
     this.opts = Object.assign({}, defaultOptions, opts)
-    this.opts.hostPattern = opts.hostPattern || opts.host
+    this.opts.serverPattern = opts.serverPattern || opts.serverUrl
   }
   }
 
 
   install () {
   install () {
@@ -115,7 +115,7 @@ module.exports = class GoogleDrive extends Plugin {
   }
   }
 
 
   getItemThumbnailUrl (item) {
   getItemThumbnailUrl (item) {
-    return `${this.opts.host}/${this.GoogleDrive.id}/thumbnail/${this.getItemRequestPath(item)}`
+    return `${this.opts.serverUrl}/${this.GoogleDrive.id}/thumbnail/${this.getItemRequestPath(item)}`
   }
   }
 
 
   render (state) {
   render (state) {

+ 2 - 2
src/plugins/Instagram/index.js

@@ -18,7 +18,7 @@ module.exports = class Instagram extends Plugin {
     )
     )
 
 
     this[this.id] = new Provider(uppy, {
     this[this.id] = new Provider(uppy, {
-      host: this.opts.host,
+      serverUrl: this.opts.serverUrl,
       provider: 'instagram',
       provider: 'instagram',
       authProvider: 'instagram'
       authProvider: 'instagram'
     })
     })
@@ -33,7 +33,7 @@ module.exports = class Instagram extends Plugin {
 
 
     // merge default options with the ones set by user
     // merge default options with the ones set by user
     this.opts = Object.assign({}, defaultOptions, opts)
     this.opts = Object.assign({}, defaultOptions, opts)
-    this.opts.hostPattern = opts.hostPattern || opts.host
+    this.opts.serverPattern = opts.serverPattern || opts.serverUrl
   }
   }
 
 
   install () {
   install () {

+ 3 - 3
src/plugins/Transloadit/index.js

@@ -190,16 +190,16 @@ module.exports = class Transloadit extends Plugin {
         // We only replace the hostname for Transloadit's uppy-servers, so that
         // We only replace the hostname for Transloadit's uppy-servers, so that
         // people can self-host them while still using Transloadit for encoding.
         // people can self-host them while still using Transloadit for encoding.
         let remote = file.remote
         let remote = file.remote
-        if (file.remote && TL_UPPY_SERVER.test(file.remote.host)) {
+        if (file.remote && TL_UPPY_SERVER.test(file.remote.serverUrl)) {
           let newHost = assembly.uppyserver_url
           let newHost = assembly.uppyserver_url
-          let path = file.remote.url.replace(file.remote.host, '')
+          let path = file.remote.url.replace(file.remote.serverUrl, '')
           // remove tailing slash
           // remove tailing slash
           newHost = newHost.replace(/\/$/, '')
           newHost = newHost.replace(/\/$/, '')
           // remove leading slash
           // remove leading slash
           path = path.replace(/^\//, '')
           path = path.replace(/^\//, '')
 
 
           remote = Object.assign({}, file.remote, {
           remote = Object.assign({}, file.remote, {
-            host: newHost,
+            serverUrl: newHost,
             url: `${newHost}/${path}`
             url: `${newHost}/${path}`
           })
           })
         }
         }

+ 1 - 1
src/plugins/Tus.js

@@ -271,7 +271,7 @@ module.exports = class Tus extends Plugin {
   connectToServerSocket (file) {
   connectToServerSocket (file) {
     return new Promise((resolve, reject) => {
     return new Promise((resolve, reject) => {
       const token = file.serverToken
       const token = file.serverToken
-      const host = getSocketHost(file.remote.host)
+      const host = getSocketHost(file.remote.serverUrl)
       const socket = new UppySocket({ target: `${host}/api/${token}` })
       const socket = new UppySocket({ target: `${host}/api/${token}` })
       this.uploaderSockets[file.id] = socket
       this.uploaderSockets[file.id] = socket
       this.uploaderEvents[file.id] = createEventTracker(this.uppy)
       this.uploaderEvents[file.id] = createEventTracker(this.uppy)

+ 3 - 3
src/plugins/Url/index.js

@@ -45,7 +45,7 @@ module.exports = class Url extends Plugin {
     this.translator = new Translator({locale: this.locale})
     this.translator = new Translator({locale: this.locale})
     this.i18n = this.translator.translate.bind(this.translator)
     this.i18n = this.translator.translate.bind(this.translator)
 
 
-    this.hostname = this.opts.host
+    this.hostname = this.opts.serverUrl
 
 
     if (!this.hostname) {
     if (!this.hostname) {
       throw new Error('Uppy Server hostname is required, please consult https://uppy.io/docs/server')
       throw new Error('Uppy Server hostname is required, please consult https://uppy.io/docs/server')
@@ -60,7 +60,7 @@ module.exports = class Url extends Plugin {
 
 
     this.handlePaste = this.handlePaste.bind(this)
     this.handlePaste = this.handlePaste.bind(this)
 
 
-    this.client = new RequestClient(uppy, {host: this.opts.host})
+    this.client = new RequestClient(uppy, { serverUrl: this.opts.serverUrl })
   }
   }
 
 
   getFileNameFromUrl (url) {
   getFileNameFromUrl (url) {
@@ -122,7 +122,7 @@ module.exports = class Url extends Plugin {
             url: url
             url: url
           },
           },
           remote: {
           remote: {
-            host: this.opts.host,
+            serverUrl: this.opts.serverUrl,
             url: `${this.hostname}/url/get`,
             url: `${this.hostname}/url/get`,
             body: {
             body: {
               fileId: url,
               fileId: url,

+ 1 - 1
src/plugins/XHRUpload.js

@@ -327,7 +327,7 @@ module.exports = class XHRUpload extends Plugin {
       )
       )
       .then((res) => {
       .then((res) => {
         const token = res.token
         const token = res.token
-        const host = getSocketHost(file.remote.host)
+        const host = getSocketHost(file.remote.serverUrl)
         const socket = new UppySocket({ target: `${host}/api/${token}` })
         const socket = new UppySocket({ target: `${host}/api/${token}` })
 
 
         socket.on('progress', (progressData) => emitSocketProgress(this, progressData, file))
         socket.on('progress', (progressData) => emitSocketProgress(this, progressData, file))

+ 2 - 2
src/server/RequestClient.js

@@ -16,7 +16,7 @@ module.exports = class RequestClient {
 
 
   get hostname () {
   get hostname () {
     const { uppyServer } = this.uppy.getState()
     const { uppyServer } = this.uppy.getState()
-    const host = this.opts.host
+    const host = this.opts.serverUrl
     return stripSlash(uppyServer && uppyServer[host] ? uppyServer[host] : host)
     return stripSlash(uppyServer && uppyServer[host] ? uppyServer[host] : host)
   }
   }
 
 
@@ -30,7 +30,7 @@ module.exports = class RequestClient {
   onReceiveResponse (response) {
   onReceiveResponse (response) {
     const state = this.uppy.getState()
     const state = this.uppy.getState()
     const uppyServer = state.uppyServer || {}
     const uppyServer = state.uppyServer || {}
-    const host = this.opts.host
+    const host = this.opts.serverUrl
     const headers = response.headers
     const headers = response.headers
     // Store the self-identified domain name for the uppy-server we just hit.
     // Store the self-identified domain name for the uppy-server we just hit.
     if (headers.has('i-am') && headers.get('i-am') !== uppyServer[host]) {
     if (headers.has('i-am') && headers.get('i-am') !== uppyServer[host]) {

+ 2 - 2
src/server/RequestClient.test.js

@@ -3,8 +3,8 @@ const RequestClient = require('./RequestClient')
 describe('RequestClient', () => {
 describe('RequestClient', () => {
   it('has a hostname without trailing slash', () => {
   it('has a hostname without trailing slash', () => {
     const mockCore = { getState: () => ({}) }
     const mockCore = { getState: () => ({}) }
-    const a = new RequestClient(mockCore, { host: 'http://server.uppy.io' })
-    const b = new RequestClient(mockCore, { host: 'http://server.uppy.io/' })
+    const a = new RequestClient(mockCore, { serverUrl: 'http://server.uppy.io' })
+    const b = new RequestClient(mockCore, { serverUrl: 'http://server.uppy.io/' })
 
 
     expect(a.hostname).toBe('http://server.uppy.io')
     expect(a.hostname).toBe('http://server.uppy.io')
     expect(b.hostname).toBe('http://server.uppy.io')
     expect(b.hostname).toBe('http://server.uppy.io')

+ 3 - 3
src/views/ProviderView/index.js

@@ -182,7 +182,7 @@ module.exports = class ProviderView {
         fileId: this.plugin.getItemId(file)
         fileId: this.plugin.getItemId(file)
       },
       },
       remote: {
       remote: {
-        host: this.plugin.opts.host,
+        serverUrl: this.plugin.opts.serverUrl,
         url: `${this.Provider.fileUrl(this.plugin.getItemRequestPath(file))}`,
         url: `${this.Provider.fileUrl(this.plugin.getItemRequestPath(file))}`,
         body: {
         body: {
           fileId: this.plugin.getItemId(file)
           fileId: this.plugin.getItemId(file)
@@ -453,9 +453,9 @@ module.exports = class ProviderView {
     const authWindow = window.open(link, '_blank')
     const authWindow = window.open(link, '_blank')
     const noProtocol = (url) => url.replace(/^(https?:|)\/\//, '')
     const noProtocol = (url) => url.replace(/^(https?:|)\/\//, '')
     const handleToken = (e) => {
     const handleToken = (e) => {
-      const allowedOrigin = new RegExp(noProtocol(this.plugin.opts.hostPattern))
+      const allowedOrigin = new RegExp(noProtocol(this.plugin.opts.serverPattern))
       if (!allowedOrigin.test(noProtocol(e.origin)) || e.source !== authWindow) {
       if (!allowedOrigin.test(noProtocol(e.origin)) || e.source !== authWindow) {
-        this.plugin.uppy.log(`rejecting event from ${e.origin} vs allowed pattern ${this.plugin.opts.hostPattern}`)
+        this.plugin.uppy.log(`rejecting event from ${e.origin} vs allowed pattern ${this.plugin.opts.serverPattern}`)
         return
         return
       }
       }
       authWindow.close()
       authWindow.close()

+ 5 - 5
types/index.d.ts

@@ -283,7 +283,7 @@ declare namespace plugins {
 		expires: number;
 		expires: number;
 		serviceWorker: boolean;
 		serviceWorker: boolean;
 		indexedDB: any;
 		indexedDB: any;
-		host: string;
+		serverUrl: string;
 	}
 	}
 	class GoogleDrive extends core.Plugin {
 	class GoogleDrive extends core.Plugin {
 		constructor(uppy: core.Uppy, opts: Partial<GoogleDriveOptions>);
 		constructor(uppy: core.Uppy, opts: Partial<GoogleDriveOptions>);
@@ -296,7 +296,7 @@ declare namespace plugins {
 		deleteBlobs(): Promise<any>;
 		deleteBlobs(): Promise<any>;
 	}
 	}
 	interface InstagramOptions extends core.CoreConfig {
 	interface InstagramOptions extends core.CoreConfig {
-		host: string;
+		serverUrl: string;
 	}
 	}
 	class Instagram extends core.Plugin {
 	class Instagram extends core.Plugin {
 		constructor(uppy: core.Uppy, opts: Partial<InstagramOptions>);
 		constructor(uppy: core.Uppy, opts: Partial<InstagramOptions>);
@@ -345,20 +345,20 @@ declare namespace plugins {
 		constructor(uppy: core.Uppy, opts: Partial<StatusBarOptions>);
 		constructor(uppy: core.Uppy, opts: Partial<StatusBarOptions>);
 	}
 	}
 	interface UrlOptions extends core.CoreConfig {
 	interface UrlOptions extends core.CoreConfig {
-		host: string;
+		serverUrl: string;
 	}
 	}
 	class Url extends core.Plugin {
 	class Url extends core.Plugin {
 		constructor(uppy: core.Uppy, opts: Partial<UrlOptions>);
 		constructor(uppy: core.Uppy, opts: Partial<UrlOptions>);
 	}
 	}
 	interface DropboxOptions extends core.CoreConfig {
 	interface DropboxOptions extends core.CoreConfig {
-		host: string;
+		serverUrl: string;
 	}
 	}
 	class Dropbox extends core.Plugin {
 	class Dropbox extends core.Plugin {
 		constructor(uppy: core.Uppy, opts: Partial<DropboxOptions>);
 		constructor(uppy: core.Uppy, opts: Partial<DropboxOptions>);
 	}
 	}
 	interface AwsS3Options extends core.CoreConfig {
 	interface AwsS3Options extends core.CoreConfig {
 		limit: number;
 		limit: number;
-		host: string;
+		serverUrl: string;
 		timeout: number;
 		timeout: number;
 	}
 	}
 	class AwsS3 extends core.Plugin {
 	class AwsS3 extends core.Plugin {

+ 2 - 2
types/uppy-tests.ts

@@ -18,8 +18,8 @@ import Uppy = require('uppy');
 (() => {
 (() => {
 	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, host: 'https://server.uppy.io' })
-		.use(Uppy.Instagram, { target: Uppy.Dashboard, host: 'https://server.uppy.io' })
+		.use(Uppy.GoogleDrive, { target: Uppy.Dashboard, serverUrl: 'https://server.uppy.io' })
+		.use(Uppy.Instagram, { target: Uppy.Dashboard, serverUrl: 'https://server.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/' })
 		.run()
 		.run()

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

@@ -11,7 +11,7 @@ The `AwsS3Multipart` plugin can be used to upload files directly to an S3 bucket
 const AwsS3Multipart = require('uppy/lib/plugins/AwsS3/Multipart')
 const AwsS3Multipart = require('uppy/lib/plugins/AwsS3/Multipart')
 uppy.use(AwsS3Multipart, {
 uppy.use(AwsS3Multipart, {
   limit: 4,
   limit: 4,
-  host: 'https://uppy-server.myapp.net/'
+  serverUrl: 'https://uppy-server.myapp.net/'
 })
 })
 ```
 ```
 
 
@@ -21,7 +21,7 @@ uppy.use(AwsS3Multipart, {
 
 
 The maximum amount of chunks to upload simultaneously. `0` means unlimited.
 The maximum amount of chunks to upload simultaneously. `0` means unlimited.
 
 
-### host: null
+### serverUrl: null
 
 
 The Uppy Server URL to use to proxy calls to the S3 Multipart API.
 The Uppy Server URL to use to proxy calls to the S3 Multipart API.
 
 

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

@@ -15,7 +15,7 @@ const ms = require('ms')
 uppy.use(AwsS3, {
 uppy.use(AwsS3, {
   limit: 2,
   limit: 2,
   timeout: ms('1 minute'),
   timeout: ms('1 minute'),
-  host: 'https://uppy-server.myapp.com/'
+  serverUrl: 'https://uppy-server.myapp.com/'
 })
 })
 ```
 ```
 
 
@@ -29,13 +29,13 @@ There is also a separate plugin for S3 Multipart uploads. Multipart in this sens
 
 
 A unique identifier for this plugin. Defaults to `'AwsS3'`.
 A unique identifier for this plugin. Defaults to `'AwsS3'`.
 
 
-### `host`
+### `serverUrl`
 
 
 When using [uppy-server][uppy-server docs] to sign S3 uploads, set this option to the root URL of the uppy-server.
 When using [uppy-server][uppy-server docs] to sign S3 uploads, set this option to the root URL of the uppy-server.
 
 
 ```js
 ```js
 uppy.use(AwsS3, {
 uppy.use(AwsS3, {
-  host: 'https://uppy-server.my-app.com/'
+  serverUrl: 'https://uppy-server.my-app.com/'
 })
 })
 ```
 ```
 
 

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

@@ -24,7 +24,7 @@ uppy.use(Dropbox, {
 ```js
 ```js
 uppy.use(Dropbox, {
 uppy.use(Dropbox, {
   target: Dashboard,
   target: Dashboard,
-  host: 'https://server.uppy.io/',
+  serverUrl: 'https://server.uppy.io/',
 })
 })
 ```
 ```
 
 
@@ -36,7 +36,7 @@ A unique identifier for this plugin. 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.
 
 
-### `host: null`
+### `serverUrl: null`
 
 
 URL to an Uppy Server instance.
 URL to an Uppy Server instance.
 
 

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

@@ -24,7 +24,7 @@ uppy.use(GoogleDrive, {
 ```js
 ```js
 uppy.use(GoogleDrive, {
 uppy.use(GoogleDrive, {
   target: Dashboard,
   target: Dashboard,
-  host: 'https://server.uppy.io/',
+  serverUrl: 'https://server.uppy.io/',
 })
 })
 ```
 ```
 
 
@@ -36,7 +36,7 @@ A unique identifier for this plugin. Defaults to `'GoogleDrive'`.
 
 
 DOM element, CSS selector, or plugin to mount the GoogleDrive provider into. This should normally be the Dashboard.
 DOM element, CSS selector, or plugin to mount the GoogleDrive provider into. This should normally be the Dashboard.
 
 
-### `host: null`
+### `serverUrl: null`
 
 
 URL to an Uppy Server instance.
 URL to an Uppy Server instance.
 
 

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

@@ -24,7 +24,7 @@ uppy.use(Instagram, {
 ```js
 ```js
 uppy.use(Instagram, {
 uppy.use(Instagram, {
   target: Dashboard,
   target: Dashboard,
-  host: 'https://server.uppy.io/',
+  serverUrl: 'https://server.uppy.io/',
 })
 })
 ```
 ```
 
 
@@ -36,7 +36,7 @@ A unique identifier for this plugin. Defaults to `'Instagram'`.
 
 
 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.
 
 
-### `host: null`
+### `serverUrl: null`
 
 
 URL to an Uppy Server instance.
 URL to an Uppy Server instance.
 
 

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

@@ -9,7 +9,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 `host`, which specifies the url to your running `uppy-server`. This allows Uppy to know what server to connect to when server related operations are required by the provider plugin. Here's a quick example.
+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 your running `uppy-server`. This allows Uppy to know what server to connect to when server related operations are required by the provider plugin. Here's a quick example.
 
 
 ```js
 ```js
 const Uppy = require('uppy/lib/core')
 const Uppy = require('uppy/lib/core')
@@ -21,17 +21,17 @@ uppy.use(Dashboard, {
 
 
 // for Google Drive
 // for Google Drive
 const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
 const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
-uppy.use(GoogleDrive, {target: Dashboard, host: 'http://localhost:3020'})
+uppy.use(GoogleDrive, {target: Dashboard, serverUrl: 'http://localhost:3020'})
 
 
 // for Dropbox
 // for Dropbox
 const Dropbox = require('uppy/lib/plugins/Dropbox')
 const Dropbox = require('uppy/lib/plugins/Dropbox')
-uppy.use(Dropbox, {target: Dashboard, host: 'http://localhost:3020'})
+uppy.use(Dropbox, {target: Dashboard, serverUrl: 'http://localhost:3020'})
 
 
 // for Instagram
 // for Instagram
 const Instagram = require('uppy/lib/plugins/Instagram')
 const Instagram = require('uppy/lib/plugins/Instagram')
-uppy.use(Instagram, {target: Dashboard, host: 'http://localhost:3020'})
+uppy.use(Instagram, {target: Dashboard, serverUrl: 'http://localhost:3020'})
 
 
 // for Url
 // for Url
 const Url = require('uppy/lib/plugins/Url')
 const Url = require('uppy/lib/plugins/Url')
-uppy.use(Url, {target: Dashboard, host: 'http://localhost:3020'})
+uppy.use(Url, {target: Dashboard, serverUrl: 'http://localhost:3020'})
 ```
 ```

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

@@ -37,7 +37,7 @@ const Dropbox = require('uppy/lib/plugins/Dropbox')
 const Transloadit = require('uppy/lib/plugins/Transloadit')
 const Transloadit = require('uppy/lib/plugins/Transloadit')
 
 
 uppy.use(Dropbox, {
 uppy.use(Dropbox, {
-  host: Transloadit.UPPY_SERVER
+  serverUrl: Transloadit.UPPY_SERVER
 })
 })
 ```
 ```
 
 
@@ -45,7 +45,7 @@ The value of this constant is `https://api2.transloadit.com/uppy-server`. If you
 
 
 ```js
 ```js
 uppy.use(Dropbox, {
 uppy.use(Dropbox, {
-  host: 'https://api2-us-east-1.transloadit.com/uppy-server'
+  serverUrl: 'https://api2-us-east-1.transloadit.com/uppy-server'
 })
 })
 ```
 ```
 
 

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

@@ -24,7 +24,7 @@ uppy.use(Url, {
 ```js
 ```js
 uppy.use(Url, {
 uppy.use(Url, {
   target: Dashboard,
   target: Dashboard,
-  host: 'https://server.uppy.io/',
+  serverUrl: 'https://server.uppy.io/',
   locale: {}
   locale: {}
 })
 })
 ```
 ```
@@ -37,7 +37,7 @@ A unique identifier for this plugin. Defaults to `'Url'`.
 
 
 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.
 
 
-### `host: null`
+### `serverUrl: null`
 
 
 URL to an Uppy Server instance.
 URL to an Uppy Server instance.
 
 

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

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

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

@@ -50,9 +50,9 @@ const uppy = Uppy({
     { id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
     { id: 'caption', name: 'Caption', placeholder: 'describe what the image is about' }
   ]
   ]
 })
 })
-.use(GoogleDrive, { target: Dashboard, host: 'https://server.uppy.io' })
-.use(Dropbox, { target: Dashboard, host: 'https://server.uppy.io' })
-.use(Instagram, { target: Dashboard, host: 'https://server.uppy.io' })
+.use(GoogleDrive, { target: Dashboard, serverUrl: 'https://server.uppy.io' })
+.use(Dropbox, { target: Dashboard, serverUrl: 'https://server.uppy.io' })
+.use(Instagram, { target: Dashboard, serverUrl: 'https://server.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/' })
 
 

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

@@ -57,7 +57,7 @@ function initUppy () {
       target: '#uppy-dashboard-container',
       target: '#uppy-dashboard-container',
       note: 'Images only, 1–2 files, up to 1 MB'
       note: 'Images only, 1–2 files, up to 1 MB'
     })
     })
-    .use(Instagram, { target: Dashboard, host: 'https://api2.transloadit.com/uppy-server' })
+    .use(Instagram, { target: Dashboard, serverUrl: 'https://api2.transloadit.com/uppy-server' })
     .use(Webcam, { target: Dashboard })
     .use(Webcam, { target: Dashboard })
 
 
   uppy
   uppy

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

@@ -125,7 +125,7 @@ uppy
     },
     },
     waitForEncoding: true
     waitForEncoding: true
   })
   })
-  .use(Instagram, { target: Dashboard, host: 'https://api2.transloadit.com/uppy-server' })
+  .use(Instagram, { target: Dashboard, serverUrl: 'https://api2.transloadit.com/uppy-server' })
   .use(Dashboard, {
   .use(Dashboard, {
     inline: true,
     inline: true,
     maxHeight: 400,
     maxHeight: 400,