Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
changes in API format
azivnera066c6fe2b4e
diff --git a/src/public/javascripts/dialogs/edit_tree_prefix.js b/src/public/javascripts/dialogs/edit_tree_prefix.jsindex 6569994974..6efd87b9a5 100644--- a/src/public/javascripts/dialogs/edit_tree_prefix.js+++ b/src/public/javascripts/dialogs/edit_tree_prefix.js@@ -33,7 +33,7 @@ async function showDialog() {async function savePrefix() {const prefix = $treePrefixInput.val();- await server.put('tree/' + branchId + '/set-prefix', { prefix: prefix });+ await server.put('branches/' + branchId + '/set-prefix', { prefix: prefix });await treeService.setPrefix(branchId, prefix);diff --git a/src/public/javascripts/dialogs/note_revisions.js b/src/public/javascripts/dialogs/note_revisions.jsindex cc2e4c436e..331a0dff38 100644--- a/src/public/javascripts/dialogs/note_revisions.js+++ b/src/public/javascripts/dialogs/note_revisions.js@@ -25,7 +25,7 @@ async function showNoteRevisionsDialog(noteId, noteRevisionId) {$list.empty();$content.empty();- revisionItems = await server.get('note-revisions/' + noteId);+ revisionItems = await server.get('notes/' + noteId + '/revisions');for (const item of revisionItems) {const dateModified = utils.parseDate(item.dateModifiedFrom);diff --git a/src/public/javascripts/dialogs/options.js b/src/public/javascripts/dialogs/options.jsindex f577d79480..6a04432fd6 100644--- a/src/public/javascripts/dialogs/options.js+++ b/src/public/javascripts/dialogs/options.js@@ -34,10 +34,7 @@ async function showDialog() {}async function saveOptions(optionName, optionValue) {- await server.post('options', {- name: optionName,- value: optionValue- });+ await server.put('options/' + encodeURIComponent(optionName) + '/' + encodeURIComponent(optionValue));infoService.showMessage("Options change have been saved.");}diff --git a/src/public/javascripts/services/bootstrap.js b/src/public/javascripts/services/bootstrap.jsindex d40d897ef0..e98df09d3d 100644--- a/src/public/javascripts/services/bootstrap.js+++ b/src/public/javascripts/services/bootstrap.js@@ -22,7 +22,7 @@ import ScriptApi from './script_api.js';import ScriptContext from './script_context.js';import sync from './sync.js';import treeService from './tree.js';-import treeChanges from './tree_changes.js';+import treeChanges from './branches.js';import treeUtils from './tree_utils.js';import utils from './utils.js';import server from './server.js';diff --git a/src/public/javascripts/services/tree_changes.js b/src/public/javascripts/services/branches.jssimilarity index 86%rename from src/public/javascripts/services/tree_changes.jsrename to src/public/javascripts/services/branches.jsindex 4d11fd1074..e654dd1a01 100644--- a/src/public/javascripts/services/tree_changes.js+++ b/src/public/javascripts/services/branches.js@@ -6,7 +6,7 @@ import treeCache from "./tree_cache.js";async function moveBeforeNode(nodesToMove, beforeNode) {for (const nodeToMove of nodesToMove) {- const resp = await server.put('tree/' + nodeToMove.data.branchId + '/move-before/' + beforeNode.data.branchId);+ const resp = await server.put('branches/' + nodeToMove.data.branchId + '/move-before/' + beforeNode.data.branchId);if (!resp.success) {alert(resp.message);@@ -21,7 +21,7 @@ async function moveAfterNode(nodesToMove, afterNode) {nodesToMove.reverse(); // need to reverse to keep the note orderfor (const nodeToMove of nodesToMove) {- const resp = await server.put('tree/' + nodeToMove.data.branchId + '/move-after/' + afterNode.data.branchId);+ const resp = await server.put('branches/' + nodeToMove.data.branchId + '/move-after/' + afterNode.data.branchId);if (!resp.success) {alert(resp.message);@@ -34,7 +34,7 @@ async function moveAfterNode(nodesToMove, afterNode) {async function moveToNode(nodesToMove, toNode) {for (const nodeToMove of nodesToMove) {- const resp = await server.put('tree/' + nodeToMove.data.branchId + '/move-to/' + toNode.data.noteId);+ const resp = await server.put('branches/' + nodeToMove.data.branchId + '/move-to/' + toNode.data.noteId);if (!resp.success) {alert(resp.message);@@ -64,7 +64,7 @@ async function deleteNodes(nodes) {}for (const node of nodes) {- await server.remove('tree/' + node.data.branchId);+ await server.remove('branches/' + node.data.branchId);}// following code assumes that nodes contain only top-most selected nodes - getSelectedNodes has been@@ -96,7 +96,7 @@ async function moveNodeUpInHierarchy(node) {return;}- const resp = await server.put('tree/' + node.data.branchId + '/move-after/' + node.getParent().data.branchId);+ const resp = await server.put('branches/' + node.data.branchId + '/move-after/' + node.getParent().data.branchId);if (!resp.success) {alert(resp.message);diff --git a/src/public/javascripts/services/context_menu.js b/src/public/javascripts/services/context_menu.jsindex 390a8ad9eb..61e55821a7 100644--- a/src/public/javascripts/services/context_menu.js+++ b/src/public/javascripts/services/context_menu.js@@ -3,9 +3,8 @@ import cloningService from './cloning.js';import exportService from './export.js';import messagingService from './messaging.js';import protectedSessionService from './protected_session.js';-import treeChangesService from './tree_changes.js';+import treeChangesService from './branches.js';import treeUtils from './tree_utils.js';-import utils from './utils.js';import editTreePrefixDialog from '../dialogs/edit_tree_prefix.js';import infoService from "./info.js";import treeCache from "./tree_cache.js";@@ -86,18 +85,18 @@ const contextMenuOptions = {{title: "----"},{title: "Edit tree prefix <kbd>F2</kbd>", cmd: "editTreePrefix", uiIcon: "ui-icon-pencil"},{title: "----"},- {title: "Protect sub-tree", cmd: "protectSubTree", uiIcon: "ui-icon-locked"},- {title: "Unprotect sub-tree", cmd: "unprotectSubTree", uiIcon: "ui-icon-unlocked"},+ {title: "Protect branch", cmd: "protectBranch", uiIcon: "ui-icon-locked"},+ {title: "Unprotect branch", cmd: "unprotectBranch", uiIcon: "ui-icon-unlocked"},{title: "----"},{title: "Copy / clone <kbd>Ctrl+C</kbd>", cmd: "copy", uiIcon: "ui-icon-copy"},{title: "Cut <kbd>Ctrl+X</kbd>", cmd: "cut", uiIcon: "ui-icon-scissors"},{title: "Paste into <kbd>Ctrl+V</kbd>", cmd: "pasteInto", uiIcon: "ui-icon-clipboard"},{title: "Paste after", cmd: "pasteAfter", uiIcon: "ui-icon-clipboard"},{title: "----"},- {title: "Export sub-tree", cmd: "exportSubTree", uiIcon: " ui-icon-arrowthick-1-ne"},- {title: "Import sub-tree into", cmd: "importSubTree", uiIcon: "ui-icon-arrowthick-1-sw"},+ {title: "Export branch", cmd: "exportBranch", uiIcon: " ui-icon-arrowthick-1-ne"},+ {title: "Import into branch", cmd: "importBranch", uiIcon: "ui-icon-arrowthick-1-sw"},{title: "----"},- {title: "Collapse sub-tree <kbd>Alt+-</kbd>", cmd: "collapseSubTree", uiIcon: "ui-icon-minus"},+ {title: "Collapse branch <kbd>Alt+-</kbd>", cmd: "collapseBranch", uiIcon: "ui-icon-minus"},{title: "Force note sync", cmd: "forceNoteSync", uiIcon: "ui-icon-refresh"},{title: "Sort alphabetically <kbd>Alt+S</kbd>", cmd: "sortAlphabetically", uiIcon: " ui-icon-arrowthick-2-n-s"}@@ -113,8 +112,8 @@ const contextMenuOptions = {$tree.contextmenu("enableEntry", "pasteInto", clipboardIds.length > 0 && note.type !== 'search');$tree.contextmenu("enableEntry", "insertNoteHere", !parentNote || parentNote.type !== 'search');$tree.contextmenu("enableEntry", "insertChildNote", note.type !== 'search');- $tree.contextmenu("enableEntry", "importSubTree", note.type !== 'search');- $tree.contextmenu("enableEntry", "exportSubTree", note.type !== 'search');+ $tree.contextmenu("enableEntry", "importBranch", note.type !== 'search');+ $tree.contextmenu("enableEntry", "exportBranch", note.type !== 'search');// Activate node on right-clicknode.setActive();@@ -138,11 +137,11 @@ const contextMenuOptions = {else if (ui.cmd === "editTreePrefix") {editTreePrefixDialog.showDialog(node);}- else if (ui.cmd === "protectSubTree") {- protectedSessionService.protectSubTree(node.data.noteId, true);+ else if (ui.cmd === "protectBranch") {+ protectedSessionService.protectBranch(node.data.noteId, true);}- else if (ui.cmd === "unprotectSubTree") {- protectedSessionService.protectSubTree(node.data.noteId, false);+ else if (ui.cmd === "unprotectBranch") {+ protectedSessionService.protectBranch(node.data.noteId, false);}else if (ui.cmd === "copy") {copy(treeService.getSelectedNodes());@@ -159,13 +158,13 @@ const contextMenuOptions = {else if (ui.cmd === "delete") {treeChangesService.deleteNodes(treeService.getSelectedNodes(true));}- else if (ui.cmd === "exportSubTree") {- exportService.exportSubTree(node.data.noteId);+ else if (ui.cmd === "exportBranch") {+ exportService.exportBranch(node.data.noteId);}- else if (ui.cmd === "importSubTree") {- exportService.importSubTree(node.data.noteId);+ else if (ui.cmd === "importBranch") {+ exportService.importBranch(node.data.noteId);}- else if (ui.cmd === "collapseSubTree") {+ else if (ui.cmd === "collapseBranch") {treeService.collapseTree(node);}else if (ui.cmd === "forceNoteSync") {diff --git a/src/public/javascripts/services/drag_and_drop.js b/src/public/javascripts/services/drag_and_drop.jsindex 70a7ca45fa..d9843ae276 100644--- a/src/public/javascripts/services/drag_and_drop.js+++ b/src/public/javascripts/services/drag_and_drop.js@@ -1,5 +1,5 @@import treeService from './tree.js';-import treeChangesService from './tree_changes.js';+import treeChangesService from './branches.js';const dragAndDropSetup = {autoExpandMS: 600,diff --git a/src/public/javascripts/services/export.js b/src/public/javascripts/services/export.jsindex 7d41801695..8cd954a3c6 100644--- a/src/public/javascripts/services/export.js+++ b/src/public/javascripts/services/export.js@@ -3,8 +3,8 @@ import protectedSessionHolder from './protected_session_holder.js';import utils from './utils.js';import server from './server.js';-function exportSubTree(noteId) {- const url = utils.getHost() + "/api/export/" + noteId + "?protectedSessionId="+function exportBranch(noteId) {+ const url = utils.getHost() + "/api/notes/" + noteId + "/export?protectedSessionId="+ encodeURIComponent(protectedSessionHolder.getProtectedSessionId());utils.download(url);@@ -12,7 +12,7 @@ function exportSubTree(noteId) {let importNoteId;-function importSubTree(noteId) {+function importBranch(noteId) {importNoteId = noteId;$("#import-upload").trigger('click');@@ -23,7 +23,7 @@ $("#import-upload").change(async function() {formData.append('upload', this.files[0]);await $.ajax({- url: baseApiUrl + 'import/' + importNoteId,+ url: baseApiUrl + 'notes/' + importNoteId + '/import',headers: server.getHeaders(),data: formData,type: 'POST',@@ -35,6 +35,6 @@ $("#import-upload").change(async function() {});export default {- exportSubTree,- importSubTree+ exportBranch,+ importBranch};\ No newline at end of filediff --git a/src/public/javascripts/services/protected_session.js b/src/public/javascripts/services/protected_session.jsindex 9a1a9e007a..36306bc2c1 100644--- a/src/public/javascripts/services/protected_session.js+++ b/src/public/javascripts/services/protected_session.js@@ -119,10 +119,10 @@ async function unprotectNoteAndSendToServer() {noteDetail.setNoteBackgroundIfProtected(note);}-async function protectSubTree(noteId, protect) {+async function protectBranch(noteId, protect) {await ensureProtectedSession(true, true);- await server.put('notes/' + noteId + "/protect-sub-tree/" + (protect ? 1 : 0));+ await server.put('notes/' + noteId + "/protect/" + (protect ? 1 : 0));infoService.showMessage("Request to un/protect sub tree has finished successfully");@@ -143,6 +143,6 @@ export default {ensureProtectedSession,protectNoteAndSendToServer,unprotectNoteAndSendToServer,- protectSubTree,+ protectBranch,ensureDialogIsClosed};\ No newline at end of filediff --git a/src/public/javascripts/services/protected_session_holder.js b/src/public/javascripts/services/protected_session_holder.jsindex 66b9cd839a..4e743d69b3 100644--- a/src/public/javascripts/services/protected_session_holder.js+++ b/src/public/javascripts/services/protected_session_holder.js@@ -6,7 +6,7 @@ let protectedSessionTimeout = null;let protectedSessionId = null;$(document).ready(() => {- server.get('options/all').then(options => protectedSessionTimeout = options.protected_session_timeout);+ server.get('options').then(options => protectedSessionTimeout = options.protected_session_timeout);});setInterval(() => {diff --git a/src/public/javascripts/services/tree.js b/src/public/javascripts/services/tree.jsindex a89afcaeaa..e65ae87b31 100644--- a/src/public/javascripts/services/tree.js+++ b/src/public/javascripts/services/tree.js@@ -4,7 +4,7 @@ import linkService from './link.js';import messagingService from './messaging.js';import noteDetailService from './note_detail.js';import protectedSessionHolder from './protected_session_holder.js';-import treeChangesService from './tree_changes.js';+import treeChangesService from './branches.js';import treeUtils from './tree_utils.js';import utils from './utils.js';import server from './server.js';@@ -238,7 +238,7 @@ async function setExpandedToServer(branchId, isExpanded) {const expandedNum = isExpanded ? 1 : 0;- await server.put('tree/' + branchId + '/expanded/' + expandedNum);+ await server.put('branches/' + branchId + '/expanded/' + expandedNum);}function setCurrentNotePathToHash(node) {diff --git a/src/public/javascripts/services/tree_keybindings.js b/src/public/javascripts/services/tree_keybindings.jsindex 71b5eb8b22..062fdbf892 100644--- a/src/public/javascripts/services/tree_keybindings.js+++ b/src/public/javascripts/services/tree_keybindings.js@@ -1,6 +1,6 @@import noteDetailService from "./note_detail.js";import utils from "./utils.js";-import treeChangesService from "./tree_changes.js";+import treeChangesService from "./branches.js";import contextMenuService from "./context_menu.js";import treeService from "./tree.js";import editTreePrefixDialog from "../dialogs/edit_tree_prefix.js";diff --git a/src/routes/api/tree_changes.js b/src/routes/api/branches.jssimilarity index 92%rename from src/routes/api/tree_changes.jsrename to src/routes/api/branches.jsindex 42567acdf0..7c09ce6137 100644--- a/src/routes/api/tree_changes.js+++ b/src/routes/api/branches.js@@ -105,10 +105,20 @@ async function deleteBranch(req) {await notes.deleteNote(branch);}+async function setPrefix(req) {+ const branchId = req.params.branchId;+ const prefix = utils.isEmptyOrWhitespace(req.body.prefix) ? null : req.body.prefix;++ const branch = await repository.getBranch(branchId);+ branch.prefix = prefix;+ await branch.save();+}+module.exports = {moveBranchToParent,moveBranchBeforeNote,moveBranchAfterNote,setExpanded,- deleteBranch+ deleteBranch,+ setPrefix};\ No newline at end of filediff --git a/src/routes/api/cloning.js b/src/routes/api/cloning.jsindex d9f59b831c..c6d3bceae1 100644--- a/src/routes/api/cloning.js+++ b/src/routes/api/cloning.js@@ -1,17 +1,16 @@"use strict";const sql = require('../../services/sql');-const utils = require('../../services/utils');const sync_table = require('../../services/sync_table');const tree = require('../../services/tree');const Branch = require('../../entities/branch');async function cloneNoteToParent(req) {+ const noteId = req.params.noteId;const parentNoteId = req.params.parentNoteId;- const childNoteId = req.params.childNoteId;const prefix = req.body.prefix;- const validationResult = await tree.validateParentChild(parentNoteId, childNoteId);+ const validationResult = await tree.validateParentChild(parentNoteId, noteId);if (!validationResult.success) {return validationResult;@@ -21,7 +20,7 @@ async function cloneNoteToParent(req) {const newNotePos = maxNotePos === null ? 0 : maxNotePos + 1;const branch = new Branch({- noteId: childNoteId,+ noteId: noteId,parentNoteId: parentNoteId,prefix: prefix,notePosition: newNotePos,diff --git a/src/routes/api/import.js b/src/routes/api/import.jsindex ca5c1b64c1..8c8ad4db2a 100644--- a/src/routes/api/import.js+++ b/src/routes/api/import.js@@ -86,18 +86,18 @@ async function parseImportFile(file) {}async function importTar(req) {- const parentNoteId = req.params.parentNoteId;+ const noteId = req.params.noteId;const file = req.file;- const parentNote = await repository.getNote(parentNoteId);+ const parentNote = await repository.getNote(noteId);if (!parentNote) {- return [404, `Note ${parentNoteId} doesn't exist.`];+ return [404, `Note ${noteId} doesn't exist.`];}const files = await parseImportFile(file);- await importNotes(files, parentNoteId);+ await importNotes(files, noteId);}async function importNotes(files, parentNoteId) {diff --git a/src/routes/api/options.js b/src/routes/api/options.jsindex 29ec7a7156..6ccaafe91b 100644--- a/src/routes/api/options.js+++ b/src/routes/api/options.js@@ -6,11 +6,7 @@ const options = require('../../services/options');// options allowed to be updated directly in options dialogconst ALLOWED_OPTIONS = ['protected_session_timeout', 'note_revision_snapshot_time_interval'];-async function getAllOptions() {- return await sql.getMap("SELECT name, value FROM options");-}--async function getAllowedOptions() {+async function getOptions() {const options = await sql.getMap("SELECT name, value FROM options WHERE name IN ("+ ALLOWED_OPTIONS.map(x => '?').join(",") + ")", ALLOWED_OPTIONS);@@ -18,17 +14,16 @@ async function getAllowedOptions() {}async function updateOption(req) {- const body = req.body;+ const {name, value} = req.params;- if (!ALLOWED_OPTIONS.includes(body['name'])) {+ if (!ALLOWED_OPTIONS.includes(name)) {return [400, "not allowed option to set"];}- await options.setOption(body['name'], body['value']);+ await options.setOption(name, value);}module.exports = {- getAllowedOptions,- getAllOptions,+ getOptions,updateOption};\ No newline at end of filediff --git a/src/routes/api/tree.js b/src/routes/api/tree.jsindex 656d889bf3..6f3398b8c7 100644--- a/src/routes/api/tree.js+++ b/src/routes/api/tree.js@@ -60,16 +60,6 @@ async function getTree() {};}-async function setPrefix(req) {- const branchId = req.params.branchId;- const prefix = utils.isEmptyOrWhitespace(req.body.prefix) ? null : req.body.prefix;-- const branch = await repository.getBranch(branchId);- branch.prefix = prefix;- await branch.save();-}-module.exports = {- getTree,- setPrefix+ getTree};diff --git a/src/routes/routes.js b/src/routes/routes.jsindex 2d1eb5de9e..a7aaffdaa1 100644--- a/src/routes/routes.js+++ b/src/routes/routes.js@@ -7,7 +7,7 @@ const multer = require('multer')();// API routesconst treeApiRoute = require('./api/tree');const notesApiRoute = require('./api/notes');-const treeChangesApiRoute = require('./api/tree_changes');+const branchesApiRoute = require('./api/branches');const cloningApiRoute = require('./api/cloning');const noteRevisionsApiRoute = require('./api/note_revisions');const recentChangesApiRoute = require('./api/recent_changes');@@ -99,36 +99,37 @@ function register(app) {route(GET, '/setup', [auth.checkAppNotInitialized], setupRoute.setupPage);apiRoute(GET, '/api/tree', treeApiRoute.getTree);- apiRoute(PUT, '/api/tree/:branchId/set-prefix', treeApiRoute.setPrefix);+ apiRoute(PUT, '/api/branches/:branchId/set-prefix', branchesApiRoute.setPrefix);- apiRoute(PUT, '/api/tree/:branchId/move-to/:parentNoteId', treeChangesApiRoute.moveBranchToParent);- apiRoute(PUT, '/api/tree/:branchId/move-before/:beforeBranchId', treeChangesApiRoute.moveBranchBeforeNote);- apiRoute(PUT, '/api/tree/:branchId/move-after/:afterBranchId', treeChangesApiRoute.moveBranchAfterNote);- apiRoute(PUT, '/api/tree/:branchId/expanded/:expanded', treeChangesApiRoute.setExpanded);- apiRoute(DELETE, '/api/tree/:branchId', treeChangesApiRoute.deleteBranch);+ apiRoute(PUT, '/api/branches/:branchId/move-to/:parentNoteId', branchesApiRoute.moveBranchToParent);+ apiRoute(PUT, '/api/branches/:branchId/move-before/:beforeBranchId', branchesApiRoute.moveBranchBeforeNote);+ apiRoute(PUT, '/api/branches/:branchId/move-after/:afterBranchId', branchesApiRoute.moveBranchAfterNote);+ apiRoute(PUT, '/api/branches/:branchId/expanded/:expanded', branchesApiRoute.setExpanded);+ apiRoute(DELETE, '/api/branches/:branchId', branchesApiRoute.deleteBranch);apiRoute(GET, '/api/notes/:noteId', notesApiRoute.getNote);apiRoute(PUT, '/api/notes/:noteId', notesApiRoute.updateNote);apiRoute(POST, '/api/notes/:parentNoteId/children', notesApiRoute.createNote);apiRoute(PUT, '/api/notes/:noteId/sort', notesApiRoute.sortNotes);- apiRoute(PUT, '/api/notes/:noteId/protect-sub-tree/:isProtected', notesApiRoute.protectBranch);+ apiRoute(PUT, '/api/notes/:noteId/protect/:isProtected', notesApiRoute.protectBranch);apiRoute(PUT, /\/api\/notes\/(.*)\/type\/(.*)\/mime\/(.*)/, notesApiRoute.setNoteTypeMime);+ apiRoute(GET, '/api/notes/:noteId/revisions', noteRevisionsApiRoute.getNoteRevisions);- apiRoute(PUT, '/api/notes/:childNoteId/clone-to/:parentNoteId', cloningApiRoute.cloneNoteToParent);+ apiRoute(PUT, '/api/notes/:noteId/clone-to/:parentNoteId', cloningApiRoute.cloneNoteToParent);apiRoute(PUT, '/api/notes/:noteId/clone-after/:afterBranchId', cloningApiRoute.cloneNoteAfter);+ route(GET, '/api/notes/:noteId/export', [auth.checkApiAuthOrElectron], exportRoute.exportNote);+ route(POST, '/api/notes/:noteId/import', [auth.checkApiAuthOrElectron, uploadMiddleware], importRoute.importTar, apiResultHandler);+apiRoute(GET, '/api/notes/:noteId/labels', labelsRoute.getNoteLabels);apiRoute(PUT, '/api/notes/:noteId/labels', labelsRoute.updateNoteLabels);apiRoute(GET, '/api/labels/names', labelsRoute.getAllLabelNames);apiRoute(GET, '/api/labels/values/:labelName', labelsRoute.getValuesForLabel);- apiRoute(GET, '/api/note-revisions/:noteId', noteRevisionsApiRoute.getNoteRevisions);-apiRoute(GET, '/api/recent-changes', recentChangesApiRoute.getRecentChanges);- apiRoute(GET, '/api/options', optionsApiRoute.getAllowedOptions);- apiRoute(GET, '/api/options/all', optionsApiRoute.getAllOptions);- apiRoute(POST, '/api/options', optionsApiRoute.updateOption);+ apiRoute(GET, '/api/options', optionsApiRoute.getOptions);+ apiRoute(PUT, '/api/options/:name/:value', optionsApiRoute.updateOption);apiRoute(POST, '/api/password/change', passwordApiRoute.changePassword);@@ -164,9 +165,6 @@ function register(app) {apiRoute(PUT, '/api/recent-notes/:branchId/:notePath', recentNotesRoute.addRecentNote);apiRoute(GET, '/api/app-info', appInfoRoute.getAppInfo);- route(GET, '/api/export/:noteId', [auth.checkApiAuthOrElectron], exportRoute.exportNote);- route(POST, '/api/import/:parentNoteId', [auth.checkApiAuthOrElectron], importRoute.importTar, apiResultHandler);-route(POST, '/api/setup', [auth.checkAppNotInitialized], setupApiRoute.setup, apiResultHandler);apiRoute(POST, '/api/sql/execute', sqlRoute.execute);