No longer serialize binary blobs as data URLs

This commit is contained in:
Zef Hemel
2023-05-26 14:04:32 +02:00
parent 25c789538d
commit 1a1b942f92
10 changed files with 34 additions and 94 deletions
+3 -5
View File
@@ -42,23 +42,21 @@ export function getAttachmentMeta(name: string): Promise<AttachmentMeta> {
*/
export function readAttachment(
name: string,
): Promise<string> {
): Promise<{ data: Uint8Array; meta: AttachmentMeta }> {
return syscall("space.readAttachment", name);
}
/**
* Writes an attachment to the space
* @param name path of the attachment to write
* @param encoding encoding of the data ("utf8" or "dataurl)
* @param data data itself
* @returns
*/
export function writeAttachment(
name: string,
encoding: "utf8" | "dataurl",
data: string,
data: Uint8Array,
): Promise<AttachmentMeta> {
return syscall("space.writeAttachment", name, encoding, data);
return syscall("space.writeAttachment", name, data);
}
/**