- add FileEntity, ScenarioFileEntity, ScenarioRunFileEntity with UUID-sharded disk tree - FileStorageService: write/sha256/expiry, paginated listing, dynamic cleanup cron via SchedulerRegistry - expose getScenarioFiles() and downloadFile() on ScriptContext for use in exec code - wire scenarioId, runId, fileService into ExecContextBuilder and scenario scheduler - add file upload and listing endpoints to ScenarioController - add FILES_DIR, FILE_RUN_EXPIRATION_DAYS, FILE_CLEANUP_CRON to AppConfig
29 lines
477 B
TypeScript
29 lines
477 B
TypeScript
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from "typeorm";
|
|
|
|
@Entity("files")
|
|
export class FileEntity {
|
|
@PrimaryGeneratedColumn("uuid")
|
|
id: string;
|
|
|
|
@Column()
|
|
originalName: string;
|
|
|
|
@Column()
|
|
mimeType: string;
|
|
|
|
@Column({ type: "integer" })
|
|
size: number;
|
|
|
|
@Column()
|
|
sha256: string;
|
|
|
|
@Column()
|
|
filePath: string;
|
|
|
|
@Column({ type: "datetime", nullable: true })
|
|
expiresAt: Date | null;
|
|
|
|
@CreateDateColumn()
|
|
createdAt: Date;
|
|
}
|