Removed all traces of sockets, real-time collab and other stuff.
This commit is contained in:
@@ -1,27 +1,23 @@
|
||||
import { PageMeta } from "../types";
|
||||
import { SysCallMapping } from "../../plugos/system";
|
||||
import { PageApi } from "../page_api";
|
||||
import { ClientConnection } from "../api_server";
|
||||
import { Storage } from "../disk_storage";
|
||||
|
||||
export default (pageApi: PageApi): SysCallMapping => {
|
||||
const api = pageApi.api();
|
||||
// @ts-ignore
|
||||
const dummyConn = new ClientConnection(null);
|
||||
export default (storage: Storage): SysCallMapping => {
|
||||
return {
|
||||
listPages: (ctx): Promise<PageMeta[]> => {
|
||||
return api.listPages(dummyConn);
|
||||
return storage.listPages();
|
||||
},
|
||||
readPage: async (
|
||||
ctx,
|
||||
name: string
|
||||
): Promise<{ text: string; meta: PageMeta }> => {
|
||||
return api.readPage(dummyConn, name);
|
||||
return storage.readPage(name);
|
||||
},
|
||||
writePage: async (ctx, name: string, text: string): Promise<PageMeta> => {
|
||||
return api.writePage(dummyConn, name, text);
|
||||
return storage.writePage(name, text);
|
||||
},
|
||||
deletePage: async (ctx, name: string) => {
|
||||
return api.deletePage(dummyConn, name);
|
||||
return storage.deletePage(name);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user