add simple admin service
Build and deploy / deploy (push) Successful in 16s

This commit is contained in:
2026-05-18 02:48:47 +03:00
parent 10a83d39a2
commit 3a3b2bcfc0
84 changed files with 2134 additions and 5 deletions
@@ -0,0 +1,19 @@
import { httpError } from '../../shared/http/httpError.mjs';
export function parseUploadPayload(payload) {
if (typeof payload.dataUrl === 'string') {
const match = payload.dataUrl.match(/^data:[^;]+;base64,(.+)$/);
if (!match) {
throw httpError(400, '"dataUrl" must be a base64 data URL');
}
return Buffer.from(match[1], 'base64');
}
if (typeof payload.contentBase64 === 'string') {
return Buffer.from(payload.contentBase64, 'base64');
}
throw httpError(400, 'Upload payload must include "dataUrl" or "contentBase64"');
}