From baea3bdcdddb8e3e526cea842b23adb52f71f0f7 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 2 Jan 2025 14:59:26 +0100 Subject: [PATCH 1/7] refactor(services): use Set instead of Arrays for faster lookups --- src/services/attributes.ts | 4 ++-- src/services/search/expressions/note_content_fulltext.ts | 6 +++--- src/services/search/services/parse.ts | 6 +++--- src/services/utils.ts | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/services/attributes.ts b/src/services/attributes.ts index 25b54724b..eff0f4697 100644 --- a/src/services/attributes.ts +++ b/src/services/attributes.ts @@ -9,7 +9,7 @@ import BUILTIN_ATTRIBUTES from "./builtin_attributes.js"; import BNote from "../becca/entities/bnote.js"; import { AttributeRow } from '../becca/entities/rows.js'; -const ATTRIBUTE_TYPES = ['label', 'relation']; +const ATTRIBUTE_TYPES = new Set(['label', 'relation']); function getNotesWithLabel(name: string, value?: string): BNote[] { const query = attributeFormatter.formatAttrForSearch({type: 'label', name, value}, value !== undefined); @@ -99,7 +99,7 @@ function getAttributeNames(type: string, nameLike: string) { } function isAttributeType(type: string): boolean { - return ATTRIBUTE_TYPES.includes(type); + return ATTRIBUTE_TYPES.has(type); } function isAttributeDangerous(type: string, name: string): boolean { diff --git a/src/services/search/expressions/note_content_fulltext.ts b/src/services/search/expressions/note_content_fulltext.ts index 9ede1a44a..415761f41 100644 --- a/src/services/search/expressions/note_content_fulltext.ts +++ b/src/services/search/expressions/note_content_fulltext.ts @@ -13,7 +13,7 @@ import utils from "../../utils.js"; import sql from "../../sql.js"; -const ALLOWED_OPERATORS = ['=', '!=', '*=*', '*=', '=*', '%=']; +const ALLOWED_OPERATORS = new Set(['=', '!=', '*=*', '*=', '=*', '%=']); const cachedRegexes: Record = {}; @@ -50,8 +50,8 @@ class NoteContentFulltextExp extends Expression { } execute(inputNoteSet: NoteSet, executionContext: {}, searchContext: SearchContext) { - if (!ALLOWED_OPERATORS.includes(this.operator)) { - searchContext.addError(`Note content can be searched only with operators: ${ALLOWED_OPERATORS.join(", ")}, operator ${this.operator} given.`); + if (!ALLOWED_OPERATORS.has(this.operator)) { + searchContext.addError(`Note content can be searched only with operators: ${Array.from(ALLOWED_OPERATORS).join(", ")}, operator ${this.operator} given.`); return inputNoteSet; } diff --git a/src/services/search/services/parse.ts b/src/services/search/services/parse.ts index 21187e112..2e51a65eb 100644 --- a/src/services/search/services/parse.ts +++ b/src/services/search/services/parse.ts @@ -44,7 +44,7 @@ function getFulltext(_tokens: TokenData[], searchContext: SearchContext) { } } -const OPERATORS = [ +const OPERATORS = new Set([ "=", "!=", "*=*", @@ -55,14 +55,14 @@ const OPERATORS = [ "<", "<=", "%=" -]; +]); function isOperator(token: TokenData) { if (Array.isArray(token)) { return false; } - return OPERATORS.includes(token.token); + return OPERATORS.has(token.token); } function getExpression(tokens: TokenData[], searchContext: SearchContext, level = 0) { diff --git a/src/services/utils.ts b/src/services/utils.ts index 887abde0b..867e6d659 100644 --- a/src/services/utils.ts +++ b/src/services/utils.ts @@ -152,19 +152,19 @@ function getContentDisposition(filename: string) { return `file; filename="${sanitizedFilename}"; filename*=UTF-8''${sanitizedFilename}`; } -const STRING_MIME_TYPES = [ +const STRING_MIME_TYPES = new Set([ "application/javascript", "application/x-javascript", "application/json", "application/x-sql", "image/svg+xml" -]; +]); function isStringNote(type: string | undefined, mime: string) { // render and book are string note in the sense that they are expected to contain empty string return (type && ["text", "code", "relationMap", "search", "render", "book", "mermaid", "canvas"].includes(type)) || mime.startsWith('text/') - || STRING_MIME_TYPES.includes(mime); + || STRING_MIME_TYPES.has(mime); } function quoteRegex(url: string) { From afb91f82e1c41e1804dd3ecfb38d6631f882a6ad Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 2 Jan 2025 16:26:23 +0100 Subject: [PATCH 2/7] refactor(sanitizeAttributeNames): directly export function no need to wrap the exported function in an object first --- src/becca/entities/battribute.ts | 2 +- src/routes/api/sender.ts | 6 +++--- src/services/consistency_checks.ts | 2 +- src/services/import/enex.ts | 4 ++-- src/services/sanitize_attribute_name.ts | 9 ++------- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/becca/entities/battribute.ts b/src/becca/entities/battribute.ts index 97df7b056..66ef83ca8 100644 --- a/src/becca/entities/battribute.ts +++ b/src/becca/entities/battribute.ts @@ -174,7 +174,7 @@ class BAttribute extends AbstractBeccaEntity { this.validate(); } - this.name = sanitizeAttributeName.sanitizeAttributeName(this.name); + this.name = sanitizeAttributeName(this.name); if (!this.value) { // null value isn't allowed diff --git a/src/routes/api/sender.ts b/src/routes/api/sender.ts index 22eea766d..705cac25e 100644 --- a/src/routes/api/sender.ts +++ b/src/routes/api/sender.ts @@ -3,7 +3,7 @@ import imageType from "image-type"; import imageService from "../../services/image.js"; import noteService from "../../services/notes.js"; -import sanitize_attribute_name from "../../services/sanitize_attribute_name.js"; +import sanitizeAttributeName from "../../services/sanitize_attribute_name.js"; import specialNotesService from "../../services/special_notes.js"; import { Request } from 'express'; @@ -44,7 +44,7 @@ async function uploadImage(req: Request) { const labels = JSON.parse(labelsStr); for (const { name, value } of labels) { - note.setLabel(sanitize_attribute_name.sanitizeAttributeName(name), value); + note.setLabel(sanitizeAttributeName(name), value); } } @@ -73,7 +73,7 @@ function saveNote(req: Request) { if (req.body.labels) { for (const { name, value } of req.body.labels) { - note.setLabel(sanitize_attribute_name.sanitizeAttributeName(name), value); + note.setLabel(sanitizeAttributeName(name), value); } } diff --git a/src/services/consistency_checks.ts b/src/services/consistency_checks.ts index fe37c7c15..fa1cec21d 100644 --- a/src/services/consistency_checks.ts +++ b/src/services/consistency_checks.ts @@ -754,7 +754,7 @@ class ConsistencyChecks { const attrNames = sql.getColumn(`SELECT DISTINCT name FROM attributes`); for (const origName of attrNames) { - const fixedName = sanitizeAttributeName.sanitizeAttributeName(origName); + const fixedName = sanitizeAttributeName(origName); if (fixedName !== origName) { if (this.autoFix) { diff --git a/src/services/import/enex.ts b/src/services/import/enex.ts index 071b66cdb..f0805b2fc 100644 --- a/src/services/import/enex.ts +++ b/src/services/import/enex.ts @@ -151,7 +151,7 @@ function importEnex(taskContext: TaskContext, file: File, parentNote: BNote): Pr labelName = 'pageUrl'; } - labelName = sanitizeAttributeName.sanitizeAttributeName(labelName || ""); + labelName = sanitizeAttributeName(labelName || ""); if (note.attributes) { note.attributes.push({ @@ -202,7 +202,7 @@ function importEnex(taskContext: TaskContext, file: File, parentNote: BNote): Pr } else if (currentTag === 'tag' && note.attributes) { note.attributes.push({ type: 'label', - name: sanitizeAttributeName.sanitizeAttributeName(text), + name: sanitizeAttributeName(text), value: '' }) } diff --git a/src/services/sanitize_attribute_name.ts b/src/services/sanitize_attribute_name.ts index 635588f80..075ccfd03 100644 --- a/src/services/sanitize_attribute_name.ts +++ b/src/services/sanitize_attribute_name.ts @@ -1,4 +1,4 @@ -function sanitizeAttributeName(origName: string) { +export default function sanitizeAttributeName(origName: string) { let fixedName: string; if (origName === '') { @@ -10,9 +10,4 @@ function sanitizeAttributeName(origName: string) { } return fixedName; -} - - -export default { - sanitizeAttributeName -}; +} \ No newline at end of file From 1053da3e405b1a81c3a64e2fcaa60c091e15038b Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 2 Jan 2025 16:38:51 +0100 Subject: [PATCH 3/7] refactor(sanitizeAttributeNames): use a ternary operator --- src/services/sanitize_attribute_name.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/services/sanitize_attribute_name.ts b/src/services/sanitize_attribute_name.ts index 075ccfd03..b1f0e6579 100644 --- a/src/services/sanitize_attribute_name.ts +++ b/src/services/sanitize_attribute_name.ts @@ -1,13 +1,8 @@ export default function sanitizeAttributeName(origName: string) { - let fixedName: string; - - if (origName === '') { - fixedName = "unnamed"; - } - else { + const fixedName = (origName === '') + ? "unnamed" + : origName.replace(/[^\p{L}\p{N}_:]/ug, "_"); // any not allowed character should be replaced with underscore - fixedName = origName.replace(/[^\p{L}\p{N}_:]/ug, "_"); - } return fixedName; } \ No newline at end of file From d798388026798ab99211da9eabe86c7a7f7facb4 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 2 Jan 2025 18:16:13 +0100 Subject: [PATCH 4/7] test(sanitizeAttributeNames): add basic test --- spec-es6/sanitize_attribute_name.spec.ts | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 spec-es6/sanitize_attribute_name.spec.ts diff --git a/spec-es6/sanitize_attribute_name.spec.ts b/spec-es6/sanitize_attribute_name.spec.ts new file mode 100644 index 000000000..fa01a4690 --- /dev/null +++ b/spec-es6/sanitize_attribute_name.spec.ts @@ -0,0 +1,43 @@ +import sanitizeAttributeName from "../src/services/sanitize_attribute_name" +import { describe, it, execute, expect } from "./mini_test"; + +// fn value, expected value +const testCases: [fnValue: string, expectedValue: string][] = [ + ["testName", "testName"], + ["test_name", "test_name"], + ["test with space", "test_with_space"], + ["test:with:colon", "test:with:colon"], + + // numbers + ["123456", "123456"], + ["123:456", "123:456"], + ["123456 abc", "123456_abc"], + + // non-latin characters + ["ε", "ε"], + ["attribute ε", "attribute_ε"], + + + // special characters + ["test/name", "test_name"], + ["test%name", "test_name"], + ["\/", "_"], + + // empty string + ["", "unnamed"], +] + + + +describe("sanitizeAttributeName unit tests", () => { + + testCases.forEach(testCase => { + return it(`'${testCase[0]}' should return '${testCase[1]}'`, () => { + const [value, expected] = testCase; + const actual = sanitizeAttributeName(value); + expect(actual).toEqual(expected); + }) + }) +}) + +execute() \ No newline at end of file From 13235a25b1e26b13fa7dc999ac9db9b043d32e51 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 2 Jan 2025 18:45:41 +0100 Subject: [PATCH 5/7] refactor(utils): add isMac and isWindows as util func --- src/services/utils.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/services/utils.ts b/src/services/utils.ts index 040cefc02..ddb51609d 100644 --- a/src/services/utils.ts +++ b/src/services/utils.ts @@ -332,6 +332,14 @@ export function getResourceDir() { } } +export function isMac() { + return process.platform === "darwin"; +} + +export function isWindows() { + return process.platform === "win32"; +} + export default { randomSecureToken, randomString, @@ -365,5 +373,7 @@ export default { hashedBlobId, toMap, isString, - getResourceDir + getResourceDir, + isMac, + isWindows }; From ac77d20aaf0559421d2aac6ec20d15b5eb8d625c Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 2 Jan 2025 18:47:41 +0100 Subject: [PATCH 6/7] refactor: use isMac and isWindows util funcs --- src/services/keyboard_actions.ts | 4 ++-- src/services/log.ts | 3 ++- src/services/options_init.ts | 4 ++-- src/services/window.ts | 10 ++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/services/keyboard_actions.ts b/src/services/keyboard_actions.ts index 00f5764c8..5e9d132b8 100644 --- a/src/services/keyboard_actions.ts +++ b/src/services/keyboard_actions.ts @@ -2,11 +2,11 @@ import optionService from "./options.js"; import log from "./log.js"; -import { isElectron as getIsElectron } from "./utils.js"; +import { isElectron as getIsElectron, isMac as getIsMac } from "./utils.js"; import { KeyboardShortcut } from './keyboard_actions_interface.js'; import { t } from "i18next"; -const isMac = process.platform === "darwin"; +const isMac = getIsMac(); const isElectron = getIsElectron(); function getDefaultKeyboardActions() { diff --git a/src/services/log.ts b/src/services/log.ts index 9bd97a2a7..cb207e3a6 100644 --- a/src/services/log.ts +++ b/src/services/log.ts @@ -4,6 +4,7 @@ import { Request, Response } from "express"; import fs from "fs"; import dataDir from "./data_dir.js"; import cls from "./cls.js"; +import { isWindows } from "./utils.js"; if (!fs.existsSync(dataDir.LOG_DIR)) { fs.mkdirSync(dataDir.LOG_DIR, 0o700); @@ -16,7 +17,7 @@ const MINUTE = 60 * SECOND; const HOUR = 60 * MINUTE; const DAY = 24 * HOUR; -const NEW_LINE = process.platform === "win32" ? '\r\n' : '\n'; +const NEW_LINE = isWindows() ? '\r\n' : '\n'; let todaysMidnight!: Date; diff --git a/src/services/options_init.ts b/src/services/options_init.ts index 2c86fd933..1835f55b2 100644 --- a/src/services/options_init.ts +++ b/src/services/options_init.ts @@ -1,7 +1,7 @@ import optionService from "./options.js"; import type { OptionMap } from "./options.js"; import appInfo from "./app_info.js"; -import { randomSecureToken } from "./utils.js"; +import { randomSecureToken, isWindows } from "./utils.js"; import log from "./log.js"; import dateUtils from "./date_utils.js"; import keyboardActions from "./keyboard_actions.js"; @@ -72,7 +72,7 @@ const defaultOptions: DefaultOption[] = [ { name: 'revisionSnapshotTimeInterval', value: '600', isSynced: true }, { name: 'revisionSnapshotNumberLimit', value: '-1', isSynced: true }, { name: 'protectedSessionTimeout', value: '600', isSynced: true }, - { name: 'zoomFactor', value: process.platform === "win32" ? '0.9' : '1.0', isSynced: false }, + { name: 'zoomFactor', value: isWindows() ? '0.9' : '1.0', isSynced: false }, { name: 'overrideThemeFonts', value: 'false', isSynced: false }, { name: 'mainFontFamily', value: 'theme', isSynced: false }, { name: 'mainFontSize', value: '100', isSynced: false }, diff --git a/src/services/window.ts b/src/services/window.ts index 2f5b345db..3d81d3e1d 100644 --- a/src/services/window.ts +++ b/src/services/window.ts @@ -9,6 +9,7 @@ import cls from "./cls.js"; import keyboardActionsService from "./keyboard_actions.js"; import remoteMain from "@electron/remote/main/index.js"; import { App, BrowserWindow, BrowserWindowConstructorOptions, WebContents, ipcMain } from 'electron'; +import { isMac, isWindows } from "./utils.js"; import { fileURLToPath } from "url"; import { dirname } from "path"; @@ -115,14 +116,11 @@ async function createMainWindow(app: App) { function getWindowExtraOpts() { const extraOpts: Partial = {}; - const isMac = (process.platform === "darwin"); - const isWindows = (process.platform === "win32"); - if (!optionService.getOptionBool('nativeTitleBarVisible')) { - if (isMac) { + if (isMac()) { extraOpts.titleBarStyle = "hiddenInset"; extraOpts.titleBarOverlay = true; - } else if (isWindows) { + } else if (isWindows()) { extraOpts.titleBarStyle = "hidden"; extraOpts.titleBarOverlay = true; } else { @@ -132,7 +130,7 @@ function getWindowExtraOpts() { } // Window effects (Mica) - if (optionService.getOptionBool('backgroundEffects') && isWindows) { + if (optionService.getOptionBool('backgroundEffects') && isWindows()) { extraOpts.backgroundMaterial = "auto"; } From 9d48f805512a015e1434a425fbba2d7495655d10 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 2 Jan 2025 20:48:44 +0100 Subject: [PATCH 7/7] chore(deps): remove unused 'request' --- package-lock.json | 335 +--------------------------------------------- package.json | 3 +- 2 files changed, 4 insertions(+), 334 deletions(-) diff --git a/package-lock.json b/package-lock.json index e7de42500..d723638e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -79,7 +79,6 @@ "rand-token": "1.0.1", "react": "18.3.1", "react-dom": "18.3.1", - "request": "2.88.2", "safe-compare": "1.1.4", "sanitize-filename": "1.6.3", "sanitize-html": "2.14.0", @@ -5343,15 +5342,6 @@ "node": ">= 6" } }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "license": "MIT", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, "node_modules/asn1.js": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", @@ -5364,15 +5354,6 @@ "safer-buffer": "^2.1.0" } }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, "node_modules/async": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", @@ -5444,21 +5425,6 @@ "node": ">=6.0.0" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", - "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", - "license": "MIT" - }, "node_modules/axios": { "version": "1.7.9", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", @@ -5526,15 +5492,6 @@ ], "license": "MIT" }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "license": "BSD-3-Clause", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/better-sqlite3": { "version": "11.7.0", "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.7.0.tgz", @@ -6224,12 +6181,6 @@ "node": ">=12" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", - "license": "Apache-2.0" - }, "node_modules/catharsis": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", @@ -7647,18 +7598,6 @@ "lodash-es": "^4.17.21" } }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/data-urls": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", @@ -8052,22 +7991,6 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "license": "MIT" }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", - "license": "MIT", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/ecc-jsbn/node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "license": "MIT" - }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -9723,12 +9646,6 @@ "node": ">=4" } }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "license": "MIT" - }, "node_modules/extend-shallow": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", @@ -9799,15 +9716,6 @@ "fd-slicer": "~1.1.0" } }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "engines": [ - "node >=0.6.0" - ], - "license": "MIT" - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -10230,15 +10138,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, "node_modules/form-data": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", @@ -10641,15 +10540,6 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/gifwrap": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.10.1.tgz", @@ -10869,29 +10759,6 @@ "integrity": "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg==", "license": "MIT" }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "license": "ISC", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "license": "MIT", - "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -11257,21 +11124,6 @@ "node": ">= 14" } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, "node_modules/http2-wrapper": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", @@ -12004,12 +11856,6 @@ "node": ">=0.10.0" } }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "license": "MIT" - }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -12377,12 +12223,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "license": "(AFL-2.1 OR BSD-3-Clause)" - }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -12399,7 +12239,9 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "license": "ISC" + "dev": true, + "license": "ISC", + "optional": true }, "node_modules/jsonfile": { "version": "4.0.0", @@ -12427,21 +12269,6 @@ "integrity": "sha512-sIpbpz5eMVM+vV+MQzFCidlaa1RsknrQs6LOTKYDjYUDdTAi2AN2bFi94TxB33TifcIsRNV1jebcaxg0tCoPzg==", "license": "(MIT OR GPL-2.0)" }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "license": "MIT", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, "node_modules/junk": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/junk/-/junk-3.1.0.tgz", @@ -13957,15 +13784,6 @@ "integrity": "sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ==", "license": "MIT" }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -14575,12 +14393,6 @@ "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", "license": "MIT" }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "license": "MIT" - }, "node_modules/phin": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz", @@ -14982,18 +14794,6 @@ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", "license": "MIT" }, - "node_modules/psl": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", - "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", - "license": "MIT", - "dependencies": { - "punycode": "^2.3.1" - }, - "funding": { - "url": "https://github.com/sponsors/lupomontero" - } - }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", @@ -15597,84 +15397,6 @@ "node": ">=0.10" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "license": "Apache-2.0", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request/node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/request/node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/request/node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "license": "BSD-3-Clause", - "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "license": "MIT", - "bin": { - "uuid": "bin/uuid" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -16799,37 +16521,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/sshpk": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", - "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", - "license": "MIT", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sshpk/node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "license": "MIT" - }, "node_modules/ssri": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", @@ -17841,12 +17532,6 @@ "@mixmark-io/domino": "^2.2.0" } }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "license": "Unlicense" - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -18268,20 +17953,6 @@ "node": ">= 0.8" } }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "node_modules/vscode-jsonrpc": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", diff --git a/package.json b/package.json index 284b40456..fae522558 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "@highlightjs/cdn-assets": "11.11.1", "@mermaid-js/layout-elk": "0.1.7", "@mind-elixir/node-menu": "1.0.3", - "@triliumnext/express-partial-content": "1.0.1", + "@triliumnext/express-partial-content": "1.0.1", "archiver": "7.0.1", "async-mutex": "0.5.0", "autocomplete.js": "0.38.1", @@ -122,7 +122,6 @@ "rand-token": "1.0.1", "react": "18.3.1", "react-dom": "18.3.1", - "request": "2.88.2", "safe-compare": "1.1.4", "sanitize-filename": "1.6.3", "sanitize-html": "2.14.0",