diff --git a/db/migrations/0200__create_hidden_subtree.js b/db/migrations/0200__create_hidden_subtree.js index aba83ac4e..990566283 100644 --- a/db/migrations/0200__create_hidden_subtree.js +++ b/db/migrations/0200__create_hidden_subtree.js @@ -1,5 +1,5 @@ module.exports = () => { - const hiddenSubtreeService = require('../../src/services/hidden_subtree.js'); + const hiddenSubtreeService = require('../../src/services/hidden_subtree'); const cls = require("../../src/services/cls"); const beccaLoader = require("../../src/becca/becca_loader"); diff --git a/dump-db/dump-db.js b/dump-db/dump-db.js index ece36f39e..2e37486c0 100755 --- a/dump-db/dump-db.js +++ b/dump-db/dump-db.js @@ -2,7 +2,7 @@ const yargs = require('yargs/yargs') const { hideBin } = require('yargs/helpers') -const dumpService = require("./inc/dump.js"); +const dumpService = require("./inc/dump"); yargs(hideBin(process.argv)) .command('$0 ', 'dump the contents of document.db into the target directory', (yargs) => { diff --git a/dump-db/inc/data_key.js b/dump-db/inc/data_key.js index c879bafad..fe47ddd6f 100644 --- a/dump-db/inc/data_key.js +++ b/dump-db/inc/data_key.js @@ -1,6 +1,6 @@ const crypto = require("crypto"); -const sql = require("./sql.js"); -const decryptService = require("./decrypt.js"); +const sql = require("./sql"); +const decryptService = require("./decrypt"); function getDataKey(password) { if (!password) { diff --git a/dump-db/inc/dump.js b/dump-db/inc/dump.js index 6145f040a..cd6ba5534 100644 --- a/dump-db/inc/dump.js +++ b/dump-db/inc/dump.js @@ -1,9 +1,9 @@ const fs = require("fs"); const sanitize = require("sanitize-filename"); -const sql = require("./sql.js"); -const decryptService = require("./decrypt.js"); -const dataKeyService = require("./data_key.js"); -const extensionService = require("./extension.js"); +const sql = require("./sql"); +const decryptService = require("./decrypt"); +const dataKeyService = require("./data_key"); +const extensionService = require("./extension"); function dumpDocument(documentPath, targetPath, options) { const stats = { diff --git a/spec/search/search.spec.js b/spec/search/search.spec.js index e74d48107..ce826ed16 100644 --- a/spec/search/search.spec.js +++ b/spec/search/search.spec.js @@ -4,7 +4,7 @@ const Branch = require('../../src/becca/entities/branch'); const SearchContext = require('../../src/services/search/search_context'); const dateUtils = require('../../src/services/date_utils'); const becca = require('../../src/becca/becca'); -const {NoteBuilder, findNoteByTitle, note} = require('./becca_mocking.js'); +const {NoteBuilder, findNoteByTitle, note} = require('./becca_mocking'); describe("Search", () => { let rootNote; diff --git a/spec/search/value_extractor.spec.js b/spec/search/value_extractor.spec.js index 1e664279f..04fe3c303 100644 --- a/spec/search/value_extractor.spec.js +++ b/spec/search/value_extractor.spec.js @@ -1,4 +1,4 @@ -const {note} = require('./becca_mocking.js'); +const {note} = require('./becca_mocking'); const ValueExtractor = require('../../src/services/search/value_extractor'); const becca = require('../../src/becca/becca'); const SearchContext = require("../../src/services/search/search_context"); diff --git a/src/becca/becca_service.js b/src/becca/becca_service.js index 4337903b0..d666c502a 100644 --- a/src/becca/becca_service.js +++ b/src/becca/becca_service.js @@ -1,6 +1,6 @@ "use strict"; -const becca = require('./becca.js'); +const becca = require('./becca'); const cls = require('../services/cls'); const protectedSessionService = require('../services/protected_session'); const log = require('../services/log'); diff --git a/src/becca/entities/branch.js b/src/becca/entities/branch.js index 691a46e39..2ed3ec070 100644 --- a/src/becca/entities/branch.js +++ b/src/becca/entities/branch.js @@ -4,7 +4,7 @@ const Note = require('./note'); const AbstractEntity = require("./abstract_entity"); const sql = require("../../services/sql"); const dateUtils = require("../../services/date_utils"); -const utils = require("../../services/utils.js"); +const utils = require("../../services/utils"); const TaskContext = require("../../services/task_context"); const cls = require("../../services/cls"); const log = require("../../services/log"); diff --git a/src/becca/similarity.js b/src/becca/similarity.js index f270960c0..efb8734d6 100644 --- a/src/becca/similarity.js +++ b/src/becca/similarity.js @@ -1,6 +1,6 @@ const becca = require('./becca'); const log = require('../services/log'); -const beccaService = require('./becca_service.js'); +const beccaService = require('./becca_service'); const dateUtils = require('../services/date_utils'); const { JSDOM } = require("jsdom"); diff --git a/src/etapi/app_info.js b/src/etapi/app_info.js index ede96d792..3dc4481ac 100644 --- a/src/etapi/app_info.js +++ b/src/etapi/app_info.js @@ -1,5 +1,5 @@ const appInfo = require('../services/app_info'); -const eu = require("./etapi_utils.js"); +const eu = require("./etapi_utils"); function register(router) { eu.route(router, 'get', '/etapi/app-info', (req, res, next) => { diff --git a/src/public/app/widgets/attribute_widgets/attribute_editor.js b/src/public/app/widgets/attribute_widgets/attribute_editor.js index 59e8b1906..d3bf0522b 100644 --- a/src/public/app/widgets/attribute_widgets/attribute_editor.js +++ b/src/public/app/widgets/attribute_widgets/attribute_editor.js @@ -357,7 +357,7 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget { // disable spellcheck for attribute editor this.textEditor.editing.view.change(writer => writer.setAttribute('spellcheck', 'false', this.textEditor.editing.view.document.getRoot())); - //await import(/* webpackIgnore: true */'../../libraries/ckeditor/inspector.js'); + //await import(/* webpackIgnore: true */'../../libraries/ckeditor/inspector'); //CKEditorInspector.attach(this.textEditor); } diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.js index b60e981ff..04524a645 100644 --- a/src/public/app/widgets/note_tree.js +++ b/src/public/app/widgets/note_tree.js @@ -452,7 +452,7 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) { const files = [...dataTransfer.files]; // chrome has issue that dataTransfer.files empties after async operation - const importService = await import('../services/import.js'); + const importService = await import('../services/import'); importService.uploadFiles(node.data.noteId, files, { safeImport: true, diff --git a/src/public/app/widgets/type_widgets/editable_text.js b/src/public/app/widgets/type_widgets/editable_text.js index c41d020aa..8f53e7207 100644 --- a/src/public/app/widgets/type_widgets/editable_text.js +++ b/src/public/app/widgets/type_widgets/editable_text.js @@ -132,7 +132,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget { this.textEditor.model.document.on('change:data', () => this.spacedUpdate.scheduleUpdate()); if (glob.isDev && ENABLE_INSPECTOR) { - await import(/* webpackIgnore: true */'../../../libraries/ckeditor/inspector.js'); + await import(/* webpackIgnore: true */'../../../libraries/ckeditor/inspector'); CKEditorInspector.attach(this.textEditor); } } diff --git a/src/routes/api/attributes.js b/src/routes/api/attributes.js index 60339ad71..ec4ab2c3f 100644 --- a/src/routes/api/attributes.js +++ b/src/routes/api/attributes.js @@ -5,8 +5,8 @@ const log = require('../../services/log'); const attributeService = require('../../services/attributes'); const Attribute = require('../../becca/entities/attribute'); const becca = require("../../becca/becca"); -const ValidationError = require("../../public/app/services/validation_error.js"); -const NotFoundError = require("../../errors/not_found_error.js"); +const ValidationError = require("../../errors/validation_error"); +const NotFoundError = require("../../errors/not_found_error"); function getEffectiveNoteAttributes(req) { const note = becca.getNote(req.params.noteId); diff --git a/src/routes/api/branches.js b/src/routes/api/branches.js index 8ef10b119..cb3f31b71 100644 --- a/src/routes/api/branches.js +++ b/src/routes/api/branches.js @@ -8,9 +8,9 @@ const noteService = require('../../services/notes'); const becca = require('../../becca/becca'); const TaskContext = require('../../services/task_context'); const branchService = require("../../services/branches"); -const log = require("../../services/log.js"); -const ValidationError = require("../../public/app/services/validation_error.js"); -const NotFoundError = require("../../errors/not_found_error.js"); +const log = require("../../services/log"); +const ValidationError = require("../../errors/validation_error"); +const NotFoundError = require("../../errors/not_found_error"); /** * Code in this file deals with moving and cloning branches. Relationship between note and parent note is unique diff --git a/src/routes/api/export.js b/src/routes/api/export.js index 0a22233a8..365c7e185 100644 --- a/src/routes/api/export.js +++ b/src/routes/api/export.js @@ -6,7 +6,7 @@ const opmlExportService = require('../../services/export/opml'); const becca = require('../../becca/becca'); const TaskContext = require("../../services/task_context"); const log = require("../../services/log"); -const NotFoundError = require("../../errors/not_found_error.js"); +const NotFoundError = require("../../errors/not_found_error"); function exportBranch(req, res) { const {branchId, type, format, version, taskId} = req.params; diff --git a/src/routes/api/files.js b/src/routes/api/files.js index 3b9bef762..7e41af4ae 100644 --- a/src/routes/api/files.js +++ b/src/routes/api/files.js @@ -10,7 +10,7 @@ const { Readable } = require('stream'); const chokidar = require('chokidar'); const ws = require('../../services/ws'); const becca = require("../../becca/becca"); -const NotFoundError = require("../../errors/not_found_error.js"); +const NotFoundError = require("../../errors/not_found_error"); function updateFile(req) { const {noteId} = req.params; diff --git a/src/routes/api/image.js b/src/routes/api/image.js index 619f7b21e..aa6151ce6 100644 --- a/src/routes/api/image.js +++ b/src/routes/api/image.js @@ -4,8 +4,8 @@ const imageService = require('../../services/image'); const becca = require('../../becca/becca'); const RESOURCE_DIR = require('../../services/resource_dir').RESOURCE_DIR; const fs = require('fs'); -const ValidationError = require("../../public/app/services/validation_error.js"); -const NotFoundError = require("../../errors/not_found_error.js"); +const ValidationError = require("../../errors/validation_error"); +const NotFoundError = require("../../errors/not_found_error"); function returnImage(req, res) { const image = becca.getNote(req.params.noteId); diff --git a/src/routes/api/import.js b/src/routes/api/import.js index 930758ce8..f62f37b7c 100644 --- a/src/routes/api/import.js +++ b/src/routes/api/import.js @@ -10,8 +10,8 @@ const becca = require('../../becca/becca'); const beccaLoader = require('../../becca/becca_loader'); const log = require('../../services/log'); const TaskContext = require('../../services/task_context'); -const ValidationError = require("../../public/app/services/validation_error.js"); -const NotFoundError = require("../../errors/not_found_error.js"); +const ValidationError = require("../../errors/validation_error"); +const NotFoundError = require("../../errors/not_found_error"); async function importToBranch(req) { const {parentNoteId} = req.params; diff --git a/src/routes/api/note_map.js b/src/routes/api/note_map.js index f9fe9bc44..4485130a0 100644 --- a/src/routes/api/note_map.js +++ b/src/routes/api/note_map.js @@ -2,7 +2,7 @@ const becca = require("../../becca/becca"); const { JSDOM } = require("jsdom"); -const NotFoundError = require("../../errors/not_found_error.js"); +const NotFoundError = require("../../errors/not_found_error"); function buildDescendantCountMap() { const noteIdToCountMap = {}; diff --git a/src/routes/api/notes.js b/src/routes/api/notes.js index 1033d3663..ba112b034 100644 --- a/src/routes/api/notes.js +++ b/src/routes/api/notes.js @@ -6,11 +6,10 @@ const sql = require('../../services/sql'); const utils = require('../../services/utils'); const log = require('../../services/log'); const TaskContext = require('../../services/task_context'); -const protectedSessionService = require('../../services/protected_session'); const fs = require('fs'); const becca = require("../../becca/becca"); -const ValidationError = require("../../public/app/services/validation_error.js"); -const NotFoundError = require("../../errors/not_found_error.js"); +const ValidationError = require("../../errors/validation_error"); +const NotFoundError = require("../../errors/not_found_error"); function getNote(req) { const noteId = req.params.noteId; diff --git a/src/routes/api/options.js b/src/routes/api/options.js index 4c2add9f3..a176bb45f 100644 --- a/src/routes/api/options.js +++ b/src/routes/api/options.js @@ -3,7 +3,7 @@ const optionService = require('../../services/options'); const log = require('../../services/log'); const searchService = require('../../services/search/services/search'); -const ValidationError = require("../../public/app/services/validation_error.js"); +const ValidationError = require("../../errors/validation_error"); // options allowed to be updated directly in options dialog const ALLOWED_OPTIONS = new Set([ diff --git a/src/routes/api/password.js b/src/routes/api/password.js index 7fe1203cb..289a18716 100644 --- a/src/routes/api/password.js +++ b/src/routes/api/password.js @@ -1,7 +1,7 @@ "use strict"; const passwordService = require('../../services/password'); -const ValidationError = require("../../public/app/services/validation_error.js"); +const ValidationError = require("../../errors/validation_error"); function changePassword(req) { if (passwordService.isPasswordSet()) { diff --git a/src/routes/api/search.js b/src/routes/api/search.js index 8356b14f0..b9c1f5412 100644 --- a/src/routes/api/search.js +++ b/src/routes/api/search.js @@ -6,8 +6,8 @@ const searchService = require('../../services/search/services/search'); const bulkActionService = require("../../services/bulk_actions"); const cls = require("../../services/cls"); const {formatAttrForSearch} = require("../../services/attribute_formatter"); -const ValidationError = require("../../public/app/services/validation_error.js"); -const NotFoundError = require("../../errors/not_found_error.js"); +const ValidationError = require("../../errors/validation_error"); +const NotFoundError = require("../../errors/not_found_error"); function searchFromNote(req) { const note = becca.getNote(req.params.noteId); diff --git a/src/routes/api/similar_notes.js b/src/routes/api/similar_notes.js index 524bfc493..e27968ebe 100644 --- a/src/routes/api/similar_notes.js +++ b/src/routes/api/similar_notes.js @@ -2,7 +2,7 @@ const similarityService = require('../../becca/similarity'); const becca = require("../../becca/becca"); -const NotFoundError = require("../../errors/not_found_error.js"); +const NotFoundError = require("../../errors/not_found_error"); async function getSimilarNotes(req) { const noteId = req.params.noteId; diff --git a/src/routes/api/sql.js b/src/routes/api/sql.js index 25bf111f7..09e14cc86 100644 --- a/src/routes/api/sql.js +++ b/src/routes/api/sql.js @@ -2,7 +2,7 @@ const sql = require('../../services/sql'); const becca = require("../../becca/becca"); -const NotFoundError = require("../../errors/not_found_error.js"); +const NotFoundError = require("../../errors/not_found_error"); function getSchema() { const tableNames = sql.getColumn(`SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%' ORDER BY name`); diff --git a/src/routes/api/stats.js b/src/routes/api/stats.js index 4276655eb..43aec3014 100644 --- a/src/routes/api/stats.js +++ b/src/routes/api/stats.js @@ -1,6 +1,6 @@ const sql = require('../../services/sql'); const becca = require('../../becca/becca'); -const NotFoundError = require("../../errors/not_found_error.js"); +const NotFoundError = require("../../errors/not_found_error"); function getNoteSize(req) { const {noteId} = req.params; diff --git a/src/routes/api/tree.js b/src/routes/api/tree.js index 5f323570c..82b3ace04 100644 --- a/src/routes/api/tree.js +++ b/src/routes/api/tree.js @@ -2,7 +2,7 @@ const becca = require('../../becca/becca'); const log = require('../../services/log'); -const NotFoundError = require("../../errors/not_found_error.js"); +const NotFoundError = require("../../errors/not_found_error"); function getNotesAndBranchesAndAttributes(noteIds) { noteIds = new Set(noteIds); diff --git a/src/routes/login.js b/src/routes/login.js index f00e455df..f824931c6 100644 --- a/src/routes/login.js +++ b/src/routes/login.js @@ -6,7 +6,7 @@ const myScryptService = require('../services/my_scrypt'); const log = require('../services/log'); const passwordService = require("../services/password"); const assetPath = require("../services/asset_path"); -const ValidationError = require("../public/app/services/validation_error.js"); +const ValidationError = require("../errors/validation_error"); function loginPage(req, res) { res.render('login', { diff --git a/src/routes/routes.js b/src/routes/routes.js index bb3f1d044..ff1dde1fa 100644 --- a/src/routes/routes.js +++ b/src/routes/routes.js @@ -5,7 +5,7 @@ const loginRoute = require('./login'); const indexRoute = require('./index'); const utils = require('../services/utils'); const multer = require('multer'); -const ValidationError = require("../errors/validation_error.js"); +const ValidationError = require("../errors/validation_error"); // API routes const treeApiRoute = require('./api/tree'); @@ -62,7 +62,7 @@ const csurf = require('csurf'); const {createPartialContentHandler} = require("express-partial-content"); const rateLimit = require("express-rate-limit"); const AbstractEntity = require("../becca/entities/abstract_entity"); -const NotFoundError = require("../errors/not_found_error.js"); +const NotFoundError = require("../errors/not_found_error"); const csrfMiddleware = csurf({ cookie: true, diff --git a/src/services/hidden_subtree.js b/src/services/hidden_subtree.js index 73bdebec3..4b2ae362f 100644 --- a/src/services/hidden_subtree.js +++ b/src/services/hidden_subtree.js @@ -1,6 +1,6 @@ const becca = require("../becca/becca"); const noteService = require("./notes"); -const log = require("./log.js"); +const log = require("./log"); const LBTPL_ROOT = "lbTplRoot"; const LBTPL_BASE = "lbTplBase"; diff --git a/src/services/notes.js b/src/services/notes.js index 72fb46383..77b16c236 100644 --- a/src/services/notes.js +++ b/src/services/notes.js @@ -18,8 +18,8 @@ const Branch = require('../becca/entities/branch'); const Note = require('../becca/entities/note'); const Attribute = require('../becca/entities/attribute'); const dayjs = require("dayjs"); -const htmlSanitizer = require("./html_sanitizer.js"); -const ValidationError = require("../errors/validation_error.js"); +const htmlSanitizer = require("./html_sanitizer"); +const ValidationError = require("../errors/validation_error"); function getNewNotePosition(parentNoteId) { const note = becca.notes[parentNoteId]; diff --git a/src/services/search/services/parse.js b/src/services/search/services/parse.js index ad88449e2..2f72e0b1b 100644 --- a/src/services/search/services/parse.js +++ b/src/services/search/services/parse.js @@ -12,7 +12,7 @@ const PropertyComparisonExp = require('../expressions/property_comparison'); const AttributeExistsExp = require('../expressions/attribute_exists'); const LabelComparisonExp = require('../expressions/label_comparison'); const NoteFlatTextExp = require('../expressions/note_flat_text'); -const NoteContentFulltextExp = require('../expressions/note_content_fulltext.js'); +const NoteContentFulltextExp = require('../expressions/note_content_fulltext'); const OrderByAndLimitExp = require('../expressions/order_by_and_limit'); const AncestorExp = require("../expressions/ancestor"); const buildComparator = require('./build_comparator'); diff --git a/src/services/search/services/search.js b/src/services/search/services/search.js index 42897ebc5..dee2816c6 100644 --- a/src/services/search/services/search.js +++ b/src/services/search/services/search.js @@ -10,7 +10,7 @@ const becca = require('../../../becca/becca'); const beccaService = require('../../../becca/becca_service'); const utils = require('../../utils'); const log = require('../../log'); -const scriptService = require("../../script.js"); +const scriptService = require("../../script"); function searchFromNote(note) { let searchResultNoteIds, highlightedTokens; diff --git a/src/services/special_notes.js b/src/services/special_notes.js index 5e318bd11..da272cfe0 100644 --- a/src/services/special_notes.js +++ b/src/services/special_notes.js @@ -4,7 +4,7 @@ const becca = require("../becca/becca"); const noteService = require("./notes"); const cls = require("./cls"); const dateUtils = require("./date_utils"); -const log = require("./log.js"); +const log = require("./log"); const hiddenSubtreeService = require("./hidden_subtree"); function getInboxNote(date) {