Browse Source

@uppy/companion: rename `getExtraConfig` to `getExtraGrantConfig` (#5198)

Mikael Finstad 11 months ago
parent
commit
754de182db

+ 4 - 0
docs/guides/migration-guides.md

@@ -12,6 +12,10 @@ These cover all the major Uppy versions and how to migrate to them.
 - The URL endpoint (used by the `Url`/`Link` plugin) is now turned off by
   default and must be explicitly enabled with
   `COMPANION_ENABLE_URL_ENDPOINT=true` or `enableUrlEndpoint: true`.
+- Custom provider breaking changes. If you have not implemented a custom
+  provider, you should not be affected.
+  - The static `getExtraConfig` property has been renamed to
+    `getExtraGrantConfig`.
 
 ## Migrate from Robodog to Uppy plugins
 

+ 1 - 2
packages/@uppy/companion/src/server/provider/Provider.js

@@ -18,9 +18,8 @@ class Provider {
 
   /**
    * config to extend the grant config
-   * todo major: rename to getExtraGrantConfig
    */
-  static getExtraConfig () {
+  static getExtraGrantConfig () {
     return {}
   }
 

+ 1 - 1
packages/@uppy/companion/src/server/provider/index.js

@@ -138,7 +138,7 @@ module.exports.addProviderOptions = (companionOptions, grantConfig, getAuthProvi
       }
 
       const provider = exports.getDefaultProviders()[providerName]
-      Object.assign(grantConfig[authProvider], provider.getExtraConfig())
+      Object.assign(grantConfig[authProvider], provider.getExtraGrantConfig())
 
       // override grant.js redirect uri with companion's custom redirect url
       const isExternal = !!server.implicitPath

+ 1 - 1
packages/@uppy/companion/src/server/provider/instagram/graph/index.js

@@ -24,7 +24,7 @@ async function getMediaUrl ({ token, id }) {
  */
 class Instagram extends Provider {
   // for "grant"
-  static getExtraConfig () {
+  static getExtraGrantConfig () {
     return {
       protocol: 'https',
       scope: ['user_profile', 'user_media'],