Przeglądaj źródła

companion: update docs + fix test

ifedapoolarewaju 5 lat temu
rodzic
commit
c18706c8ce

+ 3 - 3
package-lock.json

@@ -6125,7 +6125,7 @@
         "express-prom-bundle": "3.3.0",
         "express-request-id": "1.4.1",
         "express-session": "1.15.6",
-        "grant": "github:ifedapoolarewaju/grant#ba442905a89c5f2041b6a9101d4be8ae15c20458",
+        "grant": "github:ifedapoolarewaju/grant#a2696b67bf90de9adc0bd06043c6f5b724a64674",
         "helmet": "3.8.2",
         "isobject": "3.0.1",
         "jsonwebtoken": "8.3.0",
@@ -17433,8 +17433,8 @@
       "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg=="
     },
     "grant": {
-      "version": "github:ifedapoolarewaju/grant#ba442905a89c5f2041b6a9101d4be8ae15c20458",
-      "from": "github:ifedapoolarewaju/grant#ba442905a89c5f2041b6a9101d4be8ae15c20458",
+      "version": "github:ifedapoolarewaju/grant#a2696b67bf90de9adc0bd06043c6f5b724a64674",
+      "from": "github:ifedapoolarewaju/grant#a2696b67bf90de9adc0bd06043c6f5b724a64674",
       "requires": {
         "qs": "^6.7.0",
         "request-compose": "^1.2.0",

+ 1 - 1
packages/@uppy/companion/package.json

@@ -43,7 +43,7 @@
     "express-prom-bundle": "3.3.0",
     "express-request-id": "1.4.1",
     "express-session": "1.15.6",
-    "grant": "github:ifedapoolarewaju/grant#ba442905a89c5f2041b6a9101d4be8ae15c20458",
+    "grant": "github:ifedapoolarewaju/grant#a2696b67bf90de9adc0bd06043c6f5b724a64674",
     "helmet": "3.8.2",
     "isobject": "3.0.1",
     "jsonwebtoken": "8.3.0",

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

@@ -3,59 +3,59 @@
  */
 class Provider {
   /**
-     *
-     * @param {object} options
-     */
+   *
+   * @param {object} options
+   */
   constructor (options) {
     return this
   }
 
   /**
-     * config to extend the grant config
-     */
+   * config to extend the grant config
+   */
   static getExtraConfig () {
     return {}
   }
 
   /**
-     * list the files and folders in the provider account
-     * @param {object} options
-     * @param {function} cb
-     */
+   * list the files and folders in the provider account
+   * @param {object} options
+   * @param {function} cb
+   */
   list (options, cb) {
     throw new Error('method not implemented')
   }
 
   /**
-     * download a certain file from the provider account
-     * @param {object} options
-     * @param {function} cb
-     */
+   * download a certain file from the provider account
+   * @param {object} options
+   * @param {function} cb
+   */
   download (options, cb) {
     throw new Error('method not implemented')
   }
 
   /**
-     * return a thumbnail for a provider file
-     * @param {object} options
-     * @param {function} cb
-     */
+   * return a thumbnail for a provider file
+   * @param {object} options
+   * @param {function} cb
+   */
   thumbnail (options, cb) {
     throw new Error('method not implemented')
   }
 
   /**
-     * get the size of a certain file in the provider account
-     * @param {object} options
-     * @param {function} cb
-     */
+   * get the size of a certain file in the provider account
+   * @param {object} options
+   * @param {function} cb
+   */
   size (options, cb) {
     throw new Error('method not implemented')
   }
 
   /**
-     * @returns {string}
-     */
+   * @returns {string}
+   */
   static get authProvider () {
     return ''
   }

+ 5 - 1
website/src/docs/companion.md

@@ -177,6 +177,8 @@ export COMPANION_INSTAGRAM_KEY="YOUR INSTAGRAM KEY"
 export COMPANION_INSTAGRAM_SECRET="YOUR INSTAGRAM SECRET"
 # specifying a secret file will override a directly set secret
 export COMPANION_INSTAGRAM_SECRET_FILE="PATH/TO/INSTAGRAM/SECRET/FILE"
+# set this value only if you are using the new Instagram Graph API https://developers.facebook.com/docs/instagram-basic-display-api
+export COMPANION_INSTAGRAM_USE_GRAPH_API="true"
 
 # to enable Facebook
 export COMPANION_FACEBOOK_KEY="YOUR FACEBOOK KEY"
@@ -230,7 +232,9 @@ See [env.example.sh](https://github.com/transloadit/uppy/blob/master/env.example
     },
     instagram: {
       key: "***",
-      secret: "***"
+      secret: "***",
+      // set this to true only if you are using the new Instagram Graph API https://developers.facebook.com/docs/instagram-basic-display-api
+      useGraphAPI: false // default: false
     },
     facebook: {
       key: "***",