Forráskód Böngészése

@uppy/transloadit: add `clientName` option (#4920)

Marius 1 éve
szülő
commit
7b492d7ff6

+ 5 - 0
packages/@uppy/transloadit/src/index.js

@@ -62,6 +62,7 @@ export default class Transloadit extends BasePlugin {
       getAssemblyOptions: null,
       limit: 20,
       retryDelays: [7_000, 10_000, 15_000, 20_000],
+      clientName: null,
     }
 
     this.opts = { ...defaultOptions, ...opts }
@@ -126,6 +127,10 @@ export default class Transloadit extends BasePlugin {
     addPluginVersion('Zoom', 'uppy-zoom')
     addPluginVersion('Url', 'uppy-url')
 
+    if (this.opts.clientName != null) {
+      list.push(this.opts.clientName)
+    }
+
     return list.join(',')
   }
 

+ 1 - 0
packages/@uppy/transloadit/types/index.d.ts

@@ -111,6 +111,7 @@ interface Options extends PluginOptions {
   alwaysRunAssembly?: boolean
   locale?: TransloaditLocale
   limit?: number
+  clientName?: string
 }
 
 export type TransloaditOptions = Options &

+ 1 - 0
packages/@uppy/transloadit/types/index.test-d.ts

@@ -22,6 +22,7 @@ const validParams = {
     waitForEncoding: false,
     waitForMetadata: true,
     importFromUploadURLs: false,
+    clientName: 'my-application',
   })
   // Access to both transloadit events and core events
   uppy.on('transloadit:assembly-created', (assembly) => {