Removed all traces of sockets, real-time collab and other stuff.

This commit is contained in:
Zef Hemel
2022-03-31 14:28:07 +02:00
parent 4525d60964
commit 859657f8b8
41 changed files with 796 additions and 1691 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import { syscall } from "../lib/syscall";
export async function insertToday() {
console.log("Inserting date");
console.log("Inserting date!");
let niceDate = new Date().toISOString().split("T")[0];
await syscall("editor.insertAtCursor", niceDate);
}
+1 -1
View File
@@ -35,5 +35,5 @@ export async function indexItems({ name, text }: IndexEvent) {
});
}
console.log("Found", items.length, "item(s)");
await syscall("indexer.batchSet", name, items);
await syscall("index.batchSet", name, items);
}
+1 -1
View File
@@ -15,7 +15,7 @@ export async function renderMD() {
}
},
});
console.log("output peices", JSON.stringify(tree));
// console.log("output peices", JSON.stringify(tree));
slicesToRemove.reverse().forEach(([from, to]) => {
text = text.slice(0, from) + text.slice(to);
});
+2 -2
View File
@@ -47,7 +47,7 @@ export async function updateMaterializedQueriesOnPage(pageName: string) {
key,
page,
value: { task, complete, children },
} of await syscall("indexer.scanPrefixGlobal", "task:")) {
} of await syscall("index.scanPrefixGlobal", "task:")) {
let [, pos] = key.split(":");
if (!filter || (filter && task.includes(filter))) {
results.push(
@@ -64,7 +64,7 @@ export async function updateMaterializedQueriesOnPage(pageName: string) {
key,
page,
value: { item, children },
} of await syscall("indexer.scanPrefixGlobal", "it:")) {
} of await syscall("index.scanPrefixGlobal", "it:")) {
let [, pos] = key.split(":");
if (!filter || (filter && item.includes(filter))) {
results.push(`* [[${page}@${pos}]] ${item}`);
+4 -7
View File
@@ -20,7 +20,7 @@ export async function indexLinks({ name, text }: IndexEvent) {
});
}
console.log("Found", backLinks.length, "wiki link(s)");
await syscall("indexer.batchSet", name, backLinks);
await syscall("index.batchSet", name, backLinks);
}
export async function deletePage() {
@@ -82,10 +82,7 @@ type BackLink = {
};
async function getBackLinks(pageName: string): Promise<BackLink[]> {
let allBackLinks = await syscall(
"indexer.scanPrefixGlobal",
`pl:${pageName}:`
);
let allBackLinks = await syscall("index.scanPrefixGlobal", `pl:${pageName}:`);
let pagesToUpdate: BackLink[] = [];
for (let { key, value } of allBackLinks) {
let keyParts = key.split(":");
@@ -129,7 +126,7 @@ export async function pageComplete() {
// Server functions
export async function reindexSpace() {
console.log("Clearing page index...");
await syscall("indexer.clearPageIndex");
await syscall("index.clearPageIndex");
console.log("Listing all pages");
let pages = await syscall("space.listPages");
for (let { name } of pages) {
@@ -144,5 +141,5 @@ export async function reindexSpace() {
export async function clearPageIndex(page: string) {
console.log("Clearing page index for page", page);
await syscall("indexer.clearPageIndexForPage", page);
await syscall("index.clearPageIndexForPage", page);
}
+2 -2
View File
@@ -45,11 +45,11 @@ export async function indexTasks({ name, text }: IndexEvent) {
});
}
console.log("Found", tasks.length, "task(s)");
await syscall("indexer.batchSet", name, tasks);
await syscall("index.batchSet", name, tasks);
}
export async function updateTaskPage() {
let allTasks = await syscall("indexer.scanPrefixGlobal", "task:");
let allTasks = await syscall("index.scanPrefixGlobal", "task:");
let pageTasks = new Map<string, Task[]>();
for (let {
key,