File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,21 @@ export default class UploadPlugin extends AdminForthPlugin {
2020
2121 rateLimiter : RateLimiter ;
2222
23+ getFileDownloadUrl : ( ( path : string ) => Promise < string > ) ;
24+
2325 constructor ( options : PluginOptions ) {
2426 super ( options , import . meta. url ) ;
2527 this . options = options ;
2628
2729 // for calcualting average time
2830 this . totalCalls = 0 ;
2931 this . totalDuration = 0 ;
32+ this . getFileDownloadUrl = async ( path : string , expiresInSeconds : number = 1800 ) : Promise < string > => {
33+ if ( ! path ) {
34+ return '' ;
35+ }
36+ return this . options . storageAdapter . getDownloadUrl ( path , expiresInSeconds ) ;
37+ }
3038 if ( this . options . generation ?. rateLimit ?. limit ) {
3139 this . rateLimiter = new RateLimiter ( this . options . generation . rateLimit ?. limit )
3240 }
You can’t perform that action at this time.
0 commit comments