Removed all traces of sockets, real-time collab and other stuff.
This commit is contained in:
+1
-1
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user