From 98ae47a0bae1f2e476aa9d524b753e552624949f Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 8 Aug 2022 13:33:20 +0200 Subject: [PATCH] Add getPageMeta syscall --- packages/plugos-silverbullet-syscall/space.ts | 6 ++++++ packages/server/syscalls/space.ts | 3 +++ packages/web/syscalls/space.ts | 3 +++ 3 files changed, 12 insertions(+) diff --git a/packages/plugos-silverbullet-syscall/space.ts b/packages/plugos-silverbullet-syscall/space.ts index 41f23b3c..16d0a685 100644 --- a/packages/plugos-silverbullet-syscall/space.ts +++ b/packages/plugos-silverbullet-syscall/space.ts @@ -5,6 +5,12 @@ export async function listPages(unfiltered = false): Promise { return syscall("space.listPages", unfiltered); } +export async function getPageMeta( + name: string +): Promise<{ text: string; meta: PageMeta }> { + return syscall("space.getPageMeta", name); +} + export async function readPage( name: string ): Promise<{ text: string; meta: PageMeta }> { diff --git a/packages/server/syscalls/space.ts b/packages/server/syscalls/space.ts index 3d93ba04..2ad1178a 100644 --- a/packages/server/syscalls/space.ts +++ b/packages/server/syscalls/space.ts @@ -13,6 +13,9 @@ export default (space: Space): SysCallMapping => { ): Promise<{ text: string; meta: PageMeta }> => { return space.readPage(name); }, + "space.getPageMeta": async (ctx, name: string): Promise => { + return space.getPageMeta(name); + }, "space.writePage": async ( ctx, name: string, diff --git a/packages/web/syscalls/space.ts b/packages/web/syscalls/space.ts index 3a23b760..dc458560 100644 --- a/packages/web/syscalls/space.ts +++ b/packages/web/syscalls/space.ts @@ -13,6 +13,9 @@ export function spaceSyscalls(editor: Editor): SysCallMapping { ): Promise<{ text: string; meta: PageMeta }> => { return await editor.space.readPage(name); }, + "space.getPageMeta": async (ctx, name: string): Promise => { + return await editor.space.getPageMeta(name); + }, "space.writePage": async ( ctx, name: string,