server-ts: Convert more classes, including entity_changes.js

This commit is contained in:
Elian Doran
2024-02-16 23:56:32 +02:00
parent cb14d4d8f9
commit e04bd5aaf0
10 changed files with 238 additions and 228 deletions

View File

@@ -2,6 +2,7 @@ import becca = require('../becca/becca.js');
import NotFoundError = require('../errors/not_found_error');
import protectedSessionService = require('./protected_session');
import utils = require('./utils');
import type { Blob } from "./blob-interface";
function getBlobPojo(entityName: string, entityId: string) {
const entity = becca.getEntity(entityName, entityId);
@@ -48,11 +49,11 @@ function processContent(content: Buffer | string | null, isProtected: boolean, i
}
}
function calculateContentHash({blobId, content}: { blobId: string, content: Buffer }) {
function calculateContentHash({blobId, content}: Blob) {
return utils.hash(`${blobId}|${content.toString()}`);
}
module.exports = {
export = {
getBlobPojo,
processContent,
calculateContentHash