mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 10:50:38 +09:00
Clarify plugin authoring and external dev workflow
This commit is contained in:
parent
cb5d7e76fb
commit
30888759f2
36 changed files with 693 additions and 410 deletions
|
|
@ -456,26 +456,6 @@ export function startWorkerRpcHost(options: WorkerRpcHostOptions): WorkerRpcHost
|
|||
},
|
||||
},
|
||||
|
||||
assets: {
|
||||
async upload(
|
||||
filename: string,
|
||||
contentType: string,
|
||||
data: Buffer | Uint8Array,
|
||||
): Promise<{ assetId: string; url: string }> {
|
||||
// Base64-encode binary data for JSON serialization
|
||||
const base64 = Buffer.from(data).toString("base64");
|
||||
return callHost("assets.upload", {
|
||||
filename,
|
||||
contentType,
|
||||
data: base64,
|
||||
});
|
||||
},
|
||||
|
||||
async getUrl(assetId: string): Promise<string> {
|
||||
return callHost("assets.getUrl", { assetId });
|
||||
},
|
||||
},
|
||||
|
||||
activity: {
|
||||
async log(entry): Promise<void> {
|
||||
await callHost("activity.log", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue