mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	server-ts: errors/*.js -> .ts
This commit is contained in:
		@@ -1,5 +1,7 @@
 | 
			
		||||
class NotFoundError {
 | 
			
		||||
    constructor(message) {
 | 
			
		||||
    message: string;
 | 
			
		||||
 | 
			
		||||
    constructor(message: string) {
 | 
			
		||||
        this.message = message;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,5 +1,7 @@
 | 
			
		||||
class ValidationError {
 | 
			
		||||
    constructor(message) {
 | 
			
		||||
    message: string;
 | 
			
		||||
 | 
			
		||||
    constructor(message: string) {
 | 
			
		||||
        this.message = message;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
const becca = require('../../becca/becca.js');
 | 
			
		||||
const blobService = require('../../services/blob.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
const imageService = require("../../services/image.js");
 | 
			
		||||
 | 
			
		||||
function getAttachmentBlob(req) {
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ const log = require('../../services/log');
 | 
			
		||||
const attributeService = require('../../services/attributes.js');
 | 
			
		||||
const BAttribute = require('../../becca/entities/battribute.js');
 | 
			
		||||
const becca = require('../../becca/becca.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
 | 
			
		||||
function getEffectiveNoteAttributes(req) {
 | 
			
		||||
    const note = becca.getNote(req.params.noteId);
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ const becca = require('../../becca/becca.js');
 | 
			
		||||
const TaskContext = require('../../services/task_context.js');
 | 
			
		||||
const branchService = require('../../services/branches.js');
 | 
			
		||||
const log = require('../../services/log');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
const eventService = require("../../services/events.js");
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ const opmlExportService = require('../../services/export/opml.js');
 | 
			
		||||
const becca = require('../../becca/becca.js');
 | 
			
		||||
const TaskContext = require('../../services/task_context.js');
 | 
			
		||||
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;
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ const { Readable } = require('stream');
 | 
			
		||||
const chokidar = require('chokidar');
 | 
			
		||||
const ws = require('../../services/ws.js');
 | 
			
		||||
const becca = require('../../becca/becca.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
 | 
			
		||||
function updateFile(req) {
 | 
			
		||||
    const note = becca.getNoteOrThrow(req.params.noteId);
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ const becca = require('../../becca/becca.js');
 | 
			
		||||
const beccaLoader = require('../../becca/becca_loader.js');
 | 
			
		||||
const log = require('../../services/log');
 | 
			
		||||
const TaskContext = require('../../services/task_context.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
 | 
			
		||||
async function importNotesToBranch(req) {
 | 
			
		||||
    const {parentNoteId} = req.params;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ const utils = require('../../services/utils');
 | 
			
		||||
const log = require('../../services/log');
 | 
			
		||||
const TaskContext = require('../../services/task_context.js');
 | 
			
		||||
const becca = require('../../becca/becca.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
const blobService = require('../../services/blob.js');
 | 
			
		||||
 | 
			
		||||
function getNote(req) {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@
 | 
			
		||||
const optionService = require('../../services/options.js');
 | 
			
		||||
const log = require('../../services/log');
 | 
			
		||||
const searchService = require('../../services/search/services/search.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
 | 
			
		||||
// options allowed to be updated directly in the Options dialog
 | 
			
		||||
const ALLOWED_OPTIONS = new Set([
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
const passwordService = require('../../services/encryption/password.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
 | 
			
		||||
function changePassword(req) {
 | 
			
		||||
    if (passwordService.isPasswordSet()) {
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ const searchService = require('../../services/search/services/search.js');
 | 
			
		||||
const bulkActionService = require('../../services/bulk_actions.js');
 | 
			
		||||
const cls = require('../../services/cls');
 | 
			
		||||
const {formatAttrForSearch} = require('../../services/attribute_formatter.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
 | 
			
		||||
function searchFromNote(req) {
 | 
			
		||||
    const note = becca.getNoteOrThrow(req.params.noteId);
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
 | 
			
		||||
const becca = require('../../becca/becca.js');
 | 
			
		||||
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);
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ const log = require('../services/log');
 | 
			
		||||
const passwordService = require('../services/encryption/password.js');
 | 
			
		||||
const assetPath = require('../services/asset_path.js');
 | 
			
		||||
const appPath = require('../services/app_path.js');
 | 
			
		||||
const ValidationError = require('../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../errors/validation_error');
 | 
			
		||||
 | 
			
		||||
function loginPage(req, res) {
 | 
			
		||||
    res.render('login', {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,8 +13,8 @@ const csurf = require('csurf');
 | 
			
		||||
const { createPartialContentHandler } = require("express-partial-content");
 | 
			
		||||
const rateLimit = require("express-rate-limit");
 | 
			
		||||
const AbstractBeccaEntity = require('../becca/entities/abstract_becca_entity.js');
 | 
			
		||||
const NotFoundError = require('../errors/not_found_error.js');
 | 
			
		||||
const ValidationError = require('../errors/validation_error.js');
 | 
			
		||||
const NotFoundError = require('../errors/not_found_error');
 | 
			
		||||
const ValidationError = require('../errors/validation_error');
 | 
			
		||||
 | 
			
		||||
// page routes
 | 
			
		||||
const setupRoute = require('./setup.js');
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,7 @@ const RESOURCE_DIR = require('../../services/resource_dir.js').RESOURCE_DIR;
 | 
			
		||||
const archiver = require('archiver');
 | 
			
		||||
const log = require('../log');
 | 
			
		||||
const TaskContext = require('../task_context.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../../errors/validation_error');
 | 
			
		||||
const NoteMeta = require('../meta/note_meta.js');
 | 
			
		||||
const AttachmentMeta = require('../meta/attachment_meta.js');
 | 
			
		||||
const AttributeMeta = require('../meta/attribute_meta.js');
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ const BAttribute = require('../becca/entities/battribute.js');
 | 
			
		||||
const BAttachment = require('../becca/entities/battachment.js');
 | 
			
		||||
const dayjs = require("dayjs");
 | 
			
		||||
const htmlSanitizer = require('./html_sanitizer.js');
 | 
			
		||||
const ValidationError = require('../errors/validation_error.js');
 | 
			
		||||
const ValidationError = require('../errors/validation_error');
 | 
			
		||||
const noteTypesService = require('./note_types.js');
 | 
			
		||||
const fs = require("fs");
 | 
			
		||||
const ws = require('./ws.js');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user