// import Inject from "@entity-access/entity-access/dist/di/di.js"; // import { TempFileResult } from "@entity-access/server-pages/dist/Content.js"; // import Page from "@entity-access/server-pages/dist/Page.js"; // import { Prepare } from "@entity-access/server-pages/dist/decorators/Prepare.js"; // import SocialMailContext from "../../../../../server/model/SocialMailContext.js"; // import FileConversionService from "../../../../../server/services/convert/FileConversionService.js"; // @Prepare.authorize // export default class extends Page { // @Inject // private fcs: FileConversionService; // @Inject // private db: SocialMailContext; // async run() { // const [type, emailID, fileID] = this.childPath as any[]; // const fileName = this.childPath[this.childPath.length-1]; // // verify security... // await this.db.emails.filtered("read").where({ emailID }, (x, p) => x.emailID === p.emailID) // .some(); // // verify host ... // const appFile = await this.db.appFiles // .where({ fileID, emailID }, (x, p) => // x.appFileID === p.fileID // && x.emailID === p.emailID // ) // .include((x) => x.fileContent) // .firstOrFail(); // this.cacheControl = "public, max-age=2592000, immutable"; // const file = await this.fcs.downloadConvertedFile({ // appFile, // fileName, // type // }); // return new TempFileResult( // file, { // contentDisposition: type === "download" // ? "attachment" // : "inline", // immutable: true, // etag: false // } // ); // } // }