Work
This commit is contained in:
@@ -4,8 +4,8 @@ import { Space } from "@silverbulletmd/common/spaces/space";
|
||||
|
||||
export default (space: Space): SysCallMapping => {
|
||||
return {
|
||||
"space.listPages": async (ctx): Promise<PageMeta[]> => {
|
||||
return [...space.listPages()];
|
||||
"space.listPages": async (ctx, unfiltered = false): Promise<PageMeta[]> => {
|
||||
return [...space.listPages(unfiltered)];
|
||||
},
|
||||
"space.readPage": async (
|
||||
ctx,
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import { SysCallMapping } from "@plugos/plugos/system";
|
||||
import type { ExpressServer } from "../api_server";
|
||||
|
||||
export function systemSyscalls(expressServer: ExpressServer): SysCallMapping {
|
||||
return {
|
||||
"system.invokeFunction": async (
|
||||
ctx,
|
||||
env: string,
|
||||
name: string,
|
||||
...args: any[]
|
||||
) => {
|
||||
if (!ctx.plug) {
|
||||
throw Error("No plug associated with context");
|
||||
}
|
||||
return ctx.plug.invoke(name, args);
|
||||
},
|
||||
"system.reloadPlugs": async () => {
|
||||
return expressServer.reloadPlugs();
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user