We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0dfb0c commit 25e6613Copy full SHA for 25e6613
1 file changed
index.ts
@@ -20,13 +20,21 @@ export default class UploadPlugin extends AdminForthPlugin {
20
21
rateLimiter: RateLimiter;
22
23
+ getFileDownloadUrl: ((path: string) => Promise<string>);
24
+
25
constructor(options: PluginOptions) {
26
super(options, import.meta.url);
27
this.options = options;
28
29
// for calcualting average time
30
this.totalCalls = 0;
31
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
38
if (this.options.generation?.rateLimit?.limit) {
39
this.rateLimiter = new RateLimiter(this.options.generation.rateLimit?.limit)
40
}
0 commit comments