fix(files): expose expiry and disable expired downloads
- return expiresAt and createdAt for scenario and run file metadata\n- keep download actions visible while preventing expired file access
This commit is contained in:
@@ -19,6 +19,8 @@ export interface FileMetadata {
|
||||
mimeType: string;
|
||||
size: number;
|
||||
sha256: string;
|
||||
expiresAt: Date | null;
|
||||
createdAt: Date;
|
||||
path: string;
|
||||
}
|
||||
|
||||
@@ -271,6 +273,8 @@ export class FileStorageService implements OnModuleInit {
|
||||
mimeType: file.mimeType,
|
||||
size: file.size,
|
||||
sha256: file.sha256,
|
||||
expiresAt: file.expiresAt,
|
||||
createdAt: file.createdAt,
|
||||
path: this.getAbsolutePath(file.filePath),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -732,6 +732,9 @@ export class ScenarioService {
|
||||
name: item.name,
|
||||
mimeType: item.mimeType,
|
||||
size: item.size,
|
||||
sha256: item.sha256,
|
||||
expiresAt: item.expiresAt,
|
||||
createdAt: item.createdAt,
|
||||
})),
|
||||
total: result.total,
|
||||
};
|
||||
@@ -790,6 +793,9 @@ export class ScenarioService {
|
||||
name: item.name,
|
||||
mimeType: item.mimeType,
|
||||
size: item.size,
|
||||
sha256: item.sha256,
|
||||
expiresAt: item.expiresAt,
|
||||
createdAt: item.createdAt,
|
||||
})),
|
||||
total: result.total,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user