File tree Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Expand file tree Collapse file tree 3 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ export type FileMetadata = z.infer<typeof FileMetadata>;
1616 * Options accepted during the creation of a signed URL.
1717 */
1818export type SignedURLOptions = {
19- expiresIn ?: string | number ;
19+ expiresIn ?: number ;
2020 contentType ?: string ;
2121 contentDisposition ?: string ;
2222} & Record < string , any > ;
Original file line number Diff line number Diff line change @@ -14,11 +14,7 @@ import type { StorageFile } from "../../StorageFile.js";
1414
1515type FSDriverOptions = {
1616 location ?: string ;
17- generateSignedURL ?(
18- key : string ,
19- filePath : string ,
20- options : SignedURLOptions ,
21- ) : Promise < string > ;
17+ generateSignedURL ?( key : string , options : SignedURLOptions ) : Promise < string > ;
2218} ;
2319
2420export class FSDriver implements StorageDriver {
@@ -88,7 +84,7 @@ export class FSDriver implements StorageDriver {
8884 throw new Error ( "generateSignedURL is not defined" ) ;
8985
9086 const location = path . join ( this . _location , key ) ;
91- return this . options . generateSignedURL ( location , location , opts ) ;
87+ return this . options . generateSignedURL ( location , opts ) ;
9288 }
9389
9490 async getMetaData ( key : string ) : Promise < ObjectMetadata > {
Original file line number Diff line number Diff line change @@ -85,10 +85,7 @@ export class GCSStorageDriver implements StorageDriver {
8585
8686 async getSignedUrl ( path : string , opts : SignedURLOptions ) : Promise < string > {
8787 const expires = new Date ( ) ;
88- const m =
89- typeof opts . expiresIn === "number"
90- ? opts . expiresIn
91- : ms ( opts . expiresIn ?? "30m" ) ;
88+ const m = opts . expiresIn ?? ms ( "30m" ) ;
9289 expires . setSeconds ( new Date ( ) . getMilliseconds ( ) + m ) ;
9390 const [ url ] = await this . bucket . file ( path ) . getSignedUrl ( {
9491 action : opts . action ,
You can’t perform that action at this time.
0 commit comments