All checks were successful
Deploy production / deploy (push) Successful in 1m19s
Vault files stay the source of truth (bind-mounted read-write at /notes): atomic writes chowned to the vault owner, hash-checked saves (409 on a newer file), deletes to .trash. notes.* is a full-text/link index kept current by a recursive watcher plus a 60s rescan; live updates over the owner-only /ws/notes channel (paths and hashes only). Wikilinks, embeds, backlinks, tags, callouts, image paste. Owner-only everywhere (404).
15 lines
608 B
TypeScript
15 lines
608 B
TypeScript
import { json } from '@sveltejs/kit';
|
|
import { requireOwner } from '#lib/server/owner.js';
|
|
import { allEntries } from '#lib/server/notes/indexer.js';
|
|
import { noStore } from '#lib/server/notes/http.js';
|
|
import type { RequestHandler } from './$types';
|
|
|
|
// The whole tree again (the page uses it after a WebSocket reconnect, in case it missed events).
|
|
export const GET: RequestHandler = async (event) => {
|
|
requireOwner(event);
|
|
const tree = allEntries().map(
|
|
(e) => [e.path, e.kind === 'note' ? 'n' : e.kind === 'conflict' ? 'c' : 'a', e.mtime] as const
|
|
);
|
|
return json({ tree }, { headers: noStore });
|
|
};
|