b6b345f245
- Refactor email verification and password reset utilities to use new email service. - Introduce email delivery queue and notification delivery model for better tracking. - Enhance file validation and storage services for improved security and ownership management. - Add cron job for cleaning inactive notifications with retention policy. - Update document worker to handle document generation and storage more efficiently. - Implement logging improvements in activity and log workers. - Create comprehensive documentation for new API endpoints and services. - Add unit tests for file validation and notification policies to ensure robustness.
14 lines
486 B
JavaScript
14 lines
486 B
JavaScript
const storage = require("../services/storage/storage.service");
|
|
|
|
const uploadToS3 = async (file, usedFor) => {
|
|
const key = storage.createObjectKey({ ownerId: file.ownerId, mimeType: file.mimetype, purpose: usedFor });
|
|
await storage.uploadBuffer({ buffer: file.buffer, objectKey: key, mimeType: file.mimetype, checksum: file.checksum });
|
|
return key;
|
|
};
|
|
|
|
module.exports = {
|
|
uploadToS3,
|
|
getSignedFileUrl: storage.createSignedDownloadUrl,
|
|
deleteFromS3: storage.deleteObject,
|
|
};
|