mirror of
https://github.com/zadam/trilium.git
synced 2026-01-17 20:14:25 +01:00
chore(core): integrate keyboard actions route
This commit is contained in:
parent
7966cfd09c
commit
a1c4a17d64
@ -89,6 +89,8 @@ async function initialize(): Promise<void> {
|
||||
}
|
||||
});
|
||||
|
||||
console.log("[Worker] Supported routes", Object.keys(coreModule.routes));
|
||||
|
||||
console.log("[Worker] Initializing becca...");
|
||||
await coreModule.becca_loader.beccaLoaded;
|
||||
|
||||
@ -219,6 +221,14 @@ async function dispatch(request: LocalRequest) {
|
||||
}));
|
||||
}
|
||||
|
||||
if (request.method === "GET" && url.pathname === "/api/keyboard-actions") {
|
||||
return jsonResponse(core.routes.keysApiRoute.getKeyboardActions());
|
||||
}
|
||||
|
||||
if (request.method === "GET" && url.pathname === "/api/keyboard-shortcuts-for-notes") {
|
||||
return jsonResponse(core.routes.keysApiRoute.getShortcutsForNotes());
|
||||
}
|
||||
|
||||
if (url.pathname.startsWith("/api/echo")) {
|
||||
return jsonResponse({ ok: true, method: request.method, url: request.url });
|
||||
}
|
||||
|
||||
@ -34,7 +34,6 @@ import filesRoute from "./api/files.js";
|
||||
import fontsRoute from "./api/fonts.js";
|
||||
import imageRoute from "./api/image.js";
|
||||
import importRoute from "./api/import.js";
|
||||
import keysRoute from "./api/keys.js";
|
||||
import llmRoute from "./api/llm.js";
|
||||
import loginApiRoute from "./api/login.js";
|
||||
import metricsRoute from "./api/metrics.js";
|
||||
@ -332,8 +331,8 @@ function register(app: express.Application) {
|
||||
asyncRoute(PST, "/api/sender/image", [auth.checkEtapiToken, uploadMiddlewareWithErrorHandling], senderRoute.uploadImage, apiResultHandler);
|
||||
asyncRoute(PST, "/api/sender/note", [auth.checkEtapiToken], senderRoute.saveNote, apiResultHandler);
|
||||
|
||||
apiRoute(GET, "/api/keyboard-actions", keysRoute.getKeyboardActions);
|
||||
apiRoute(GET, "/api/keyboard-shortcuts-for-notes", keysRoute.getShortcutsForNotes);
|
||||
apiRoute(GET, "/api/keyboard-actions", routes.keysApiRoute.getKeyboardActions);
|
||||
apiRoute(GET, "/api/keyboard-shortcuts-for-notes", routes.keysApiRoute.getShortcutsForNotes);
|
||||
|
||||
apiRoute(PST, "/api/relation-map", relationMapApiRoute.getRelationMap);
|
||||
apiRoute(PST, "/api/notes/erase-deleted-notes-now", notesApiRoute.eraseDeletedNotesNow);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
import keyboardActions from "../../services/keyboard_actions.js";
|
||||
import becca from "../../becca/becca.js";
|
||||
import becca from "../../becca/becca";
|
||||
import keyboard_actions from "../../services/keyboard_actions";
|
||||
|
||||
function getKeyboardActions() {
|
||||
return keyboardActions.getKeyboardActions();
|
||||
return keyboard_actions.getKeyboardActions();
|
||||
}
|
||||
|
||||
function getShortcutsForNotes() {
|
||||
@ -1,2 +1,3 @@
|
||||
export { default as optionsApiRoute } from "./api/options";
|
||||
export { default as treeApiRoute } from "./api/tree";
|
||||
export { default as keysApiRoute } from "./api/keys";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user