mindspace: close authority boundaries

This commit is contained in:
john
2026-07-27 15:34:35 +08:00
parent dfab78c75a
commit e94052ff24
78 changed files with 11962 additions and 2162 deletions
+27
View File
@@ -1127,6 +1127,31 @@ export function createAssetService(pool, options = {}) {
};
};
const readAssetContent = async (
userId,
assetId,
) => {
const { asset, path: assetPath } =
await readAsset(userId, assetId);
const body = await fs.readFile(assetPath);
return {
asset,
bodyBase64: body.toString('base64'),
};
};
const readPublicAssetContent = async (
assetId,
) => {
const { asset, path: assetPath } =
await readPublicAsset(assetId);
const body = await fs.readFile(assetPath);
return {
asset,
bodyBase64: body.toString('base64'),
};
};
const createChatAsset = async (
userId,
{ categoryCode, buffer, filename, displayName, sourceType = 'chat' },
@@ -1464,6 +1489,8 @@ export function createAssetService(pool, options = {}) {
deleteAsset,
readAsset,
readPublicAsset,
readAssetContent,
readPublicAssetContent,
renderAssetPreview,
extractAssetText,
renderAssetThumbnail,