mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Merge branch 'develop' of ssh://github.com/TriliumNext/Notes into develop
This commit is contained in:
commit
3466786a96
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@ -4,6 +4,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- 'develop'
|
- 'develop'
|
||||||
- 'feature/update*'
|
- 'feature/update*'
|
||||||
|
- 'feature/server_esm*'
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
|
|
||||||
|
17
.vscode/tasks.json
vendored
Normal file
17
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"type": "npm",
|
||||||
|
"script": "errors",
|
||||||
|
"problemMatcher": "$tsc-watch",
|
||||||
|
"isBackground": true,
|
||||||
|
"presentation": {
|
||||||
|
"revealProblems": "never"
|
||||||
|
},
|
||||||
|
"runOptions": {
|
||||||
|
"runOn": "folderOpen"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
bin/better-sqlite3/linux-desktop-better_sqlite3.node
Normal file → Executable file
BIN
bin/better-sqlite3/linux-desktop-better_sqlite3.node
Normal file → Executable file
Binary file not shown.
BIN
bin/better-sqlite3/linux-server-better_sqlite3.node
Normal file → Executable file
BIN
bin/better-sqlite3/linux-server-better_sqlite3.node
Normal file → Executable file
Binary file not shown.
BIN
bin/better-sqlite3/mac-arm64-better_sqlite3.node
Normal file → Executable file
BIN
bin/better-sqlite3/mac-arm64-better_sqlite3.node
Normal file → Executable file
Binary file not shown.
BIN
bin/better-sqlite3/mac-x64-better_sqlite3.node
Normal file → Executable file
BIN
bin/better-sqlite3/mac-x64-better_sqlite3.node
Normal file → Executable file
Binary file not shown.
38
bin/better-sqlite3/update.sh
Executable file
38
bin/better-sqlite3/update.sh
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
ELECTRON_VERSION="electron-v125"
|
||||||
|
NODE_VERSION="node-v115"
|
||||||
|
|
||||||
|
if ! command -v jq &> /dev/null; then
|
||||||
|
echo "Missing command: jq"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
script_dir=$(realpath $(dirname $0))
|
||||||
|
cd "$script_dir"
|
||||||
|
BETTER_SQLITE3_VERSION=$(jq -r '.dependencies.["better-sqlite3"]' ../../package.json | grep -oP "\d+\.\d+\.\d+")
|
||||||
|
|
||||||
|
if [ -z $BETTER_SQLITE3_VERSION ]; then
|
||||||
|
echo "Unable to determine better-sqlite3 version."
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Version: $BETTER_SQLITE3_VERSION"
|
||||||
|
|
||||||
|
function download() {
|
||||||
|
version="$1"
|
||||||
|
platform="$2"
|
||||||
|
dest_name="$3"
|
||||||
|
url=https://github.com/WiseLibs/better-sqlite3/releases/download/v${BETTER_SQLITE3_VERSION}/better-sqlite3-v${BETTER_SQLITE3_VERSION}-${version}-${platform}.tar.gz
|
||||||
|
temp_file="temp.tar.gz"
|
||||||
|
curl -L "$url" -o "$temp_file"
|
||||||
|
tar -xzvf "$temp_file"
|
||||||
|
mv build/Release/better_sqlite3.node "$dest_name-better_sqlite3.node"
|
||||||
|
rm -rf build
|
||||||
|
rm -f "$temp_file"
|
||||||
|
}
|
||||||
|
|
||||||
|
download $NODE_VERSION "linux-x64" "linux-server"
|
||||||
|
download $ELECTRON_VERSION "linux-x64" "linux-desktop"
|
||||||
|
download $ELECTRON_VERSION "win32-x64" "win"
|
||||||
|
download $ELECTRON_VERSION "darwin-x64" "mac-x64"
|
||||||
|
download $ELECTRON_VERSION "darwin-arm64" "mac-arm64"
|
Binary file not shown.
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
|
|
||||||
if ! command -v dpkg-deb &> /dev/null; then
|
if ! command -v dpkg-deb &> /dev/null; then
|
||||||
echo "Missing command: dpkg-deb"
|
echo "Missing command: dpkg-deb"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
|
|
||||||
VERSION=`jq -r ".version" package.json`
|
VERSION=`jq -r ".version" package.json`
|
||||||
SERIES=${VERSION:0:4}-latest
|
SERIES=${VERSION:0:4}-latest
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
|
|
||||||
if ! command -v jq &> /dev/null; then
|
if ! command -v jq &> /dev/null; then
|
||||||
echo "Missing command: jq"
|
echo "Missing command: jq"
|
||||||
exit 1
|
exit 1
|
||||||
@ -24,8 +26,6 @@ SRC_DIR=./dist/trilium-linux-x64-src
|
|||||||
|
|
||||||
[ "$1" != "DONTCOPY" ] && ./bin/copy-trilium.sh "$SRC_DIR"
|
[ "$1" != "DONTCOPY" ] && ./bin/copy-trilium.sh "$SRC_DIR"
|
||||||
|
|
||||||
rm -r "$SRC_DIR"/src/public/app-dist/*.mobile.*
|
|
||||||
|
|
||||||
echo "Copying required linux-x64 binaries"
|
echo "Copying required linux-x64 binaries"
|
||||||
cp -r bin/better-sqlite3/linux-desktop-better_sqlite3.node "$SRC_DIR"/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
cp -r bin/better-sqlite3/linux-desktop-better_sqlite3.node "$SRC_DIR"/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||||
|
|
||||||
@ -55,4 +55,4 @@ pushd dist
|
|||||||
tar cJf "trilium-linux-x64-${VERSION}.tar.xz" trilium-linux-x64
|
tar cJf "trilium-linux-x64-${VERSION}.tar.xz" trilium-linux-x64
|
||||||
popd
|
popd
|
||||||
|
|
||||||
bin/build-debian.sh
|
#bin/build-debian.sh
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
|
|
||||||
SRC_DIR=./dist/trilium-mac-arm64-src
|
SRC_DIR=./dist/trilium-mac-arm64-src
|
||||||
|
|
||||||
if [ "$1" != "DONTCOPY" ]
|
if [ "$1" != "DONTCOPY" ]
|
||||||
@ -11,8 +13,6 @@ echo "Copying required mac arm64 binaries"
|
|||||||
|
|
||||||
cp -r bin/better-sqlite3/mac-arm64-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
cp -r bin/better-sqlite3/mac-arm64-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||||
|
|
||||||
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
|
|
||||||
|
|
||||||
echo "Packaging mac arm64 electron build"
|
echo "Packaging mac arm64 electron build"
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=arm64 --overwrite --icon=images/app-icons/mac/icon.icns
|
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=arm64 --overwrite --icon=images/app-icons/mac/icon.icns
|
||||||
@ -34,5 +34,4 @@ VERSION=`jq -r ".version" package.json`
|
|||||||
|
|
||||||
cd dist
|
cd dist
|
||||||
|
|
||||||
rm trilium-mac-arm64-${VERSION}.zip
|
|
||||||
zip -r9 --symlinks trilium-mac-arm64-${VERSION}.zip trilium-mac-arm64
|
zip -r9 --symlinks trilium-mac-arm64-${VERSION}.zip trilium-mac-arm64
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
|
|
||||||
SRC_DIR=./dist/trilium-mac-x64-src
|
SRC_DIR=./dist/trilium-mac-x64-src
|
||||||
|
|
||||||
if [ "$1" != "DONTCOPY" ]
|
if [ "$1" != "DONTCOPY" ]
|
||||||
@ -11,8 +13,6 @@ echo "Copying required mac x64 binaries"
|
|||||||
|
|
||||||
cp -r bin/better-sqlite3/mac-x64-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
cp -r bin/better-sqlite3/mac-x64-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||||
|
|
||||||
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
|
|
||||||
|
|
||||||
echo "Packaging mac x64 electron build"
|
echo "Packaging mac x64 electron build"
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns
|
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=darwin --arch=x64 --overwrite --icon=images/app-icons/mac/icon.icns
|
||||||
@ -34,5 +34,4 @@ VERSION=`jq -r ".version" package.json`
|
|||||||
|
|
||||||
cd dist
|
cd dist
|
||||||
|
|
||||||
rm trilium-mac-x64-${VERSION}.zip
|
|
||||||
zip -r9 --symlinks trilium-mac-x64-${VERSION}.zip trilium-mac-x64
|
zip -r9 --symlinks trilium-mac-x64-${VERSION}.zip trilium-mac-x64
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
|
|
||||||
PKG_DIR=dist/trilium-linux-x64-server
|
PKG_DIR=dist/trilium-linux-x64-server
|
||||||
NODE_VERSION=20.15.1
|
NODE_VERSION=20.15.1
|
||||||
|
|
||||||
@ -20,7 +22,6 @@ rm -r $PKG_DIR/node/lib/node_modules/npm
|
|||||||
rm -r $PKG_DIR/node/include/node
|
rm -r $PKG_DIR/node/include/node
|
||||||
|
|
||||||
rm -r $PKG_DIR/node_modules/electron*
|
rm -r $PKG_DIR/node_modules/electron*
|
||||||
rm -r $PKG_DIR/webpack*
|
|
||||||
rm -r $PKG_DIR/electron.js
|
rm -r $PKG_DIR/electron.js
|
||||||
|
|
||||||
cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
cp -r bin/better-sqlite3/linux-server-better_sqlite3.node $PKG_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
|
|
||||||
if ! command -v wine &> /dev/null; then
|
if ! command -v wine &> /dev/null; then
|
||||||
echo "Missing command: wine"
|
echo "Missing command: wine"
|
||||||
exit 1
|
exit 1
|
||||||
@ -16,8 +18,6 @@ echo "Copying required windows binaries"
|
|||||||
|
|
||||||
cp -r bin/better-sqlite3/win-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
cp -r bin/better-sqlite3/win-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
|
||||||
|
|
||||||
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
|
|
||||||
|
|
||||||
echo "Packaging windows x64 electron build"
|
echo "Packaging windows x64 electron build"
|
||||||
|
|
||||||
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico
|
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=win32 --arch=x64 --overwrite --icon=images/app-icons/win/icon.ico
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
|
|
||||||
if ! command -v jq &> /dev/null; then
|
if ! command -v jq &> /dev/null; then
|
||||||
echo "Missing command: jq"
|
echo "Missing command: jq"
|
||||||
exit 1
|
exit 1
|
||||||
@ -40,7 +42,6 @@ cp -r $SRC_DIR ./dist/trilium-windows-x64-src
|
|||||||
cp -r $SRC_DIR ./dist/trilium-mac-x64-src
|
cp -r $SRC_DIR ./dist/trilium-mac-x64-src
|
||||||
cp -r $SRC_DIR ./dist/trilium-mac-arm64-src
|
cp -r $SRC_DIR ./dist/trilium-mac-arm64-src
|
||||||
|
|
||||||
set -e
|
|
||||||
bin/build-win-x64.sh DONTCOPY
|
bin/build-win-x64.sh DONTCOPY
|
||||||
|
|
||||||
bin/build-mac-x64.sh DONTCOPY
|
bin/build-mac-x64.sh DONTCOPY
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e # Fail on any command error
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
|
|
||||||
if [[ $# -eq 0 ]] ; then
|
if [[ $# -eq 0 ]] ; then
|
||||||
|
@ -16,7 +16,7 @@ function getGitRevision() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const output = `\
|
const output = `\
|
||||||
export = {
|
export default {
|
||||||
buildDate: "${getBuildDate()}",
|
buildDate: "${getBuildDate()}",
|
||||||
buildRevision: "${getGitRevision()}"
|
buildRevision: "${getGitRevision()}"
|
||||||
};
|
};
|
||||||
|
20
electron.ts
20
electron.ts
@ -1,22 +1,24 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import electron = require("electron");
|
import electron from "electron";
|
||||||
import sqlInit = require("./src/services/sql_init");
|
import electronDebug from "electron-debug";
|
||||||
import appIconService = require("./src/services/app_icon");
|
import electronDl from "electron-dl";
|
||||||
import windowService = require("./src/services/window");
|
import sqlInit from "./src/services/sql_init.js";
|
||||||
import tray = require("./src/services/tray");
|
import appIconService from "./src/services/app_icon.js";
|
||||||
|
import windowService from "./src/services/window.js";
|
||||||
|
import tray from "./src/services/tray.js";
|
||||||
|
|
||||||
// Prevent Trilium starting twice on first install and on uninstall for the Windows installer.
|
// Prevent Trilium starting twice on first install and on uninstall for the Windows installer.
|
||||||
if (require('electron-squirrel-startup')) {
|
if ((await import('electron-squirrel-startup')).default) {
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds debug features like hotkeys for triggering dev tools and reload
|
// Adds debug features like hotkeys for triggering dev tools and reload
|
||||||
require("electron-debug")();
|
electronDebug();
|
||||||
|
|
||||||
appIconService.installLocalAppIcon();
|
appIconService.installLocalAppIcon();
|
||||||
|
|
||||||
require("electron-dl")({ saveAs: true });
|
electronDl({ saveAs: true });
|
||||||
|
|
||||||
// needed for excalidraw export https://github.com/zadam/trilium/issues/4271
|
// needed for excalidraw export https://github.com/zadam/trilium/issues/4271
|
||||||
electron.app.commandLine.appendSwitch(
|
electron.app.commandLine.appendSwitch(
|
||||||
@ -65,4 +67,4 @@ electron.app.on("will-quit", () => {
|
|||||||
// this is to disable electron warning spam in the dev console (local development only)
|
// this is to disable electron warning spam in the dev console (local development only)
|
||||||
process.env["ELECTRON_DISABLE_SECURITY_WARNINGS"] = "true";
|
process.env["ELECTRON_DISABLE_SECURITY_WARNINGS"] = "true";
|
||||||
|
|
||||||
require("./src/www.js");
|
await import('./src/www.js');
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"restartable": "rs",
|
"restartable": "rs",
|
||||||
"ignore": [".git", "node_modules/**/node_modules", "src/public/"],
|
"ignore": [".git", "node_modules/**/node_modules", "src/public/"],
|
||||||
"verbose": false,
|
"verbose": false,
|
||||||
"exec": "ts-node",
|
"exec": "tsx",
|
||||||
"watch": ["src/"],
|
"watch": ["src/"],
|
||||||
"signal": "SIGTERM",
|
"signal": "SIGTERM",
|
||||||
"env": {
|
"env": {
|
||||||
|
246
package-lock.json
generated
246
package-lock.json
generated
@ -12,10 +12,11 @@
|
|||||||
"@braintree/sanitize-url": "^7.1.0",
|
"@braintree/sanitize-url": "^7.1.0",
|
||||||
"@electron/remote": "2.1.2",
|
"@electron/remote": "2.1.2",
|
||||||
"@excalidraw/excalidraw": "^0.17.6",
|
"@excalidraw/excalidraw": "^0.17.6",
|
||||||
|
"@types/electron-squirrel-startup": "^1.0.2",
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
"async-mutex": "^0.5.0",
|
"async-mutex": "^0.5.0",
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
"better-sqlite3": "8.5.0",
|
"better-sqlite3": "^11.1.2",
|
||||||
"boxicons": "2.1.4",
|
"boxicons": "2.1.4",
|
||||||
"chokidar": "3.6.0",
|
"chokidar": "3.6.0",
|
||||||
"cls-hooked": "4.2.2",
|
"cls-hooked": "4.2.2",
|
||||||
@ -58,7 +59,7 @@
|
|||||||
"mermaid": "^10.9.1",
|
"mermaid": "^10.9.1",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"multer": "1.4.5-lts.1",
|
"multer": "1.4.5-lts.1",
|
||||||
"node-abi": "3.56.0",
|
"node-abi": "^3.65.0",
|
||||||
"normalize-strings": "1.1.1",
|
"normalize-strings": "1.1.1",
|
||||||
"panzoom": "9.4.3",
|
"panzoom": "9.4.3",
|
||||||
"print-this": "2.0.0",
|
"print-this": "2.0.0",
|
||||||
@ -97,6 +98,7 @@
|
|||||||
"@types/compression": "^1.7.5",
|
"@types/compression": "^1.7.5",
|
||||||
"@types/cookie-parser": "^1.4.7",
|
"@types/cookie-parser": "^1.4.7",
|
||||||
"@types/csurf": "^1.11.5",
|
"@types/csurf": "^1.11.5",
|
||||||
|
"@types/debounce": "^1.2.4",
|
||||||
"@types/ejs": "^3.1.5",
|
"@types/ejs": "^3.1.5",
|
||||||
"@types/escape-html": "^1.0.4",
|
"@types/escape-html": "^1.0.4",
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
@ -107,19 +109,19 @@
|
|||||||
"@types/jsdom": "^21.1.6",
|
"@types/jsdom": "^21.1.6",
|
||||||
"@types/mime-types": "^2.1.4",
|
"@types/mime-types": "^2.1.4",
|
||||||
"@types/multer": "^1.4.11",
|
"@types/multer": "^1.4.11",
|
||||||
"@types/node": "^20.11.19",
|
|
||||||
"@types/safe-compare": "^1.1.2",
|
"@types/safe-compare": "^1.1.2",
|
||||||
"@types/sanitize-html": "^2.11.0",
|
"@types/sanitize-html": "^2.11.0",
|
||||||
"@types/sax": "^1.2.7",
|
"@types/sax": "^1.2.7",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
"@types/serve-favicon": "^2.5.7",
|
"@types/serve-favicon": "^2.5.7",
|
||||||
|
"@types/session-file-store": "^1.2.5",
|
||||||
"@types/stream-throttle": "^0.1.4",
|
"@types/stream-throttle": "^0.1.4",
|
||||||
"@types/tmp": "^0.2.6",
|
"@types/tmp": "^0.2.6",
|
||||||
"@types/turndown": "^5.0.4",
|
"@types/turndown": "^5.0.4",
|
||||||
"@types/ws": "^8.5.10",
|
"@types/ws": "^8.5.10",
|
||||||
"@types/xml2js": "^0.4.14",
|
"@types/xml2js": "^0.4.14",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"electron": "25.9.8",
|
"electron": "^31.2.1",
|
||||||
"electron-packager": "17.1.2",
|
"electron-packager": "17.1.2",
|
||||||
"electron-rebuild": "3.2.9",
|
"electron-rebuild": "3.2.9",
|
||||||
"esm": "3.2.25",
|
"esm": "3.2.25",
|
||||||
@ -131,6 +133,7 @@
|
|||||||
"rimraf": "^6.0.1",
|
"rimraf": "^6.0.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"tslib": "^2.6.2",
|
"tslib": "^2.6.2",
|
||||||
|
"tsx": "^4.16.2",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"webpack": "^5.93.0",
|
"webpack": "^5.93.0",
|
||||||
"webpack-cli": "5.1.4"
|
"webpack-cli": "5.1.4"
|
||||||
@ -1388,6 +1391,22 @@
|
|||||||
"node": ">=14.14"
|
"node": ">=14.14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@esbuild/win32-x64": {
|
||||||
|
"version": "0.21.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",
|
||||||
|
"integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@excalidraw/excalidraw": {
|
"node_modules/@excalidraw/excalidraw": {
|
||||||
"version": "0.17.6",
|
"version": "0.17.6",
|
||||||
"resolved": "https://registry.npmjs.org/@excalidraw/excalidraw/-/excalidraw-0.17.6.tgz",
|
"resolved": "https://registry.npmjs.org/@excalidraw/excalidraw/-/excalidraw-0.17.6.tgz",
|
||||||
@ -2207,6 +2226,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.3.tgz",
|
||||||
"integrity": "sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw=="
|
"integrity": "sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/debounce": {
|
||||||
|
"version": "1.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/debounce/-/debounce-1.2.4.tgz",
|
||||||
|
"integrity": "sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/@types/debug": {
|
"node_modules/@types/debug": {
|
||||||
"version": "4.1.9",
|
"version": "4.1.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz",
|
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.9.tgz",
|
||||||
@ -2221,6 +2246,11 @@
|
|||||||
"integrity": "sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==",
|
"integrity": "sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/electron-squirrel-startup": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/electron-squirrel-startup/-/electron-squirrel-startup-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-AzxnvBzNh8K/0SmxMmZtpJf1/IWoGXLP+pQDuUaVkPyotI8ryvAtBSqgxR/qOSvxWHYWrxkeNsJ+Ca5xOuUxJQ=="
|
||||||
|
},
|
||||||
"node_modules/@types/escape-html": {
|
"node_modules/@types/escape-html": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/escape-html/-/escape-html-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/escape-html/-/escape-html-1.0.4.tgz",
|
||||||
@ -2446,9 +2476,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.14.10",
|
"version": "20.14.11",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz",
|
||||||
"integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==",
|
"integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~5.26.4"
|
"undici-types": "~5.26.4"
|
||||||
}
|
}
|
||||||
@ -2616,6 +2646,16 @@
|
|||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/session-file-store": {
|
||||||
|
"version": "1.2.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/session-file-store/-/session-file-store-1.2.5.tgz",
|
||||||
|
"integrity": "sha512-xjIyh40IznXLrvbAY/nmxu5cMcPcE3ZoDrSDvd02m6p8UjUgOtZAGI7Os5DDd6THuxClLWNhFo/awy1tYp64Bg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@types/express": "*",
|
||||||
|
"@types/express-session": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/stream-throttle": {
|
"node_modules/@types/stream-throttle": {
|
||||||
"version": "0.1.4",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/stream-throttle/-/stream-throttle-0.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/stream-throttle/-/stream-throttle-0.1.4.tgz",
|
||||||
@ -3195,6 +3235,11 @@
|
|||||||
"@pkgjs/parseargs": "^0.11.0"
|
"@pkgjs/parseargs": "^0.11.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/archiver-utils/node_modules/lru-cache": {
|
||||||
|
"version": "10.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
|
||||||
|
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="
|
||||||
|
},
|
||||||
"node_modules/archiver-utils/node_modules/minimatch": {
|
"node_modules/archiver-utils/node_modules/minimatch": {
|
||||||
"version": "9.0.5",
|
"version": "9.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
||||||
@ -3217,6 +3262,21 @@
|
|||||||
"node": ">=16 || 14 >=14.17"
|
"node": ">=16 || 14 >=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/archiver-utils/node_modules/path-scurry": {
|
||||||
|
"version": "1.11.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
|
||||||
|
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
|
||||||
|
"dependencies": {
|
||||||
|
"lru-cache": "^10.2.0",
|
||||||
|
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/archiver-utils/node_modules/readable-stream": {
|
"node_modules/archiver-utils/node_modules/readable-stream": {
|
||||||
"version": "4.5.2",
|
"version": "4.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
|
||||||
@ -3360,9 +3420,10 @@
|
|||||||
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
|
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
|
||||||
},
|
},
|
||||||
"node_modules/asar": {
|
"node_modules/asar": {
|
||||||
"version": "3.1.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/asar/-/asar-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/asar/-/asar-3.2.0.tgz",
|
||||||
"integrity": "sha512-vyxPxP5arcAqN4F/ebHd/HhwnAiZtwhglvdmc7BR2f0ywbVNTOpSeyhLDbGXtE/y58hv1oC75TaNIXutnsOZsQ==",
|
"integrity": "sha512-COdw2ZQvKdFGFxXwX3oYh2/sOsJWJegrdJCGxnN4MZ7IULgRBp9P6665aqj9z1v9VwP4oP1hRBojRDQ//IGgAg==",
|
||||||
|
"deprecated": "Please use @electron/asar moving forward. There is no API change, just a package name change",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromium-pickle-js": "^0.2.0",
|
"chromium-pickle-js": "^0.2.0",
|
||||||
@ -3561,13 +3622,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/better-sqlite3": {
|
"node_modules/better-sqlite3": {
|
||||||
"version": "8.5.0",
|
"version": "11.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.1.2.tgz",
|
||||||
"integrity": "sha512-vbPcv/Hx5WYdyNg/NbcfyaBZyv9s/NVbxb7yCeC5Bq1pVocNxeL2tZmSu3Rlm4IEOTjYdGyzWQgyx0OSdORBzw==",
|
"integrity": "sha512-gujtFwavWU4MSPT+h9B+4pkvZdyOUkH54zgLdIrMmmmd4ZqiBIrRNBzNzYVFO417xo882uP5HBu4GjOfaSrIQw==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bindings": "^1.5.0",
|
"bindings": "^1.5.0",
|
||||||
"prebuild-install": "^7.1.0"
|
"prebuild-install": "^7.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/bezier-easing": {
|
"node_modules/bezier-easing": {
|
||||||
@ -5749,13 +5810,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron": {
|
"node_modules/electron": {
|
||||||
"version": "25.9.8",
|
"version": "31.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-25.9.8.tgz",
|
"resolved": "https://registry.npmjs.org/electron/-/electron-31.2.1.tgz",
|
||||||
"integrity": "sha512-PGgp6PH46QVENHuAHc2NT1Su8Q1qov7qIl2jI5tsDpTibwV2zD8539AeWBQySeBU4dhbj9onIl7+1bXQ0wefBg==",
|
"integrity": "sha512-g3CLKjl4yuXt6VWm/KpgEjYYhFiCl19RgUn8lOC8zV/56ZXAS3+mqV4wWzicE/7vSYXs6GRO7vkYRwrwhX3Gaw==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@electron/get": "^2.0.0",
|
"@electron/get": "^2.0.0",
|
||||||
"@types/node": "^18.11.18",
|
"@types/node": "^20.9.0",
|
||||||
"extract-zip": "^2.0.1"
|
"extract-zip": "^2.0.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -5847,9 +5908,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron-installer-common/node_modules/universalify": {
|
"node_modules/electron-installer-common/node_modules/universalify": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
|
||||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10.0.0"
|
"node": ">= 10.0.0"
|
||||||
@ -5909,9 +5970,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron-installer-debian/node_modules/universalify": {
|
"node_modules/electron-installer-debian/node_modules/universalify": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
|
||||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10.0.0"
|
"node": ">= 10.0.0"
|
||||||
@ -6192,14 +6253,6 @@
|
|||||||
"node": ">=6 <7 || >=8"
|
"node": ">=6 <7 || >=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron/node_modules/@types/node": {
|
|
||||||
"version": "18.19.39",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.39.tgz",
|
|
||||||
"integrity": "sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"undici-types": "~5.26.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/elkjs": {
|
"node_modules/elkjs": {
|
||||||
"version": "0.9.2",
|
"version": "0.9.2",
|
||||||
"resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.9.2.tgz",
|
"resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.9.2.tgz",
|
||||||
@ -6311,6 +6364,44 @@
|
|||||||
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
|
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"node_modules/esbuild": {
|
||||||
|
"version": "0.21.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
|
||||||
|
"integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"bin": {
|
||||||
|
"esbuild": "bin/esbuild"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@esbuild/aix-ppc64": "0.21.5",
|
||||||
|
"@esbuild/android-arm": "0.21.5",
|
||||||
|
"@esbuild/android-arm64": "0.21.5",
|
||||||
|
"@esbuild/android-x64": "0.21.5",
|
||||||
|
"@esbuild/darwin-arm64": "0.21.5",
|
||||||
|
"@esbuild/darwin-x64": "0.21.5",
|
||||||
|
"@esbuild/freebsd-arm64": "0.21.5",
|
||||||
|
"@esbuild/freebsd-x64": "0.21.5",
|
||||||
|
"@esbuild/linux-arm": "0.21.5",
|
||||||
|
"@esbuild/linux-arm64": "0.21.5",
|
||||||
|
"@esbuild/linux-ia32": "0.21.5",
|
||||||
|
"@esbuild/linux-loong64": "0.21.5",
|
||||||
|
"@esbuild/linux-mips64el": "0.21.5",
|
||||||
|
"@esbuild/linux-ppc64": "0.21.5",
|
||||||
|
"@esbuild/linux-riscv64": "0.21.5",
|
||||||
|
"@esbuild/linux-s390x": "0.21.5",
|
||||||
|
"@esbuild/linux-x64": "0.21.5",
|
||||||
|
"@esbuild/netbsd-x64": "0.21.5",
|
||||||
|
"@esbuild/openbsd-x64": "0.21.5",
|
||||||
|
"@esbuild/sunos-x64": "0.21.5",
|
||||||
|
"@esbuild/win32-arm64": "0.21.5",
|
||||||
|
"@esbuild/win32-ia32": "0.21.5",
|
||||||
|
"@esbuild/win32-x64": "0.21.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/escalade": {
|
"node_modules/escalade": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
|
||||||
@ -7312,6 +7403,7 @@
|
|||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/gar/-/gar-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/gar/-/gar-1.0.4.tgz",
|
||||||
"integrity": "sha512-w4n9cPWyP7aHxKxYHFQMegj7WIAsL/YX/C4Bs5Rr8s1H9M1rNtRWRsw+ovYMkXDQ5S4ZbYHsHAPmevPjPgw44w==",
|
"integrity": "sha512-w4n9cPWyP7aHxKxYHFQMegj7WIAsL/YX/C4Bs5Rr8s1H9M1rNtRWRsw+ovYMkXDQ5S4ZbYHsHAPmevPjPgw44w==",
|
||||||
|
"deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"node_modules/get-caller-file": {
|
"node_modules/get-caller-file": {
|
||||||
@ -7397,6 +7489,18 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/get-tsconfig": {
|
||||||
|
"version": "4.7.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz",
|
||||||
|
"integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"resolve-pkg-maps": "^1.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/getpass": {
|
"node_modules/getpass": {
|
||||||
"version": "0.1.7",
|
"version": "0.1.7",
|
||||||
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
||||||
@ -8606,9 +8710,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jsdom": {
|
"node_modules/jsdom": {
|
||||||
"version": "24.1.0",
|
"version": "24.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.1.tgz",
|
||||||
"integrity": "sha512-6gpM7pRXCwIOKxX47cgOyvyQDN/Eh0f1MeKySBV2xGdKtqJBLj8P25eY3EVCWo2mglDDzozR2r2MW4T+JiNUZA==",
|
"integrity": "sha512-5O1wWV99Jhq4DV7rCLIoZ/UIhyQeDR7wHVyZAHAshbrvZsLs+Xzz7gtwnlJTJDjleiTKh54F4dXrX70vJQTyJQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cssstyle": "^4.0.1",
|
"cssstyle": "^4.0.1",
|
||||||
"data-urls": "^5.0.0",
|
"data-urls": "^5.0.0",
|
||||||
@ -8616,11 +8720,11 @@
|
|||||||
"form-data": "^4.0.0",
|
"form-data": "^4.0.0",
|
||||||
"html-encoding-sniffer": "^4.0.0",
|
"html-encoding-sniffer": "^4.0.0",
|
||||||
"http-proxy-agent": "^7.0.2",
|
"http-proxy-agent": "^7.0.2",
|
||||||
"https-proxy-agent": "^7.0.4",
|
"https-proxy-agent": "^7.0.5",
|
||||||
"is-potential-custom-element-name": "^1.0.1",
|
"is-potential-custom-element-name": "^1.0.1",
|
||||||
"nwsapi": "^2.2.10",
|
"nwsapi": "^2.2.12",
|
||||||
"parse5": "^7.1.2",
|
"parse5": "^7.1.2",
|
||||||
"rrweb-cssom": "^0.7.0",
|
"rrweb-cssom": "^0.7.1",
|
||||||
"saxes": "^6.0.0",
|
"saxes": "^6.0.0",
|
||||||
"symbol-tree": "^3.2.4",
|
"symbol-tree": "^3.2.4",
|
||||||
"tough-cookie": "^4.1.4",
|
"tough-cookie": "^4.1.4",
|
||||||
@ -8629,7 +8733,7 @@
|
|||||||
"whatwg-encoding": "^3.1.1",
|
"whatwg-encoding": "^3.1.1",
|
||||||
"whatwg-mimetype": "^4.0.0",
|
"whatwg-mimetype": "^4.0.0",
|
||||||
"whatwg-url": "^14.0.0",
|
"whatwg-url": "^14.0.0",
|
||||||
"ws": "^8.17.0",
|
"ws": "^8.18.0",
|
||||||
"xml-name-validator": "^5.0.0"
|
"xml-name-validator": "^5.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@ -10113,9 +10217,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/node-abi": {
|
"node_modules/node-abi": {
|
||||||
"version": "3.56.0",
|
"version": "3.65.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.56.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.65.0.tgz",
|
||||||
"integrity": "sha512-fZjdhDOeRcaS+rcpve7XuwHBmktS1nS1gzgghwKUQQ8nTy2FdSDr6ZT8k6YhvlJeHmmQMYiT/IH9hfco5zeW2Q==",
|
"integrity": "sha512-ThjYBfoDNr08AWx6hGaRbfPwxKV9kVzAzOzlLKbk2CuqXE2xnCh+cbAGnwM3t8Lq4v9rUB7VfondlkBckcJrVA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": "^7.3.5"
|
"semver": "^7.3.5"
|
||||||
},
|
},
|
||||||
@ -10826,29 +10930,35 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/path-scurry": {
|
"node_modules/path-scurry": {
|
||||||
"version": "1.11.1",
|
"version": "1.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz",
|
||||||
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
|
"integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==",
|
||||||
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lru-cache": "^10.2.0",
|
"lru-cache": "^9.1.1 || ^10.0.0",
|
||||||
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
|
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16 || 14 >=14.18"
|
"node": ">=16 || 14 >=14.17"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/isaacs"
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-scurry/node_modules/lru-cache": {
|
"node_modules/path-scurry/node_modules/lru-cache": {
|
||||||
"version": "10.4.3",
|
"version": "9.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.1.tgz",
|
||||||
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="
|
"integrity": "sha512-65/Jky17UwSb0BuB9V+MyDpsOtXKmYwzhyl+cOa9XUiI4uV2Ouy/2voFP3+al0BjZbJgMBD8FojMpAf+Z+qn4A==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": "14 || >=16.14"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-scurry/node_modules/minipass": {
|
"node_modules/path-scurry/node_modules/minipass": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz",
|
||||||
"integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==",
|
"integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==",
|
||||||
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16 || 14 >=14.17"
|
"node": ">=16 || 14 >=14.17"
|
||||||
}
|
}
|
||||||
@ -11709,6 +11819,15 @@
|
|||||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||||
},
|
},
|
||||||
|
"node_modules/resolve-pkg-maps": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
|
||||||
|
"dev": true,
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/responselike": {
|
"node_modules/responselike": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz",
|
||||||
@ -13013,7 +13132,7 @@
|
|||||||
"node_modules/tiny-each-async": {
|
"node_modules/tiny-each-async": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/tiny-each-async/-/tiny-each-async-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/tiny-each-async/-/tiny-each-async-2.0.3.tgz",
|
||||||
"integrity": "sha1-jru/1tYpXxNwAD+7NxYq/loKUdE=",
|
"integrity": "sha512-5ROII7nElnAirvFn8g7H7MtpfV1daMcyfTGQwsn/x2VtyV+VPiO5CjReCJtWLvoKTDEDmZocf3cNPraiMnBXLA==",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"node_modules/tiny-invariant": {
|
"node_modules/tiny-invariant": {
|
||||||
@ -13244,6 +13363,25 @@
|
|||||||
"node": ">=0.6.x"
|
"node": ">=0.6.x"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tsx": {
|
||||||
|
"version": "4.16.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.16.2.tgz",
|
||||||
|
"integrity": "sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"esbuild": "~0.21.5",
|
||||||
|
"get-tsconfig": "^4.7.5"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"tsx": "dist/cli.mjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "~2.3.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tunnel-agent": {
|
"node_modules/tunnel-agent": {
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
|
||||||
@ -13831,9 +13969,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/word-wrap": {
|
"node_modules/word-wrap": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
|
||||||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
|
"integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
|
27
package.json
27
package.json
@ -18,12 +18,13 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/TriliumNext/Notes.git"
|
"url": "https://github.com/TriliumNext/Notes.git"
|
||||||
},
|
},
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start-server": "cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts",
|
"start-server": "cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts",
|
||||||
"start-server-no-dir": "cross-env TRILIUM_SAFE_MODE=1 TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts",
|
"start-server-no-dir": "cross-env TRILIUM_SAFE_MODE=1 TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts",
|
||||||
"qstart-server": "npm run qswitch-server && TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts",
|
"qstart-server": "npm run qswitch-server && TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 nodemon src/www.ts",
|
||||||
"start-electron": "npm run prepare-dist && cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./dist/electron.js --inspect=5858 .",
|
"start-electron": "rimraf ./dist && tsc && tsx ./bin/copy-dist.ts && cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron ./dist/electron.js --inspect=5858 .",
|
||||||
"start-electron-no-dir": "npm run prepare-dist && cross-env TRILIUM_SAFE_MODE=1 TRILIUM_ENV=dev electron ./dist/electron.js --inspect=5858 .",
|
"start-electron-no-dir": "cross-env TRILIUM_SAFE_MODE=1 TRILIUM_ENV=dev TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 electron --inspect=5858 .",
|
||||||
"qstart-electron": "npm run qswitch-electron && TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron --inspect=5858 .",
|
"qstart-electron": "npm run qswitch-electron && TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev electron --inspect=5858 .",
|
||||||
"start-test-server": "npm run qswitch-server; rimraf ./data-test; cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data-test TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev TRILIUM_PORT=9999 ts-node src/www.ts",
|
"start-test-server": "npm run qswitch-server; rimraf ./data-test; cross-env TRILIUM_SAFE_MODE=1 TRILIUM_DATA_DIR=./data-test TRILIUM_SYNC_SERVER_HOST=http://tsyncserver:4000 TRILIUM_ENV=dev TRILIUM_PORT=9999 ts-node src/www.ts",
|
||||||
"switch-server": "rimraf ./node_modules/better-sqlite3 && npm install",
|
"switch-server": "rimraf ./node_modules/better-sqlite3 && npm install",
|
||||||
@ -33,24 +34,26 @@
|
|||||||
"build-backend-docs": "rimraf ./docs/backend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/becca/entities/*.js src/services/backend_script_api.js src/services/sql.js",
|
"build-backend-docs": "rimraf ./docs/backend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/backend_api src/becca/entities/*.js src/services/backend_script_api.js src/services/sql.js",
|
||||||
"build-frontend-docs": "rimraf ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js",
|
"build-frontend-docs": "rimraf ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/basic_widget.js src/public/app/widgets/note_context_aware_widget.js src/public/app/widgets/right_panel_widget.js",
|
||||||
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
|
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
|
||||||
"webpack": "webpack -c webpack.config.ts",
|
"webpack": "cross-env NODE_OPTIONS=--loader=ts-node/esm webpack -c webpack.config.ts",
|
||||||
"test-jasmine": "cross-env TRILIUM_DATA_DIR=./data-test ts-node ./node_modules/jasmine/bin/jasmine",
|
"test-jasmine": "cross-env TRILIUM_DATA_DIR=./data-test tsx ./node_modules/.bin/jasmine",
|
||||||
"test-es6": "ts-node -r esm spec-es6/attribute_parser.spec.ts",
|
"test-es6": "tsx -r esm spec-es6/attribute_parser.spec.ts",
|
||||||
"test": "npm run test-jasmine && npm run test-es6",
|
"test": "npm run test-jasmine && npm run test-es6",
|
||||||
"start-electron-forge": "npm run prepare-dist && electron-forge start",
|
"start-electron-forge": "npm run prepare-dist && electron-forge start",
|
||||||
"make-electron": "npm run webpack && npm run prepare-dist && electron-forge make",
|
"make-electron": "npm run webpack && npm run prepare-dist && electron-forge make",
|
||||||
"package-electron": "electron-forge package",
|
"package-electron": "electron-forge package",
|
||||||
"prepare-dist": "rimraf ./dist && tsc && ts-node ./bin/copy-dist.ts",
|
"prepare-dist": "rimraf ./dist && tsc && tsx ./bin/copy-dist.ts",
|
||||||
"update-build-info": "ts-node bin/update-build-info.ts"
|
"update-build-info": "tsx bin/update-build-info.ts",
|
||||||
|
"errors": "tsc --watch --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@braintree/sanitize-url": "^7.1.0",
|
"@braintree/sanitize-url": "^7.1.0",
|
||||||
"@electron/remote": "2.1.2",
|
"@electron/remote": "2.1.2",
|
||||||
"@excalidraw/excalidraw": "^0.17.6",
|
"@excalidraw/excalidraw": "^0.17.6",
|
||||||
|
"@types/electron-squirrel-startup": "^1.0.2",
|
||||||
"archiver": "^7.0.1",
|
"archiver": "^7.0.1",
|
||||||
"async-mutex": "^0.5.0",
|
"async-mutex": "^0.5.0",
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
"better-sqlite3": "8.5.0",
|
"better-sqlite3": "^11.1.2",
|
||||||
"boxicons": "2.1.4",
|
"boxicons": "2.1.4",
|
||||||
"chokidar": "3.6.0",
|
"chokidar": "3.6.0",
|
||||||
"cls-hooked": "4.2.2",
|
"cls-hooked": "4.2.2",
|
||||||
@ -93,7 +96,7 @@
|
|||||||
"mermaid": "^10.9.1",
|
"mermaid": "^10.9.1",
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"multer": "1.4.5-lts.1",
|
"multer": "1.4.5-lts.1",
|
||||||
"node-abi": "3.56.0",
|
"node-abi": "^3.65.0",
|
||||||
"normalize-strings": "1.1.1",
|
"normalize-strings": "1.1.1",
|
||||||
"panzoom": "9.4.3",
|
"panzoom": "9.4.3",
|
||||||
"print-this": "2.0.0",
|
"print-this": "2.0.0",
|
||||||
@ -129,6 +132,7 @@
|
|||||||
"@types/compression": "^1.7.5",
|
"@types/compression": "^1.7.5",
|
||||||
"@types/cookie-parser": "^1.4.7",
|
"@types/cookie-parser": "^1.4.7",
|
||||||
"@types/csurf": "^1.11.5",
|
"@types/csurf": "^1.11.5",
|
||||||
|
"@types/debounce": "^1.2.4",
|
||||||
"@types/ejs": "^3.1.5",
|
"@types/ejs": "^3.1.5",
|
||||||
"@types/escape-html": "^1.0.4",
|
"@types/escape-html": "^1.0.4",
|
||||||
"@types/express": "^4.17.21",
|
"@types/express": "^4.17.21",
|
||||||
@ -139,19 +143,19 @@
|
|||||||
"@types/jsdom": "^21.1.6",
|
"@types/jsdom": "^21.1.6",
|
||||||
"@types/mime-types": "^2.1.4",
|
"@types/mime-types": "^2.1.4",
|
||||||
"@types/multer": "^1.4.11",
|
"@types/multer": "^1.4.11",
|
||||||
"@types/node": "^20.11.19",
|
|
||||||
"@types/safe-compare": "^1.1.2",
|
"@types/safe-compare": "^1.1.2",
|
||||||
"@types/sanitize-html": "^2.11.0",
|
"@types/sanitize-html": "^2.11.0",
|
||||||
"@types/sax": "^1.2.7",
|
"@types/sax": "^1.2.7",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
"@types/serve-favicon": "^2.5.7",
|
"@types/serve-favicon": "^2.5.7",
|
||||||
|
"@types/session-file-store": "^1.2.5",
|
||||||
"@types/stream-throttle": "^0.1.4",
|
"@types/stream-throttle": "^0.1.4",
|
||||||
"@types/tmp": "^0.2.6",
|
"@types/tmp": "^0.2.6",
|
||||||
"@types/turndown": "^5.0.4",
|
"@types/turndown": "^5.0.4",
|
||||||
"@types/ws": "^8.5.10",
|
"@types/ws": "^8.5.10",
|
||||||
"@types/xml2js": "^0.4.14",
|
"@types/xml2js": "^0.4.14",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
"electron": "25.9.8",
|
"electron": "^31.2.1",
|
||||||
"electron-packager": "17.1.2",
|
"electron-packager": "17.1.2",
|
||||||
"electron-rebuild": "3.2.9",
|
"electron-rebuild": "3.2.9",
|
||||||
"esm": "3.2.25",
|
"esm": "3.2.25",
|
||||||
@ -163,6 +167,7 @@
|
|||||||
"rimraf": "^6.0.1",
|
"rimraf": "^6.0.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"tslib": "^2.6.2",
|
"tslib": "^2.6.2",
|
||||||
|
"tsx": "^4.16.2",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"webpack": "^5.93.0",
|
"webpack": "^5.93.0",
|
||||||
"webpack-cli": "5.1.4"
|
"webpack-cli": "5.1.4"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as attributeParser from '../src/public/app/services/attribute_parser.js';
|
import * as attributeParser from '../src/public/app/services/attribute_parser.js';
|
||||||
|
|
||||||
import {describe, it, expect, execute} from './mini_test';
|
import {describe, it, expect, execute} from './mini_test.js';
|
||||||
|
|
||||||
describe("Lexing", () => {
|
describe("Lexing", () => {
|
||||||
it("simple label", () => {
|
it("simple label", () => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import etapi = require("../support/etapi");
|
import etapi from "../support/etapi.js";
|
||||||
|
|
||||||
etapi.describeEtapi("app_info", () => {
|
etapi.describeEtapi("app_info", () => {
|
||||||
it("get", async () => {
|
it("get", async () => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import etapi = require("../support/etapi");
|
import etapi from "../support/etapi.js";
|
||||||
|
|
||||||
etapi.describeEtapi("backup", () => {
|
etapi.describeEtapi("backup", () => {
|
||||||
it("create", async () => {
|
it("create", async () => {
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
import etapi = require("../support/etapi");
|
import etapi from "../support/etapi.js";
|
||||||
import fs = require("fs");
|
import fs from "fs";
|
||||||
import path = require("path");
|
import path from "path";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
|
||||||
etapi.describeEtapi("import", () => {
|
etapi.describeEtapi("import", () => {
|
||||||
// temporarily skip this test since test-export.zip is missing
|
// temporarily skip this test since test-export.zip is missing
|
||||||
xit("import", async () => {
|
xit("import", async () => {
|
||||||
|
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
const zipFileBuffer = fs.readFileSync(
|
const zipFileBuffer = fs.readFileSync(
|
||||||
path.resolve(__dirname, "test-export.zip")
|
path.resolve(scriptDir, "test-export.zip")
|
||||||
);
|
);
|
||||||
|
|
||||||
const response = await etapi.postEtapiContent(
|
const response = await etapi.postEtapiContent(
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import crypto = require("crypto");
|
import crypto from "crypto";
|
||||||
import etapi = require("../support/etapi");
|
import etapi from "../support/etapi.js";
|
||||||
|
|
||||||
etapi.describeEtapi("notes", () => {
|
etapi.describeEtapi("notes", () => {
|
||||||
it("create", async () => {
|
it("create", async () => {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import BNote = require("../../src/becca/entities/bnote");
|
import BNote from "../../src/becca/entities/bnote.js";
|
||||||
import BBranch = require("../../src/becca/entities/bbranch");
|
import BBranch from "../../src/becca/entities/bbranch.js";
|
||||||
import BAttribute = require("../../src/becca/entities/battribute");
|
import BAttribute from "../../src/becca/entities/battribute.js";
|
||||||
import becca = require("../../src/becca/becca");
|
import becca from "../../src/becca/becca.js";
|
||||||
import randtoken = require("rand-token");
|
import randtoken from "rand-token";
|
||||||
import SearchResult = require("../../src/services/search/search_result");
|
import SearchResult from "../../src/services/search/search_result.js";
|
||||||
import { NoteType } from "../../src/becca/entities/rows";
|
import { NoteType } from "../../src/becca/entities/rows.js";
|
||||||
randtoken.generator({ source: "crypto" });
|
randtoken.generator({ source: "crypto" });
|
||||||
|
|
||||||
function findNoteByTitle(
|
function findNoteByTitle(
|
||||||
@ -80,7 +80,7 @@ function note(title: string, extraParams = {}) {
|
|||||||
return new NoteBuilder(note);
|
return new NoteBuilder(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
NoteBuilder,
|
NoteBuilder,
|
||||||
findNoteByTitle,
|
findNoteByTitle,
|
||||||
note,
|
note,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import lex = require("../../src/services/search/services/lex");
|
import lex from "../../src/services/search/services/lex.js";
|
||||||
|
|
||||||
describe("Lexer fulltext", () => {
|
describe("Lexer fulltext", () => {
|
||||||
it("simple lexing", () => {
|
it("simple lexing", () => {
|
||||||
|
@ -1,24 +1,26 @@
|
|||||||
const handleParens = require('../../src/services/search/services/handle_parens');
|
import handleParens from "../../src/services/search/services/handle_parens.js";
|
||||||
|
import { TokenStructure } from "../../src/services/search/services/types.js";
|
||||||
|
|
||||||
describe("Parens handler", () => {
|
describe("Parens handler", () => {
|
||||||
it("handles parens", () => {
|
it("handles parens", () => {
|
||||||
const input = ["(", "hello", ")", "and", "(", "(", "pick", "one", ")", "and", "another", ")"]
|
const input = ["(", "hello", ")", "and", "(", "(", "pick", "one", ")", "and", "another", ")"]
|
||||||
.map(token => ({token}));
|
.map(token => ({token}));
|
||||||
|
|
||||||
expect(handleParens(input))
|
const actual: TokenStructure = [
|
||||||
.toEqual([
|
[
|
||||||
|
{token: "hello"}
|
||||||
|
],
|
||||||
|
{token: "and"},
|
||||||
|
[
|
||||||
[
|
[
|
||||||
{token: "hello"}
|
{token: "pick"},
|
||||||
|
{token: "one"}
|
||||||
],
|
],
|
||||||
{token: "and"},
|
{token: "and"},
|
||||||
[
|
{token: "another"}
|
||||||
[
|
]
|
||||||
{token: "pick"},
|
];
|
||||||
{token: "one"}
|
|
||||||
],
|
expect(handleParens(input)).toEqual(actual);
|
||||||
{token: "and"},
|
|
||||||
{token: "another"}
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
// There are many issues with the types of the parser e.g. "parse" function returns "Expression"
|
// There are many issues with the types of the parser e.g. "parse" function returns "Expression"
|
||||||
// but we access properties like "subExpressions" which is not defined in the "Expression" class.
|
// but we access properties like "subExpressions" which is not defined in the "Expression" class.
|
||||||
|
|
||||||
import Expression = require('../../src/services/search/expressions/expression');
|
import Expression from "../../src/services/search/expressions/expression.js";
|
||||||
import SearchContext = require('../../src/services/search/search_context');
|
import SearchContext from "../../src/services/search/search_context.js";
|
||||||
import parse = require('../../src/services/search/services/parse');
|
import parse from "../../src/services/search/services/parse.js";
|
||||||
|
|
||||||
function tokens(toks: Array<string>, cur = 0): Array<any> {
|
function tokens(toks: Array<string>, cur = 0): Array<any> {
|
||||||
return toks.map((arg) => {
|
return toks.map((arg) => {
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import searchService = require('../../src/services/search/services/search');
|
import searchService from "../../src/services/search/services/search.js";
|
||||||
import BNote = require('../../src/becca/entities/bnote');
|
import BNote from "../../src/becca/entities/bnote.js";
|
||||||
import BBranch = require('../../src/becca/entities/bbranch');
|
import BBranch from "../../src/becca/entities/bbranch.js";
|
||||||
import SearchContext = require('../../src/services/search/search_context');
|
import SearchContext from "../../src/services/search/search_context.js";
|
||||||
import dateUtils = require('../../src/services/date_utils');
|
import dateUtils from "../../src/services/date_utils.js";
|
||||||
import becca = require('../../src/becca/becca');
|
import becca from "../../src/becca/becca.js";
|
||||||
// const { NoteBuilder, findNoteByTitle, note } = require("./becca_mocking");
|
import becca_mocking from "./becca_mocking.js";
|
||||||
import becca_mocking = require('./becca_mocking');
|
|
||||||
|
|
||||||
describe('Search', () => {
|
describe('Search', () => {
|
||||||
let rootNote: any;
|
let rootNote: any;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import becca_mocking = require('./becca_mocking');
|
import becca_mocking from "./becca_mocking.js";
|
||||||
import ValueExtractor = require('../../src/services/search/value_extractor');
|
import ValueExtractor from "../../src/services/search/value_extractor.js";
|
||||||
import becca = require('../../src/becca/becca');
|
import becca from "../../src/becca/becca.js";
|
||||||
import SearchContext = require('../../src/services/search/search_context');
|
import SearchContext from "../../src/services/search/search_context.js";
|
||||||
|
|
||||||
const dsc = new SearchContext();
|
const dsc = new SearchContext();
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import child_process = require("child_process");
|
import child_process from "child_process";
|
||||||
import kill = require("tree-kill");
|
import kill from "tree-kill";
|
||||||
|
|
||||||
let etapiAuthToken: string | undefined;
|
let etapiAuthToken: string | undefined;
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ function checkStatus(response: Response): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export default {
|
||||||
describeEtapi,
|
describeEtapi,
|
||||||
getEtapi,
|
getEtapi,
|
||||||
getEtapiResponse,
|
getEtapiResponse,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import anonymizationService = require('./services/anonymization');
|
import anonymizationService from "./services/anonymization.js";
|
||||||
import sqlInit = require('./services/sql_init');
|
import sqlInit from "./services/sql_init.js";
|
||||||
require('./becca/entity_constructor');
|
await import("./becca/entity_constructor.js");
|
||||||
|
|
||||||
sqlInit.dbReady.then(async () => {
|
sqlInit.dbReady.then(async () => {
|
||||||
try {
|
try {
|
||||||
|
67
src/app.ts
67
src/app.ts
@ -1,26 +1,39 @@
|
|||||||
import express = require('express');
|
import express from "express";
|
||||||
import path = require('path');
|
import path from "path";
|
||||||
import favicon = require('serve-favicon');
|
import favicon from "serve-favicon";
|
||||||
import cookieParser = require('cookie-parser');
|
import cookieParser from "cookie-parser";
|
||||||
import helmet = require('helmet');
|
import helmet from "helmet";
|
||||||
import compression = require('compression');
|
import compression from "compression";
|
||||||
import sessionParser = require('./routes/session_parser');
|
import { fileURLToPath } from "url";
|
||||||
import utils = require('./services/utils');
|
import { dirname } from "path";
|
||||||
|
import sessionParser from "./routes/session_parser.js";
|
||||||
|
import utils from "./services/utils.js";
|
||||||
|
import assets from "./routes/assets.js";
|
||||||
|
import routes from "./routes/routes.js";
|
||||||
|
import custom from "./routes/custom.js";
|
||||||
|
import error_handlers from "./routes/error_handlers.js";
|
||||||
|
import { startScheduledCleanup } from "./services/erase.js";
|
||||||
|
import sql_init from "./services/sql_init.js";
|
||||||
|
|
||||||
require('./services/handlers');
|
await import('./services/handlers.js');
|
||||||
require('./becca/becca_loader');
|
await import('./becca/becca_loader.js');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
|
// Initialize DB
|
||||||
|
sql_init.initializeDb();
|
||||||
|
|
||||||
// view engine setup
|
// view engine setup
|
||||||
app.set('views', path.join(__dirname, 'views'));
|
app.set('views', path.join(scriptDir, 'views'));
|
||||||
app.set('view engine', 'ejs');
|
app.set('view engine', 'ejs');
|
||||||
|
|
||||||
if (!utils.isElectron()) {
|
if (!utils.isElectron()) {
|
||||||
app.use(compression()); // HTTP compression
|
app.use(compression()); // HTTP compression
|
||||||
}
|
}
|
||||||
|
|
||||||
app.use(helmet.default({
|
app.use(helmet({
|
||||||
hidePoweredBy: false, // errors out in electron
|
hidePoweredBy: false, // errors out in electron
|
||||||
contentSecurityPolicy: false,
|
contentSecurityPolicy: false,
|
||||||
crossOriginEmbedderPolicy: false
|
crossOriginEmbedderPolicy: false
|
||||||
@ -31,30 +44,32 @@ app.use(express.json({ limit: '500mb' }));
|
|||||||
app.use(express.raw({ limit: '500mb' }));
|
app.use(express.raw({ limit: '500mb' }));
|
||||||
app.use(express.urlencoded({ extended: false }));
|
app.use(express.urlencoded({ extended: false }));
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
app.use(express.static(path.join(__dirname, 'public/root')));
|
app.use(express.static(path.join(scriptDir, 'public/root')));
|
||||||
app.use(`/manifest.webmanifest`, express.static(path.join(__dirname, 'public/manifest.webmanifest')));
|
app.use(`/manifest.webmanifest`, express.static(path.join(scriptDir, 'public/manifest.webmanifest')));
|
||||||
app.use(`/robots.txt`, express.static(path.join(__dirname, 'public/robots.txt')));
|
app.use(`/robots.txt`, express.static(path.join(scriptDir, 'public/robots.txt')));
|
||||||
app.use(sessionParser);
|
app.use(sessionParser);
|
||||||
app.use(favicon(`${__dirname}/../images/app-icons/win/icon.ico`));
|
app.use(favicon(`${scriptDir}/../images/app-icons/win/icon.ico`));
|
||||||
|
|
||||||
require('./routes/assets').register(app);
|
assets.register(app);
|
||||||
require('./routes/routes').register(app);
|
routes.register(app);
|
||||||
require('./routes/custom').register(app);
|
custom.register(app);
|
||||||
require('./routes/error_handlers').register(app);
|
error_handlers.register(app);
|
||||||
|
|
||||||
// triggers sync timer
|
// triggers sync timer
|
||||||
require('./services/sync');
|
await import("./services/sync.js");
|
||||||
|
|
||||||
// triggers backup timer
|
// triggers backup timer
|
||||||
require('./services/backup');
|
await import('./services/backup.js');
|
||||||
|
|
||||||
// trigger consistency checks timer
|
// trigger consistency checks timer
|
||||||
require('./services/consistency_checks');
|
await import('./services/consistency_checks.js');
|
||||||
|
|
||||||
require('./services/scheduler');
|
await import('./services/scheduler.js');
|
||||||
|
|
||||||
|
startScheduledCleanup();
|
||||||
|
|
||||||
if (utils.isElectron()) {
|
if (utils.isElectron()) {
|
||||||
require('@electron/remote/main').initialize();
|
(await import('@electron/remote/main/index.js')).initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
export = app;
|
export default app;
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import sql = require('../services/sql');
|
import sql from "../services/sql.js";
|
||||||
import NoteSet = require('../services/search/note_set');
|
import NoteSet from "../services/search/note_set.js";
|
||||||
import NotFoundError = require('../errors/not_found_error');
|
import NotFoundError from "../errors/not_found_error.js";
|
||||||
import BOption = require('./entities/boption');
|
import BOption from "./entities/boption.js";
|
||||||
import BNote = require('./entities/bnote');
|
import BNote from "./entities/bnote.js";
|
||||||
import BEtapiToken = require('./entities/betapi_token');
|
import BEtapiToken from "./entities/betapi_token.js";
|
||||||
import BAttribute = require('./entities/battribute');
|
import BAttribute from "./entities/battribute.js";
|
||||||
import BBranch = require('./entities/bbranch');
|
import BBranch from "./entities/bbranch.js";
|
||||||
import BRevision = require('./entities/brevision');
|
import BRevision from "./entities/brevision.js";
|
||||||
import BAttachment = require('./entities/battachment');
|
import BAttachment from "./entities/battachment.js";
|
||||||
import { AttachmentRow, RevisionRow } from './entities/rows';
|
import { AttachmentRow, BlobRow, RevisionRow } from './entities/rows.js';
|
||||||
import BBlob = require('./entities/bblob');
|
import BBlob from "./entities/bblob.js";
|
||||||
import BRecentNote = require('./entities/brecent_note');
|
import BRecentNote from "./entities/brecent_note.js";
|
||||||
import AbstractBeccaEntity = require('./entities/abstract_becca_entity');
|
import AbstractBeccaEntity from "./entities/abstract_becca_entity.js";
|
||||||
|
|
||||||
interface AttachmentOpts {
|
interface AttachmentOpts {
|
||||||
includeContentLength?: boolean;
|
includeContentLength?: boolean;
|
||||||
@ -155,9 +155,7 @@ export default class Becca {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRevision(revisionId: string): BRevision | null {
|
getRevision(revisionId: string): BRevision | null {
|
||||||
const row = sql.getRow("SELECT * FROM revisions WHERE revisionId = ?", [revisionId]);
|
const row = sql.getRow<RevisionRow | null>("SELECT * FROM revisions WHERE revisionId = ?", [revisionId]);
|
||||||
|
|
||||||
const BRevision = require('./entities/brevision'); // avoiding circular dependency problems
|
|
||||||
return row ? new BRevision(row) : null;
|
return row ? new BRevision(row) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,9 +177,7 @@ export default class Becca {
|
|||||||
WHERE attachmentId = ? AND isDeleted = 0`
|
WHERE attachmentId = ? AND isDeleted = 0`
|
||||||
: `SELECT * FROM attachments WHERE attachmentId = ? AND isDeleted = 0`;
|
: `SELECT * FROM attachments WHERE attachmentId = ? AND isDeleted = 0`;
|
||||||
|
|
||||||
const BAttachment = require('./entities/battachment'); // avoiding circular dependency problems
|
return sql.getRows<AttachmentRow>(query, [attachmentId])
|
||||||
|
|
||||||
return sql.getRows(query, [attachmentId])
|
|
||||||
.map(row => new BAttachment(row))[0];
|
.map(row => new BAttachment(row))[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +190,6 @@ export default class Becca {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getAttachments(attachmentIds: string[]): BAttachment[] {
|
getAttachments(attachmentIds: string[]): BAttachment[] {
|
||||||
const BAttachment = require('./entities/battachment'); // avoiding circular dependency problems
|
|
||||||
return sql.getManyRows<AttachmentRow>("SELECT * FROM attachments WHERE attachmentId IN (???) AND isDeleted = 0", attachmentIds)
|
return sql.getManyRows<AttachmentRow>("SELECT * FROM attachments WHERE attachmentId IN (???) AND isDeleted = 0", attachmentIds)
|
||||||
.map(row => new BAttachment(row));
|
.map(row => new BAttachment(row));
|
||||||
}
|
}
|
||||||
@ -204,9 +199,7 @@ export default class Becca {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const row = sql.getRow("SELECT *, LENGTH(content) AS contentLength FROM blobs WHERE blobId = ?", [entity.blobId]);
|
const row = sql.getRow<BlobRow | null>("SELECT *, LENGTH(content) AS contentLength FROM blobs WHERE blobId = ?", [entity.blobId]);
|
||||||
|
|
||||||
const BBlob = require('./entities/bblob'); // avoiding circular dependency problems
|
|
||||||
return row ? new BBlob(row) : null;
|
return row ? new BBlob(row) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,16 +241,12 @@ export default class Becca {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getRecentNotesFromQuery(query: string, params: string[] = []): BRecentNote[] {
|
getRecentNotesFromQuery(query: string, params: string[] = []): BRecentNote[] {
|
||||||
const rows = sql.getRows(query, params);
|
const rows = sql.getRows<BRecentNote>(query, params);
|
||||||
|
|
||||||
const BRecentNote = require('./entities/brecent_note'); // avoiding circular dependency problems
|
|
||||||
return rows.map(row => new BRecentNote(row));
|
return rows.map(row => new BRecentNote(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
getRevisionsFromQuery(query: string, params: string[] = []): BRevision[] {
|
getRevisionsFromQuery(query: string, params: string[] = []): BRevision[] {
|
||||||
const rows = sql.getRows<RevisionRow>(query, params);
|
const rows = sql.getRows<RevisionRow>(query, params);
|
||||||
|
|
||||||
const BRevision = require('./entities/brevision'); // avoiding circular dependency problems
|
|
||||||
return rows.map(row => new BRevision(row));
|
return rows.map(row => new BRevision(row));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import Becca from "./becca-interface";
|
import Becca from "./becca-interface.js";
|
||||||
|
|
||||||
const becca = new Becca();
|
const becca = new Becca();
|
||||||
|
|
||||||
export = becca;
|
export default becca;
|
||||||
|
@ -1,26 +1,28 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import sql = require('../services/sql');
|
import sql from "../services/sql.js";
|
||||||
import eventService = require('../services/events');
|
import eventService from "../services/events.js";
|
||||||
import becca = require('./becca');
|
import becca from "./becca.js";
|
||||||
import sqlInit = require('../services/sql_init');
|
import sqlInit from "../services/sql_init.js";
|
||||||
import log = require('../services/log');
|
import log from "../services/log.js";
|
||||||
import BNote = require('./entities/bnote');
|
import BNote from "./entities/bnote.js";
|
||||||
import BBranch = require('./entities/bbranch');
|
import BBranch from "./entities/bbranch.js";
|
||||||
import BAttribute = require('./entities/battribute');
|
import BAttribute from "./entities/battribute.js";
|
||||||
import BOption = require('./entities/boption');
|
import BOption from "./entities/boption.js";
|
||||||
import BEtapiToken = require('./entities/betapi_token');
|
import BEtapiToken from "./entities/betapi_token.js";
|
||||||
import cls = require('../services/cls');
|
import cls from "../services/cls.js";
|
||||||
import entityConstructor = require('../becca/entity_constructor');
|
import entityConstructor from "../becca/entity_constructor.js";
|
||||||
import { AttributeRow, BranchRow, EtapiTokenRow, NoteRow, OptionRow } from './entities/rows';
|
import { AttributeRow, BranchRow, EtapiTokenRow, NoteRow, OptionRow } from './entities/rows.js';
|
||||||
import AbstractBeccaEntity = require('./entities/abstract_becca_entity');
|
import AbstractBeccaEntity from "./entities/abstract_becca_entity.js";
|
||||||
|
import options_init from "../services/options_init.js";
|
||||||
|
import ws from "../services/ws.js";
|
||||||
|
|
||||||
const beccaLoaded = new Promise<void>((res, rej) => {
|
const beccaLoaded = new Promise<void>((res, rej) => {
|
||||||
sqlInit.dbReady.then(() => {
|
sqlInit.dbReady.then(() => {
|
||||||
cls.init(() => {
|
cls.init(() => {
|
||||||
load();
|
load();
|
||||||
|
|
||||||
require('../services/options_init').initStartupOptions();
|
options_init.initStartupOptions();
|
||||||
|
|
||||||
res();
|
res();
|
||||||
});
|
});
|
||||||
@ -73,7 +75,7 @@ function load() {
|
|||||||
function reload(reason: string) {
|
function reload(reason: string) {
|
||||||
load();
|
load();
|
||||||
|
|
||||||
require('../services/ws').reloadFrontend(reason || "becca reloaded");
|
ws.reloadFrontend(reason || "becca reloaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
eventService.subscribeBeccaLoader([eventService.ENTITY_CHANGE_SYNCED], ({ entityName, entityRow }) => {
|
eventService.subscribeBeccaLoader([eventService.ENTITY_CHANGE_SYNCED], ({ entityName, entityRow }) => {
|
||||||
@ -286,7 +288,7 @@ eventService.subscribeBeccaLoader(eventService.ENTER_PROTECTED_SESSION, () => {
|
|||||||
|
|
||||||
eventService.subscribeBeccaLoader(eventService.LEAVE_PROTECTED_SESSION, load);
|
eventService.subscribeBeccaLoader(eventService.LEAVE_PROTECTED_SESSION, load);
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
load,
|
load,
|
||||||
reload,
|
reload,
|
||||||
beccaLoaded
|
beccaLoaded
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import becca = require('./becca');
|
import becca from "./becca.js";
|
||||||
import cls = require('../services/cls');
|
import cls from "../services/cls.js";
|
||||||
import log = require('../services/log');
|
import log from "../services/log.js";
|
||||||
|
|
||||||
function isNotePathArchived(notePath: string[]) {
|
function isNotePathArchived(notePath: string[]) {
|
||||||
const noteId = notePath[notePath.length - 1];
|
const noteId = notePath[notePath.length - 1];
|
||||||
@ -82,7 +82,7 @@ function getNoteTitleForPath(notePathArray: string[]) {
|
|||||||
return titles.join(' / ');
|
return titles.join(' / ');
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getNoteTitle,
|
getNoteTitle,
|
||||||
getNoteTitleForPath,
|
getNoteTitleForPath,
|
||||||
isNotePathArchived
|
isNotePathArchived
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import entityChangesService = require('../../services/entity_changes');
|
import entityChangesService from "../../services/entity_changes.js";
|
||||||
import eventService = require('../../services/events');
|
import eventService from "../../services/events.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import cls = require('../../services/cls');
|
import cls from "../../services/cls.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import protectedSessionService = require('../../services/protected_session');
|
import protectedSessionService from "../../services/protected_session.js";
|
||||||
import blobService = require('../../services/blob');
|
import blobService from "../../services/blob.js";
|
||||||
import Becca, { ConstructorData } from '../becca-interface';
|
import Becca, { ConstructorData } from '../becca-interface.js';
|
||||||
|
import becca from "../becca.js";
|
||||||
let becca: Becca;
|
|
||||||
|
|
||||||
interface ContentOpts {
|
interface ContentOpts {
|
||||||
forceSave?: boolean;
|
forceSave?: boolean;
|
||||||
@ -47,11 +46,7 @@ abstract class AbstractBeccaEntity<T extends AbstractBeccaEntity<T>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected get becca(): Becca {
|
protected get becca(): Becca {
|
||||||
if (!becca) {
|
return becca;
|
||||||
becca = require('../becca');
|
|
||||||
}
|
|
||||||
|
|
||||||
return becca as Becca;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected putEntityChange(isDeleted: boolean) {
|
protected putEntityChange(isDeleted: boolean) {
|
||||||
@ -327,4 +322,4 @@ abstract class AbstractBeccaEntity<T extends AbstractBeccaEntity<T>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = AbstractBeccaEntity;
|
export default AbstractBeccaEntity;
|
||||||
|
@ -1,14 +1,15 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import AbstractBeccaEntity = require('./abstract_becca_entity');
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import protectedSessionService = require('../../services/protected_session');
|
import protectedSessionService from "../../services/protected_session.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import { AttachmentRow } from './rows';
|
import { AttachmentRow } from './rows.js';
|
||||||
import BNote = require('./bnote');
|
import BNote from "./bnote.js";
|
||||||
import BBranch = require('./bbranch');
|
import BBranch from "./bbranch.js";
|
||||||
|
import noteService from "../../services/notes.js";
|
||||||
|
|
||||||
const attachmentRoleToNoteTypeMapping = {
|
const attachmentRoleToNoteTypeMapping = {
|
||||||
'image': 'image',
|
'image': 'image',
|
||||||
@ -43,9 +44,6 @@ class BAttachment extends AbstractBeccaEntity<BAttachment> {
|
|||||||
title!: string;
|
title!: string;
|
||||||
type?: keyof typeof attachmentRoleToNoteTypeMapping;
|
type?: keyof typeof attachmentRoleToNoteTypeMapping;
|
||||||
position?: number;
|
position?: number;
|
||||||
blobId?: string;
|
|
||||||
isProtected?: boolean;
|
|
||||||
dateModified?: string;
|
|
||||||
utcDateScheduledForErasureSince?: string | null;
|
utcDateScheduledForErasureSince?: string | null;
|
||||||
/** optionally added to the entity */
|
/** optionally added to the entity */
|
||||||
contentLength?: number;
|
contentLength?: number;
|
||||||
@ -157,8 +155,6 @@ class BAttachment extends AbstractBeccaEntity<BAttachment> {
|
|||||||
throw new Error(`Cannot convert protected attachment outside of protected session`);
|
throw new Error(`Cannot convert protected attachment outside of protected session`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const noteService = require('../../services/notes');
|
|
||||||
|
|
||||||
const { note, branch } = noteService.createNewNote({
|
const { note, branch } = noteService.createNewNote({
|
||||||
parentNoteId: this.ownerId,
|
parentNoteId: this.ownerId,
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@ -249,4 +245,4 @@ class BAttachment extends AbstractBeccaEntity<BAttachment> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BAttachment;
|
export default BAttachment;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import BNote = require('./bnote');
|
import BNote from "./bnote.js";
|
||||||
import AbstractBeccaEntity = require('./abstract_becca_entity');
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import promotedAttributeDefinitionParser = require('../../services/promoted_attribute_definition_parser');
|
import promotedAttributeDefinitionParser from "../../services/promoted_attribute_definition_parser.js";
|
||||||
import sanitizeAttributeName = require('../../services/sanitize_attribute_name');
|
import sanitizeAttributeName from "../../services/sanitize_attribute_name.js";
|
||||||
import { AttributeRow, AttributeType } from './rows';
|
import { AttributeRow, AttributeType } from './rows.js';
|
||||||
|
|
||||||
interface SavingOpts {
|
interface SavingOpts {
|
||||||
skipValidation?: boolean;
|
skipValidation?: boolean;
|
||||||
@ -226,4 +226,4 @@ class BAttribute extends AbstractBeccaEntity<BAttribute> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BAttribute;
|
export default BAttribute;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import AbstractBeccaEntity = require("./abstract_becca_entity");
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
import { BlobRow } from "./rows";
|
import { BlobRow } from "./rows.js";
|
||||||
|
|
||||||
// TODO: Why this does not extend the abstract becca?
|
// TODO: Why this does not extend the abstract becca?
|
||||||
class BBlob extends AbstractBeccaEntity<BBlob> {
|
class BBlob extends AbstractBeccaEntity<BBlob> {
|
||||||
@ -7,11 +7,8 @@ class BBlob extends AbstractBeccaEntity<BBlob> {
|
|||||||
static get primaryKeyName() { return "blobId"; }
|
static get primaryKeyName() { return "blobId"; }
|
||||||
static get hashedProperties() { return ["blobId", "content"]; }
|
static get hashedProperties() { return ["blobId", "content"]; }
|
||||||
|
|
||||||
blobId!: string;
|
|
||||||
content!: string | Buffer;
|
content!: string | Buffer;
|
||||||
contentLength!: number;
|
contentLength!: number;
|
||||||
dateModified!: string;
|
|
||||||
utcDateModified!: string;
|
|
||||||
|
|
||||||
constructor(row: BlobRow) {
|
constructor(row: BlobRow) {
|
||||||
super();
|
super();
|
||||||
@ -37,4 +34,4 @@ class BBlob extends AbstractBeccaEntity<BBlob> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BBlob;
|
export default BBlob;
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import BNote = require('./bnote');
|
import BNote from "./bnote.js";
|
||||||
import AbstractBeccaEntity = require('./abstract_becca_entity');
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import TaskContext = require('../../services/task_context');
|
import TaskContext from "../../services/task_context.js";
|
||||||
import cls = require('../../services/cls');
|
import cls from "../../services/cls.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import { BranchRow } from './rows';
|
import { BranchRow } from './rows.js';
|
||||||
|
import handlers from "../../services/handlers.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
* Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple
|
||||||
@ -28,7 +29,6 @@ class BBranch extends AbstractBeccaEntity<BBranch> {
|
|||||||
prefix!: string | null;
|
prefix!: string | null;
|
||||||
notePosition!: number;
|
notePosition!: number;
|
||||||
isExpanded!: boolean;
|
isExpanded!: boolean;
|
||||||
utcDateModified?: string;
|
|
||||||
|
|
||||||
constructor(row?: BranchRow) {
|
constructor(row?: BranchRow) {
|
||||||
super();
|
super();
|
||||||
@ -157,7 +157,6 @@ class BBranch extends AbstractBeccaEntity<BBranch> {
|
|||||||
|
|
||||||
if (parentBranches.length === 1 && parentBranches[0] === this) {
|
if (parentBranches.length === 1 && parentBranches[0] === this) {
|
||||||
// needs to be run before branches and attributes are deleted and thus attached relations disappear
|
// needs to be run before branches and attributes are deleted and thus attached relations disappear
|
||||||
const handlers = require('../../services/handlers');
|
|
||||||
handlers.runAttachedRelations(note, 'runOnNoteDeletion', note);
|
handlers.runAttachedRelations(note, 'runOnNoteDeletion', note);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -285,4 +284,4 @@ class BBranch extends AbstractBeccaEntity<BBranch> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BBranch;
|
export default BBranch;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { EtapiTokenRow } from "./rows";
|
import { EtapiTokenRow } from "./rows.js";
|
||||||
|
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import AbstractBeccaEntity = require('./abstract_becca_entity');
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
|
* EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications.
|
||||||
@ -80,4 +80,4 @@ class BEtapiToken extends AbstractBeccaEntity<BEtapiToken> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BEtapiToken;
|
export default BEtapiToken;
|
||||||
|
@ -1,21 +1,25 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import protectedSessionService = require('../../services/protected_session');
|
import protectedSessionService from "../../services/protected_session.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import AbstractBeccaEntity = require('./abstract_becca_entity');
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
import BRevision = require('./brevision');
|
import BRevision from "./brevision.js";
|
||||||
import BAttachment = require('./battachment');
|
import BAttachment from "./battachment.js";
|
||||||
import TaskContext = require('../../services/task_context');
|
import TaskContext from "../../services/task_context.js";
|
||||||
import dayjs = require("dayjs");
|
import dayjs from "dayjs";
|
||||||
import utc = require('dayjs/plugin/utc');
|
import utc from "dayjs/plugin/utc.js";
|
||||||
import eventService = require('../../services/events');
|
import eventService from "../../services/events.js";
|
||||||
import { AttachmentRow, NoteRow, NoteType, RevisionRow } from './rows';
|
import { AttachmentRow, AttributeType, NoteRow, NoteType, RevisionRow } from './rows.js';
|
||||||
import BBranch = require('./bbranch');
|
import BBranch from "./bbranch.js";
|
||||||
import BAttribute = require('./battribute');
|
import BAttribute from "./battribute.js";
|
||||||
import { NotePojo } from '../becca-interface';
|
import { NotePojo } from '../becca-interface.js';
|
||||||
|
import searchService from "../../services/search/services/search.js";
|
||||||
|
import cloningService, { CloneResponse } from "../../services/cloning.js";
|
||||||
|
import noteService from "../../services/notes.js";
|
||||||
|
import handlers from "../../services/handlers.js";
|
||||||
dayjs.extend(utc);
|
dayjs.extend(utc);
|
||||||
|
|
||||||
const LABEL = 'label';
|
const LABEL = 'label';
|
||||||
@ -890,11 +894,9 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const searchService = require('../../services/search/services/search');
|
const result = searchService.searchFromNote(this);
|
||||||
const {searchResultNoteIds} = searchService.searchFromNote(this);
|
|
||||||
|
|
||||||
const becca = this.becca;
|
const becca = this.becca;
|
||||||
return (searchResultNoteIds as string[]) // TODO: remove cast once search is converted
|
return (result.searchResultNoteIds)
|
||||||
.map(resultNoteId => becca.notes[resultNoteId])
|
.map(resultNoteId => becca.notes[resultNoteId])
|
||||||
.filter(note => !!note);
|
.filter(note => !!note);
|
||||||
}
|
}
|
||||||
@ -1261,7 +1263,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
* @param name - attribute name
|
* @param name - attribute name
|
||||||
* @param value - attribute value (optional)
|
* @param value - attribute value (optional)
|
||||||
*/
|
*/
|
||||||
setAttribute(type: string, name: string, value?: string) {
|
setAttribute(type: AttributeType, name: string, value?: string) {
|
||||||
const attributes = this.getOwnedAttributes();
|
const attributes = this.getOwnedAttributes();
|
||||||
const attr = attributes.find(attr => attr.type === type && attr.name === name);
|
const attr = attributes.find(attr => attr.type === type && attr.name === name);
|
||||||
|
|
||||||
@ -1274,8 +1276,6 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const BAttribute = require('./battribute');
|
|
||||||
|
|
||||||
new BAttribute({
|
new BAttribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
@ -1310,9 +1310,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
* @param name - name of the attribute, not including the leading ~/#
|
* @param name - name of the attribute, not including the leading ~/#
|
||||||
* @param value - value of the attribute - text for labels, target note ID for relations; optional.
|
* @param value - value of the attribute - text for labels, target note ID for relations; optional.
|
||||||
*/
|
*/
|
||||||
addAttribute(type: string, name: string, value: string = "", isInheritable: boolean = false, position: number | null = null): BAttribute {
|
addAttribute(type: AttributeType, name: string, value: string = "", isInheritable: boolean = false, position: number | null = null): BAttribute {
|
||||||
const BAttribute = require('./battribute');
|
|
||||||
|
|
||||||
return new BAttribute({
|
return new BAttribute({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
type: type,
|
type: type,
|
||||||
@ -1351,7 +1349,7 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
* @param name - attribute name
|
* @param name - attribute name
|
||||||
* @param value - attribute value (optional)
|
* @param value - attribute value (optional)
|
||||||
*/
|
*/
|
||||||
toggleAttribute(type: string, enabled: boolean, name: string, value?: string) {
|
toggleAttribute(type: AttributeType, enabled: boolean, name: string, value?: string) {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
this.setAttribute(type, name, value);
|
this.setAttribute(type, name, value);
|
||||||
}
|
}
|
||||||
@ -1423,8 +1421,6 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
searchNotesInSubtree(searchString: string) {
|
searchNotesInSubtree(searchString: string) {
|
||||||
const searchService = require('../../services/search/services/search');
|
|
||||||
|
|
||||||
return searchService.searchNotes(searchString) as BNote[];
|
return searchService.searchNotes(searchString) as BNote[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1432,12 +1428,16 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
return this.searchNotesInSubtree(searchString)[0];
|
return this.searchNotesInSubtree(searchString)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneTo(parentNoteId: string) {
|
cloneTo(parentNoteId: string): CloneResponse {
|
||||||
const cloningService = require('../../services/cloning');
|
|
||||||
|
|
||||||
const branch = this.becca.getNote(parentNoteId)?.getParentBranches()[0];
|
const branch = this.becca.getNote(parentNoteId)?.getParentBranches()[0];
|
||||||
|
if (!branch?.branchId) {
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
message: "Unable to find the branch ID to clone."
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return cloningService.cloneNoteToBranch(this.noteId, branch?.branchId);
|
return cloningService.cloneNoteToBranch(this.noteId, branch.branchId);
|
||||||
}
|
}
|
||||||
|
|
||||||
isEligibleForConversionToAttachment(opts: ConvertOpts = { autoConversion: false }) {
|
isEligibleForConversionToAttachment(opts: ConvertOpts = { autoConversion: false }) {
|
||||||
@ -1508,7 +1508,6 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
|
|
||||||
parentNote.setContent(fixedContent);
|
parentNote.setContent(fixedContent);
|
||||||
|
|
||||||
const noteService = require('../../services/notes');
|
|
||||||
noteService.asyncPostProcessContent(parentNote, fixedContent); // to mark an unused attachment for deletion
|
noteService.asyncPostProcessContent(parentNote, fixedContent); // to mark an unused attachment for deletion
|
||||||
|
|
||||||
this.deleteNote();
|
this.deleteNote();
|
||||||
@ -1535,7 +1534,6 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// needs to be run before branches and attributes are deleted and thus attached relations disappear
|
// needs to be run before branches and attributes are deleted and thus attached relations disappear
|
||||||
const handlers = require('../../services/handlers');
|
|
||||||
handlers.runAttachedRelations(this, 'runOnNoteDeletion', this);
|
handlers.runAttachedRelations(this, 'runOnNoteDeletion', this);
|
||||||
taskContext.noteDeletionHandlerTriggered = true;
|
taskContext.noteDeletionHandlerTriggered = true;
|
||||||
|
|
||||||
@ -1696,4 +1694,4 @@ class BNote extends AbstractBeccaEntity<BNote> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BNote;
|
export default BNote;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import AbstractBeccaEntity = require('./abstract_becca_entity');
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
import { OptionRow } from './rows';
|
import { OptionRow } from './rows.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Option represents a name-value pair, either directly configurable by the user or some system property.
|
* Option represents a name-value pair, either directly configurable by the user or some system property.
|
||||||
@ -14,7 +14,6 @@ class BOption extends AbstractBeccaEntity<BOption> {
|
|||||||
|
|
||||||
name!: string;
|
name!: string;
|
||||||
value!: string;
|
value!: string;
|
||||||
isSynced!: boolean;
|
|
||||||
|
|
||||||
constructor(row?: OptionRow) {
|
constructor(row?: OptionRow) {
|
||||||
super();
|
super();
|
||||||
@ -48,4 +47,4 @@ class BOption extends AbstractBeccaEntity<BOption> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BOption;
|
export default BOption;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { RecentNoteRow } from "./rows";
|
import { RecentNoteRow } from "./rows.js";
|
||||||
|
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import AbstractBeccaEntity = require('./abstract_becca_entity');
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RecentNote represents recently visited note.
|
* RecentNote represents recently visited note.
|
||||||
@ -15,7 +15,6 @@ class BRecentNote extends AbstractBeccaEntity<BRecentNote> {
|
|||||||
|
|
||||||
noteId!: string;
|
noteId!: string;
|
||||||
notePath!: string;
|
notePath!: string;
|
||||||
utcDateCreated!: string;
|
|
||||||
|
|
||||||
constructor(row: RecentNoteRow) {
|
constructor(row: RecentNoteRow) {
|
||||||
super();
|
super();
|
||||||
@ -38,4 +37,4 @@ class BRecentNote extends AbstractBeccaEntity<BRecentNote> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BRecentNote;
|
export default BRecentNote;
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import protectedSessionService = require('../../services/protected_session');
|
import protectedSessionService from "../../services/protected_session.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import becca = require('../becca');
|
import becca from "../becca.js";
|
||||||
import AbstractBeccaEntity = require('./abstract_becca_entity');
|
import AbstractBeccaEntity from "./abstract_becca_entity.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import BAttachment = require('./battachment');
|
import BAttachment from "./battachment.js";
|
||||||
import { AttachmentRow, RevisionRow } from './rows';
|
import { AttachmentRow, RevisionRow } from './rows.js';
|
||||||
|
import eraseService from "../../services/erase.js";
|
||||||
|
|
||||||
interface ContentOpts {
|
interface ContentOpts {
|
||||||
/** will also save this BRevision entity */
|
/** will also save this BRevision entity */
|
||||||
@ -32,13 +33,9 @@ class BRevision extends AbstractBeccaEntity<BRevision> {
|
|||||||
noteId!: string;
|
noteId!: string;
|
||||||
type!: string;
|
type!: string;
|
||||||
mime!: string;
|
mime!: string;
|
||||||
isProtected!: boolean;
|
|
||||||
title!: string;
|
title!: string;
|
||||||
blobId?: string;
|
|
||||||
dateLastEdited?: string;
|
dateLastEdited?: string;
|
||||||
dateCreated!: string;
|
|
||||||
utcDateLastEdited?: string;
|
utcDateLastEdited?: string;
|
||||||
utcDateCreated!: string;
|
|
||||||
contentLength?: number;
|
contentLength?: number;
|
||||||
content?: string | Buffer;
|
content?: string | Buffer;
|
||||||
|
|
||||||
@ -164,7 +161,9 @@ class BRevision extends AbstractBeccaEntity<BRevision> {
|
|||||||
* Revisions are not soft-deletable, they are immediately hard-deleted (erased).
|
* Revisions are not soft-deletable, they are immediately hard-deleted (erased).
|
||||||
*/
|
*/
|
||||||
eraseRevision() {
|
eraseRevision() {
|
||||||
require("../../services/erase.js").eraseRevisions([this.revisionId]);
|
if (this.revisionId) {
|
||||||
|
eraseService.eraseRevisions([this.revisionId]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
@ -211,4 +210,4 @@ class BRevision extends AbstractBeccaEntity<BRevision> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = BRevision;
|
export default BRevision;
|
||||||
|
@ -42,7 +42,7 @@ export interface OptionRow {
|
|||||||
name: string;
|
name: string;
|
||||||
value: string;
|
value: string;
|
||||||
isSynced: boolean;
|
isSynced: boolean;
|
||||||
utcDateModified: string;
|
utcDateModified?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EtapiTokenRow {
|
export interface EtapiTokenRow {
|
||||||
@ -69,7 +69,7 @@ export interface AttributeRow {
|
|||||||
noteId?: string;
|
noteId?: string;
|
||||||
type: AttributeType;
|
type: AttributeType;
|
||||||
name: string;
|
name: string;
|
||||||
position?: number;
|
position?: number | null;
|
||||||
value?: string;
|
value?: string;
|
||||||
isInheritable?: boolean;
|
isInheritable?: boolean;
|
||||||
utcDateModified?: string;
|
utcDateModified?: string;
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { ConstructorData } from './becca-interface';
|
import { ConstructorData } from './becca-interface.js';
|
||||||
import AbstractBeccaEntity = require('./entities/abstract_becca_entity');
|
import AbstractBeccaEntity from "./entities/abstract_becca_entity.js";
|
||||||
import BAttachment = require('./entities/battachment');
|
import BAttachment from "./entities/battachment.js";
|
||||||
import BAttribute = require('./entities/battribute');
|
import BAttribute from "./entities/battribute.js";
|
||||||
import BBlob = require('./entities/bblob');
|
import BBlob from "./entities/bblob.js";
|
||||||
import BBranch = require('./entities/bbranch');
|
import BBranch from "./entities/bbranch.js";
|
||||||
import BEtapiToken = require('./entities/betapi_token');
|
import BEtapiToken from "./entities/betapi_token.js";
|
||||||
import BNote = require('./entities/bnote');
|
import BNote from "./entities/bnote.js";
|
||||||
import BOption = require('./entities/boption');
|
import BOption from "./entities/boption.js";
|
||||||
import BRecentNote = require('./entities/brecent_note');
|
import BRecentNote from "./entities/brecent_note.js";
|
||||||
import BRevision = require('./entities/brevision');
|
import BRevision from "./entities/brevision.js";
|
||||||
|
|
||||||
type EntityClass = new (row?: any) => AbstractBeccaEntity<any>;
|
type EntityClass = new (row?: any) => AbstractBeccaEntity<any>;
|
||||||
|
|
||||||
@ -32,6 +32,6 @@ function getEntityFromEntityName(entityName: keyof typeof ENTITY_NAME_TO_ENTITY)
|
|||||||
return ENTITY_NAME_TO_ENTITY[entityName];
|
return ENTITY_NAME_TO_ENTITY[entityName];
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getEntityFromEntityName
|
getEntityFromEntityName
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import becca = require('./becca');
|
import becca from "./becca.js";
|
||||||
import log = require('../services/log');
|
import log from "../services/log.js";
|
||||||
import beccaService = require('./becca_service');
|
import beccaService from "./becca_service.js";
|
||||||
import dateUtils = require('../services/date_utils');
|
import dateUtils from "../services/date_utils.js";
|
||||||
import { JSDOM } from "jsdom";
|
import { JSDOM } from "jsdom";
|
||||||
import BNote = require('./entities/bnote');
|
import BNote from "./entities/bnote.js";
|
||||||
|
|
||||||
const DEBUG = false;
|
const DEBUG = false;
|
||||||
|
|
||||||
@ -461,6 +461,6 @@ function setImmediatePromise() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
findSimilarNotes
|
findSimilarNotes
|
||||||
};
|
};
|
||||||
|
@ -6,4 +6,4 @@ class NotFoundError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = NotFoundError;
|
export default NotFoundError;
|
@ -6,4 +6,4 @@ class ValidationError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = ValidationError;
|
export default ValidationError;
|
@ -1,6 +1,6 @@
|
|||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
import appInfo = require('../services/app_info');
|
import appInfo from "../services/app_info.js";
|
||||||
import eu = require('./etapi_utils');
|
import eu from "./etapi_utils.js";
|
||||||
|
|
||||||
function register(router: Router) {
|
function register(router: Router) {
|
||||||
eu.route(router, 'get', '/etapi/app-info', (req, res, next) => {
|
eu.route(router, 'get', '/etapi/app-info', (req, res, next) => {
|
||||||
@ -8,6 +8,6 @@ function register(router: Router) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import becca = require('../becca/becca');
|
import becca from "../becca/becca.js";
|
||||||
import eu = require('./etapi_utils');
|
import eu from "./etapi_utils.js";
|
||||||
import mappers = require('./mappers');
|
import mappers from "./mappers.js";
|
||||||
import v = require('./validators');
|
import v from "./validators.js";
|
||||||
import utils = require('../services/utils');
|
import utils from "../services/utils.js";
|
||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
import { AttachmentRow } from '../becca/entities/rows';
|
import { AttachmentRow } from '../becca/entities/rows.js';
|
||||||
import { ValidatorMap } from './etapi-interface';
|
import { ValidatorMap } from './etapi-interface.js';
|
||||||
|
|
||||||
function register(router: Router) {
|
function register(router: Router) {
|
||||||
const ALLOWED_PROPERTIES_FOR_CREATE_ATTACHMENT: ValidatorMap = {
|
const ALLOWED_PROPERTIES_FOR_CREATE_ATTACHMENT: ValidatorMap = {
|
||||||
@ -104,6 +104,6 @@ function register(router: Router) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import becca = require('../becca/becca');
|
import becca from "../becca/becca.js";
|
||||||
import eu = require('./etapi_utils');
|
import eu from "./etapi_utils.js";
|
||||||
import mappers = require('./mappers');
|
import mappers from "./mappers.js";
|
||||||
import attributeService = require('../services/attributes');
|
import attributeService from "../services/attributes.js";
|
||||||
import v = require('./validators');
|
import v from "./validators.js";
|
||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
import { AttributeRow } from '../becca/entities/rows';
|
import { AttributeRow } from '../becca/entities/rows.js';
|
||||||
import { ValidatorMap } from './etapi-interface';
|
import { ValidatorMap } from './etapi-interface.js';
|
||||||
|
|
||||||
function register(router: Router) {
|
function register(router: Router) {
|
||||||
eu.route(router, 'get', '/etapi/attributes/:attributeId', (req, res, next) => {
|
eu.route(router, 'get', '/etapi/attributes/:attributeId', (req, res, next) => {
|
||||||
@ -81,6 +81,6 @@ function register(router: Router) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import becca = require('../becca/becca');
|
import becca from "../becca/becca.js";
|
||||||
import eu = require('./etapi_utils');
|
import eu from "./etapi_utils.js";
|
||||||
import passwordEncryptionService = require('../services/encryption/password_encryption');
|
import passwordEncryptionService from "../services/encryption/password_encryption.js";
|
||||||
import etapiTokenService = require('../services/etapi_tokens');
|
import etapiTokenService from "../services/etapi_tokens.js";
|
||||||
import { RequestHandler, Router } from 'express';
|
import { RequestHandler, Router } from 'express';
|
||||||
|
|
||||||
function register(router: Router, loginMiddleware: RequestHandler[]) {
|
function register(router: Router, loginMiddleware: RequestHandler[]) {
|
||||||
@ -39,6 +39,6 @@ function register(router: Router, loginMiddleware: RequestHandler[]) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Router } from "express";
|
import { Router } from "express";
|
||||||
|
|
||||||
import eu = require('./etapi_utils');
|
import eu from "./etapi_utils.js";
|
||||||
import backupService = require('../services/backup');
|
import backupService from "../services/backup.js";
|
||||||
|
|
||||||
function register(router: Router) {
|
function register(router: Router) {
|
||||||
eu.route(router, 'put', '/etapi/backup/:backupName', async (req, res, next) => {
|
eu.route(router, 'put', '/etapi/backup/:backupName', async (req, res, next) => {
|
||||||
@ -11,6 +11,6 @@ function register(router: Router) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
};
|
};
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { Router } from "express";
|
import { Router } from "express";
|
||||||
|
|
||||||
import becca = require('../becca/becca');
|
import becca from "../becca/becca.js";
|
||||||
import eu = require('./etapi_utils');
|
import eu from "./etapi_utils.js";
|
||||||
import mappers = require('./mappers');
|
import mappers from "./mappers.js";
|
||||||
import BBranch = require('../becca/entities/bbranch');
|
import BBranch from "../becca/entities/bbranch.js";
|
||||||
import entityChangesService = require('../services/entity_changes');
|
import entityChangesService from "../services/entity_changes.js";
|
||||||
import v = require('./validators');
|
import v from "./validators.js";
|
||||||
import { BranchRow } from "../becca/entities/rows";
|
import { BranchRow } from "../becca/entities/rows.js";
|
||||||
|
|
||||||
function register(router: Router) {
|
function register(router: Router) {
|
||||||
eu.route(router, 'get', '/etapi/branches/:branchId', (req, res, next) => {
|
eu.route(router, 'get', '/etapi/branches/:branchId', (req, res, next) => {
|
||||||
@ -84,6 +84,6 @@ function register(router: Router) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
};
|
};
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import cls = require('../services/cls');
|
import cls from "../services/cls.js";
|
||||||
import sql = require('../services/sql');
|
import sql from "../services/sql.js";
|
||||||
import log = require('../services/log');
|
import log from "../services/log.js";
|
||||||
import becca = require('../becca/becca');
|
import becca from "../becca/becca.js";
|
||||||
import etapiTokenService = require('../services/etapi_tokens');
|
import etapiTokenService from "../services/etapi_tokens.js";
|
||||||
import config = require('../services/config');
|
import config from "../services/config.js";
|
||||||
import { NextFunction, Request, RequestHandler, Response, Router } from 'express';
|
import { NextFunction, Request, RequestHandler, Response, Router } from 'express';
|
||||||
import { AppRequest, AppRequestHandler } from '../routes/route-interface';
|
import { AppRequest, AppRequestHandler } from '../routes/route-interface.js';
|
||||||
import { ValidatorMap } from './etapi-interface';
|
import { ValidatorMap } from './etapi-interface.js';
|
||||||
const GENERIC_CODE = "GENERIC";
|
const GENERIC_CODE = "GENERIC";
|
||||||
|
|
||||||
type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head";
|
type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head";
|
||||||
@ -146,7 +146,7 @@ function validateAndPatch(target: any, source: any, allowedProperties: Validator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
EtapiError,
|
EtapiError,
|
||||||
sendError,
|
sendError,
|
||||||
route,
|
route,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import BAttachment = require("../becca/entities/battachment");
|
import BAttachment from "../becca/entities/battachment.js";
|
||||||
import BAttribute = require("../becca/entities/battribute");
|
import BAttribute from "../becca/entities/battribute.js";
|
||||||
import BBranch = require("../becca/entities/bbranch");
|
import BBranch from "../becca/entities/bbranch.js";
|
||||||
import BNote = require("../becca/entities/bnote");
|
import BNote from "../becca/entities/bnote.js";
|
||||||
|
|
||||||
function mapNoteToPojo(note: BNote) {
|
function mapNoteToPojo(note: BNote) {
|
||||||
return {
|
return {
|
||||||
@ -64,7 +64,7 @@ function mapAttachmentToPojo(attachment: BAttachment) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
mapNoteToPojo,
|
mapNoteToPojo,
|
||||||
mapBranchToPojo,
|
mapBranchToPojo,
|
||||||
mapAttributeToPojo,
|
mapAttributeToPojo,
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
import becca = require('../becca/becca');
|
import becca from "../becca/becca.js";
|
||||||
import utils = require('../services/utils');
|
import utils from "../services/utils.js";
|
||||||
import eu = require('./etapi_utils');
|
import eu from "./etapi_utils.js";
|
||||||
import mappers = require('./mappers');
|
import mappers from "./mappers.js";
|
||||||
import noteService = require('../services/notes');
|
import noteService from "../services/notes.js";
|
||||||
import TaskContext = require('../services/task_context');
|
import TaskContext from "../services/task_context.js";
|
||||||
import v = require('./validators');
|
import v from "./validators.js";
|
||||||
import searchService = require('../services/search/services/search');
|
import searchService from "../services/search/services/search.js";
|
||||||
import SearchContext = require('../services/search/search_context');
|
import SearchContext from "../services/search/search_context.js";
|
||||||
import zipExportService = require('../services/export/zip');
|
import zipExportService from "../services/export/zip.js";
|
||||||
import zipImportService = require('../services/import/zip');
|
import zipImportService from "../services/import/zip.js";
|
||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
import { AppRequest } from '../routes/route-interface';
|
import { AppRequest } from '../routes/route-interface.js';
|
||||||
import { ParsedQs } from 'qs';
|
import { ParsedQs } from 'qs';
|
||||||
import { NoteParams } from '../services/note-interface';
|
import { NoteParams } from '../services/note-interface.js';
|
||||||
import BNote = require('../becca/entities/bnote');
|
import { SearchParams } from '../services/search/services/types.js';
|
||||||
import { SearchParams } from '../services/search/services/types';
|
import { ValidatorMap } from './etapi-interface.js';
|
||||||
import { ValidatorMap } from './etapi-interface';
|
|
||||||
|
|
||||||
function register(router: Router) {
|
function register(router: Router) {
|
||||||
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
|
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
|
||||||
@ -267,6 +266,6 @@ function parseInteger(obj: any, name: string) {
|
|||||||
return integer;
|
return integer;
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { Router } from "express";
|
import { Router } from "express";
|
||||||
|
|
||||||
import fs = require('fs');
|
import fs from "fs";
|
||||||
import path = require('path');
|
import path from "path";
|
||||||
|
|
||||||
const specPath = path.join(__dirname, 'etapi.openapi.yaml');
|
import { fileURLToPath } from "url";
|
||||||
|
const specPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'etapi.openapi.yaml');
|
||||||
let spec: string | null = null;
|
let spec: string | null = null;
|
||||||
|
|
||||||
function register(router: Router) {
|
function register(router: Router) {
|
||||||
@ -17,6 +18,6 @@ function register(router: Router) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import specialNotesService = require('../services/special_notes');
|
import specialNotesService from "../services/special_notes.js";
|
||||||
import dateNotesService = require('../services/date_notes');
|
import dateNotesService from "../services/date_notes.js";
|
||||||
import eu = require('./etapi_utils');
|
import eu from "./etapi_utils.js";
|
||||||
import mappers = require('./mappers');
|
import mappers from "./mappers.js";
|
||||||
import { Router } from 'express';
|
import { Router } from 'express';
|
||||||
|
|
||||||
const getDateInvalidError = (date: string) => new eu.EtapiError(400, "DATE_INVALID", `Date "${date}" is not valid.`);
|
const getDateInvalidError = (date: string) => new eu.EtapiError(400, "DATE_INVALID", `Date "${date}" is not valid.`);
|
||||||
@ -73,6 +73,6 @@ function register(router: Router) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
register
|
register
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import noteTypeService = require('../services/note_types');
|
import noteTypeService from "../services/note_types.js";
|
||||||
import dateUtils = require('../services/date_utils');
|
import dateUtils from "../services/date_utils.js";
|
||||||
|
import becca from "../becca/becca.js";
|
||||||
|
|
||||||
function mandatory(obj: unknown) {
|
function mandatory(obj: unknown) {
|
||||||
if (obj === undefined) {
|
if (obj === undefined) {
|
||||||
@ -64,8 +65,6 @@ function isNoteId(obj: unknown) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const becca = require('../becca/becca');
|
|
||||||
|
|
||||||
if (typeof obj !== 'string') {
|
if (typeof obj !== 'string') {
|
||||||
return `'${obj}' is not a valid noteId`;
|
return `'${obj}' is not a valid noteId`;
|
||||||
}
|
}
|
||||||
@ -107,7 +106,7 @@ function isValidEntityId(obj: unknown) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
mandatory,
|
mandatory,
|
||||||
notNull,
|
notNull,
|
||||||
isString,
|
isString,
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import appInfo = require('../../services/app_info');
|
import appInfo from "../../services/app_info.js";
|
||||||
|
|
||||||
function getAppInfo() {
|
function getAppInfo() {
|
||||||
return appInfo;
|
return appInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getAppInfo
|
getAppInfo
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import blobService = require('../../services/blob');
|
import blobService from "../../services/blob.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import imageService = require("../../services/image");
|
import imageService from "../../services/image.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
function getAttachmentBlob(req: Request) {
|
function getAttachmentBlob(req: Request) {
|
||||||
@ -97,7 +97,7 @@ function convertAttachmentToNote(req: Request) {
|
|||||||
return attachment.convertToNote();
|
return attachment.convertToNote();
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getAttachmentBlob,
|
getAttachmentBlob,
|
||||||
getAttachments,
|
getAttachments,
|
||||||
getAttachment,
|
getAttachment,
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import attributeService = require('../../services/attributes');
|
import attributeService from "../../services/attributes.js";
|
||||||
import BAttribute = require('../../becca/entities/battribute');
|
import BAttribute from "../../becca/entities/battribute.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
function getEffectiveNoteAttributes(req: Request) {
|
function getEffectiveNoteAttributes(req: Request) {
|
||||||
@ -238,7 +238,7 @@ function deleteRelation(req: Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
updateNoteAttributes,
|
updateNoteAttributes,
|
||||||
updateNoteAttribute,
|
updateNoteAttribute,
|
||||||
setNoteAttribute,
|
setNoteAttribute,
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import beccaService = require('../../becca/becca_service');
|
import beccaService from "../../becca/becca_service.js";
|
||||||
import searchService = require('../../services/search/services/search');
|
import searchService from "../../services/search/services/search.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import cls = require('../../services/cls');
|
import cls from "../../services/cls.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
|
|
||||||
function getAutocomplete(req: Request) {
|
function getAutocomplete(req: Request) {
|
||||||
if (typeof req.query.query !== "string") {
|
if (typeof req.query.query !== "string") {
|
||||||
@ -75,6 +75,6 @@ function getRecentNotes(activeNoteId: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getAutocomplete
|
getAutocomplete
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import fs = require('fs');
|
import fs from "fs";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import dataDir = require('../../services/data_dir');
|
import dataDir from "../../services/data_dir.js";
|
||||||
const { LOG_DIR } = dataDir;
|
const { LOG_DIR } = dataDir;
|
||||||
|
|
||||||
function getBackendLog() {
|
function getBackendLog() {
|
||||||
@ -17,6 +17,6 @@ function getBackendLog() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getBackendLog
|
getBackendLog
|
||||||
};
|
};
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import entityChangesService = require('../../services/entity_changes');
|
import entityChangesService from "../../services/entity_changes.js";
|
||||||
import treeService = require('../../services/tree');
|
import treeService from "../../services/tree.js";
|
||||||
import eraseService = require('../../services/erase');
|
import eraseService from "../../services/erase.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import TaskContext = require('../../services/task_context');
|
import TaskContext from "../../services/task_context.js";
|
||||||
import branchService = require('../../services/branches');
|
import branchService from "../../services/branches.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import eventService = require("../../services/events");
|
import eventService from "../../services/events.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -224,7 +224,7 @@ function setPrefix(req: Request) {
|
|||||||
branch.save();
|
branch.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
moveBranchToParent,
|
moveBranchToParent,
|
||||||
moveBranchBeforeNote,
|
moveBranchBeforeNote,
|
||||||
moveBranchAfterNote,
|
moveBranchAfterNote,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import bulkActionService = require('../../services/bulk_actions');
|
import bulkActionService from "../../services/bulk_actions.js";
|
||||||
|
|
||||||
function execute(req: Request) {
|
function execute(req: Request) {
|
||||||
const {noteIds, includeDescendants} = req.body;
|
const {noteIds, includeDescendants} = req.body;
|
||||||
@ -43,7 +43,7 @@ function getAffectedNoteIds(noteIds: string[], includeDescendants: boolean) {
|
|||||||
return affectedNoteIds;
|
return affectedNoteIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
execute,
|
execute,
|
||||||
getAffectedNoteCount
|
getAffectedNoteCount
|
||||||
};
|
};
|
||||||
|
@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
import { Request } from "express";
|
import { Request } from "express";
|
||||||
|
|
||||||
import attributeService = require('../../services/attributes');
|
import attributeService from "../../services/attributes.js";
|
||||||
import cloneService = require('../../services/cloning');
|
import cloneService from "../../services/cloning.js";
|
||||||
import noteService = require('../../services/notes');
|
import noteService from "../../services/notes.js";
|
||||||
import dateNoteService = require('../../services/date_notes');
|
import dateNoteService from "../../services/date_notes.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import imageService = require('../../services/image');
|
import imageService from "../../services/image.js";
|
||||||
import appInfo = require('../../services/app_info');
|
import appInfo from "../../services/app_info.js";
|
||||||
import ws = require('../../services/ws');
|
import ws from "../../services/ws.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import path = require('path');
|
import path from "path";
|
||||||
import htmlSanitizer = require('../../services/html_sanitizer');
|
import htmlSanitizer from "../../services/html_sanitizer.js";
|
||||||
import attributeFormatter = require('../../services/attribute_formatter');
|
import attributeFormatter from "../../services/attribute_formatter.js";
|
||||||
import jsdom = require("jsdom");
|
import jsdom from "jsdom";
|
||||||
import BNote = require("../../becca/entities/bnote");
|
import BNote from "../../becca/entities/bnote.js";
|
||||||
import ValidationError = require("../../errors/validation_error");
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
const { JSDOM } = jsdom;
|
const { JSDOM } = jsdom;
|
||||||
|
|
||||||
interface Image {
|
interface Image {
|
||||||
@ -229,7 +229,7 @@ function findNotesByUrl(req: Request){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
createNote,
|
createNote,
|
||||||
addClipping,
|
addClipping,
|
||||||
openNote,
|
openNote,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import cloningService = require('../../services/cloning');
|
import cloningService from "../../services/cloning.js";
|
||||||
|
|
||||||
function cloneNoteToBranch(req: Request) {
|
function cloneNoteToBranch(req: Request) {
|
||||||
const {noteId, parentBranchId} = req.params;
|
const {noteId, parentBranchId} = req.params;
|
||||||
@ -29,7 +29,7 @@ function toggleNoteInParent(req: Request) {
|
|||||||
return cloningService.toggleNoteInParent(present === 'true', noteId, parentNoteId);
|
return cloningService.toggleNoteInParent(present === 'true', noteId, parentNoteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
cloneNoteToBranch,
|
cloneNoteToBranch,
|
||||||
cloneNoteToParentNote,
|
cloneNoteToParentNote,
|
||||||
cloneNoteAfter,
|
cloneNoteAfter,
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import backupService = require('../../services/backup');
|
import backupService from "../../services/backup.js";
|
||||||
import anonymizationService = require('../../services/anonymization');
|
import anonymizationService from "../../services/anonymization.js";
|
||||||
import consistencyChecksService = require('../../services/consistency_checks');
|
import consistencyChecksService from "../../services/consistency_checks.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
|
|
||||||
function getExistingBackups() {
|
function getExistingBackups() {
|
||||||
return backupService.getExistingBackups();
|
return backupService.getExistingBackups();
|
||||||
@ -49,7 +49,7 @@ function checkIntegrity() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getExistingBackups,
|
getExistingBackups,
|
||||||
backupDatabase,
|
backupDatabase,
|
||||||
vacuumDatabase,
|
vacuumDatabase,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import etapiTokenService = require('../../services/etapi_tokens');
|
import etapiTokenService from "../../services/etapi_tokens.js";
|
||||||
|
|
||||||
function getTokens() {
|
function getTokens() {
|
||||||
const tokens = etapiTokenService.getTokens();
|
const tokens = etapiTokenService.getTokens();
|
||||||
@ -21,7 +21,7 @@ function deleteToken(req: Request) {
|
|||||||
etapiTokenService.deleteToken(req.params.etapiTokenId);
|
etapiTokenService.deleteToken(req.params.etapiTokenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getTokens,
|
getTokens,
|
||||||
createToken,
|
createToken,
|
||||||
patchToken,
|
patchToken,
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import zipExportService = require('../../services/export/zip');
|
import zipExportService from "../../services/export/zip.js";
|
||||||
import singleExportService = require('../../services/export/single');
|
import singleExportService from "../../services/export/single.js";
|
||||||
import opmlExportService = require('../../services/export/opml');
|
import opmlExportService from "../../services/export/opml.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import TaskContext = require('../../services/task_context');
|
import TaskContext from "../../services/task_context.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import NotFoundError = require('../../errors/not_found_error');
|
import NotFoundError from "../../errors/not_found_error.js";
|
||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
|
|
||||||
function exportBranch(req: Request, res: Response) {
|
function exportBranch(req: Request, res: Response) {
|
||||||
const {branchId, type, format, version, taskId} = req.params;
|
const {branchId, type, format, version, taskId} = req.params;
|
||||||
@ -55,6 +55,6 @@ function exportBranch(req: Request, res: Response) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
exportBranch
|
exportBranch
|
||||||
};
|
};
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import protectedSessionService = require('../../services/protected_session');
|
import protectedSessionService from "../../services/protected_session.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import noteService = require('../../services/notes');
|
import noteService from "../../services/notes.js";
|
||||||
import tmp = require('tmp');
|
import tmp from "tmp";
|
||||||
import fs = require('fs');
|
import fs from "fs";
|
||||||
import { Readable } from 'stream';
|
import { Readable } from 'stream';
|
||||||
import chokidar = require('chokidar');
|
import chokidar from "chokidar";
|
||||||
import ws = require('../../services/ws');
|
import ws from "../../services/ws.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import BNote = require('../../becca/entities/bnote');
|
import BNote from "../../becca/entities/bnote.js";
|
||||||
import BAttachment = require('../../becca/entities/battachment');
|
import BAttachment from "../../becca/entities/battachment.js";
|
||||||
import { AppRequest } from '../route-interface';
|
import { AppRequest } from '../route-interface.js';
|
||||||
|
|
||||||
function updateFile(req: AppRequest) {
|
function updateFile(req: AppRequest) {
|
||||||
const note = becca.getNoteOrThrow(req.params.noteId);
|
const note = becca.getNoteOrThrow(req.params.noteId);
|
||||||
@ -245,7 +245,7 @@ function uploadModifiedFileToAttachment(req: Request) {
|
|||||||
attachment.setContent(fileContent);
|
attachment.setContent(fileContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
updateFile,
|
updateFile,
|
||||||
updateAttachment,
|
updateAttachment,
|
||||||
openFile,
|
openFile,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import optionService = require('../../services/options');
|
import optionService from "../../services/options.js";
|
||||||
|
|
||||||
function getFontCss(req: Request, res: Response) {
|
function getFontCss(req: Request, res: Response) {
|
||||||
res.setHeader('Content-Type', 'text/css');
|
res.setHeader('Content-Type', 'text/css');
|
||||||
@ -35,6 +35,6 @@ function getFontCss(req: Request, res: Response) {
|
|||||||
res.send(style);
|
res.send(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getFontCss
|
getFontCss
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import imageService = require('../../services/image');
|
import imageService from "../../services/image.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
const RESOURCE_DIR = require('../../services/resource_dir').RESOURCE_DIR;
|
import fs from "fs";
|
||||||
import fs = require('fs');
|
|
||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import BNote = require('../../becca/entities/bnote');
|
import BNote from "../../becca/entities/bnote.js";
|
||||||
import BRevision = require('../../becca/entities/brevision');
|
import BRevision from "../../becca/entities/brevision.js";
|
||||||
import { AppRequest } from '../route-interface';
|
import { AppRequest } from '../route-interface.js';
|
||||||
|
import { RESOURCE_DIR } from "../../services/resource_dir.js";
|
||||||
|
|
||||||
function returnImageFromNote(req: Request, res: Response) {
|
function returnImageFromNote(req: Request, res: Response) {
|
||||||
const image = becca.getNote(req.params.noteId);
|
const image = becca.getNote(req.params.noteId);
|
||||||
@ -112,7 +112,7 @@ function updateImage(req: AppRequest) {
|
|||||||
return { uploaded: true };
|
return { uploaded: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
returnImageFromNote,
|
returnImageFromNote,
|
||||||
returnImageFromRevision,
|
returnImageFromRevision,
|
||||||
returnAttachedImage,
|
returnAttachedImage,
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import enexImportService = require('../../services/import/enex');
|
import enexImportService from "../../services/import/enex.js";
|
||||||
import opmlImportService = require('../../services/import/opml');
|
import opmlImportService from "../../services/import/opml.js";
|
||||||
import zipImportService = require('../../services/import/zip');
|
import zipImportService from "../../services/import/zip.js";
|
||||||
import singleImportService = require('../../services/import/single');
|
import singleImportService from "../../services/import/single.js";
|
||||||
import cls = require('../../services/cls');
|
import cls from "../../services/cls.js";
|
||||||
import path = require('path');
|
import path from "path";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import beccaLoader = require('../../becca/becca_loader');
|
import beccaLoader from "../../becca/becca_loader.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import TaskContext = require('../../services/task_context');
|
import TaskContext from "../../services/task_context.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import BNote = require('../../becca/entities/bnote');
|
import BNote from "../../becca/entities/bnote.js";
|
||||||
import { AppRequest } from '../route-interface';
|
import { AppRequest } from '../route-interface.js';
|
||||||
|
|
||||||
async function importNotesToBranch(req: AppRequest) {
|
async function importNotesToBranch(req: AppRequest) {
|
||||||
const { parentNoteId } = req.params;
|
const { parentNoteId } = req.params;
|
||||||
@ -136,7 +136,7 @@ async function importAttachmentsToNote(req: AppRequest) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
importNotesToBranch,
|
importNotesToBranch,
|
||||||
importAttachmentsToNote
|
importAttachmentsToNote
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import keyboardActions = require('../../services/keyboard_actions');
|
import keyboardActions from "../../services/keyboard_actions.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
|
|
||||||
function getKeyboardActions() {
|
function getKeyboardActions() {
|
||||||
return keyboardActions.getKeyboardActions();
|
return keyboardActions.getKeyboardActions();
|
||||||
@ -14,7 +14,7 @@ function getShortcutsForNotes() {
|
|||||||
return labels.filter(attr => becca.getNote(attr.noteId)?.type !== 'launcher');
|
return labels.filter(attr => becca.getNote(attr.noteId)?.type !== 'launcher');
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getKeyboardActions,
|
getKeyboardActions,
|
||||||
getShortcutsForNotes
|
getShortcutsForNotes
|
||||||
};
|
};
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import options = require('../../services/options');
|
import options from "../../services/options.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import instanceId = require('../../services/instance_id');
|
import instanceId from "../../services/instance_id.js";
|
||||||
import passwordEncryptionService = require('../../services/encryption/password_encryption');
|
import passwordEncryptionService from "../../services/encryption/password_encryption.js";
|
||||||
import protectedSessionService = require('../../services/protected_session');
|
import protectedSessionService from "../../services/protected_session.js";
|
||||||
import appInfo = require('../../services/app_info');
|
import appInfo from "../../services/app_info.js";
|
||||||
import eventService = require('../../services/events');
|
import eventService from "../../services/events.js";
|
||||||
import sqlInit = require('../../services/sql_init');
|
import sqlInit from "../../services/sql_init.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import ws = require('../../services/ws');
|
import ws from "../../services/ws.js";
|
||||||
import etapiTokenService = require('../../services/etapi_tokens');
|
import etapiTokenService from "../../services/etapi_tokens.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import { AppRequest } from '../route-interface';
|
import { AppRequest } from '../route-interface.js';
|
||||||
|
|
||||||
function loginSync(req: AppRequest) {
|
function loginSync(req: AppRequest) {
|
||||||
if (!sqlInit.schemaExists()) {
|
if (!sqlInit.schemaExists()) {
|
||||||
@ -110,7 +110,7 @@ function token(req: Request) {
|
|||||||
return { token: authToken };
|
return { token: authToken };
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
loginSync,
|
loginSync,
|
||||||
loginToProtectedSession,
|
loginToProtectedSession,
|
||||||
logoutFromProtectedSession,
|
logoutFromProtectedSession,
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import { JSDOM } from "jsdom";
|
import { JSDOM } from "jsdom";
|
||||||
import BNote = require('../../becca/entities/bnote');
|
import BNote from "../../becca/entities/bnote.js";
|
||||||
import BAttribute = require('../../becca/entities/battribute');
|
import BAttribute from "../../becca/entities/battribute.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
function buildDescendantCountMap(noteIdsToCount: string[]) {
|
function buildDescendantCountMap(noteIdsToCount: string[]) {
|
||||||
@ -384,7 +384,7 @@ function getBacklinks(req: Request) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getLinkMap,
|
getLinkMap,
|
||||||
getTreeMap,
|
getTreeMap,
|
||||||
getBacklinkCount,
|
getBacklinkCount,
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import noteService = require('../../services/notes');
|
import noteService from "../../services/notes.js";
|
||||||
import eraseService = require('../../services/erase');
|
import eraseService from "../../services/erase.js";
|
||||||
import treeService = require('../../services/tree');
|
import treeService from "../../services/tree.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import TaskContext = require('../../services/task_context');
|
import TaskContext from "../../services/task_context.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import blobService = require('../../services/blob');
|
import blobService from "../../services/blob.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import BBranch = require('../../becca/entities/bbranch');
|
import BBranch from "../../becca/entities/bbranch.js";
|
||||||
import { AttributeRow } from '../../becca/entities/rows';
|
import { AttributeRow } from '../../becca/entities/rows.js';
|
||||||
|
|
||||||
function getNote(req: Request) {
|
function getNote(req: Request) {
|
||||||
return becca.getNoteOrThrow(req.params.noteId);
|
return becca.getNoteOrThrow(req.params.noteId);
|
||||||
@ -250,7 +250,7 @@ function convertNoteToAttachment(req: Request) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getNote,
|
getNote,
|
||||||
getNoteBlob,
|
getNoteBlob,
|
||||||
getNoteMetadata,
|
getNoteMetadata,
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import optionService = require('../../services/options');
|
import optionService from "../../services/options.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import searchService = require('../../services/search/services/search');
|
import searchService from "../../services/search/services/search.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
// options allowed to be updated directly in the Options dialog
|
// options allowed to be updated directly in the Options dialog
|
||||||
@ -136,7 +136,7 @@ function isAllowed(name: string) {
|
|||||||
|| name.startsWith("hideArchivedNotes");
|
|| name.startsWith("hideArchivedNotes");
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getOptions,
|
getOptions,
|
||||||
updateOption,
|
updateOption,
|
||||||
updateOptions,
|
updateOptions,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Request } from "express";
|
import { Request } from "express";
|
||||||
|
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import markdownService = require('../../services/import/markdown');
|
import markdownService from "../../services/import/markdown.js";
|
||||||
|
|
||||||
function getIconUsage() {
|
function getIconUsage() {
|
||||||
const iconClassToCountMap: Record<string, number> = {};
|
const iconClassToCountMap: Record<string, number> = {};
|
||||||
@ -35,7 +35,7 @@ function renderMarkdown(req: Request) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getIconUsage,
|
getIconUsage,
|
||||||
renderMarkdown
|
renderMarkdown
|
||||||
};
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import passwordService = require('../../services/encryption/password');
|
import passwordService from "../../services/encryption/password.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
function changePassword(req: Request) {
|
function changePassword(req: Request) {
|
||||||
@ -22,7 +22,7 @@ function resetPassword(req: Request) {
|
|||||||
return passwordService.resetPassword();
|
return passwordService.resetPassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
changePassword,
|
changePassword,
|
||||||
resetPassword
|
resetPassword
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import protectedSessionService = require('../../services/protected_session');
|
import protectedSessionService from "../../services/protected_session.js";
|
||||||
import noteService = require('../../services/notes');
|
import noteService from "../../services/notes.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import { RevisionRow } from '../../becca/entities/rows';
|
import { RevisionRow } from '../../becca/entities/rows.js';
|
||||||
|
|
||||||
interface RecentChangeRow {
|
interface RecentChangeRow {
|
||||||
noteId: string;
|
noteId: string;
|
||||||
@ -111,6 +111,6 @@ function getRecentChanges(req: Request) {
|
|||||||
return recentChanges;
|
return recentChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getRecentChanges
|
getRecentChanges
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import BRecentNote = require('../../becca/entities/brecent_note');
|
import BRecentNote from "../../becca/entities/brecent_note.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import dateUtils = require('../../services/date_utils');
|
import dateUtils from "../../services/date_utils.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
function addRecentNote(req: Request) {
|
function addRecentNote(req: Request) {
|
||||||
@ -19,6 +19,6 @@ function addRecentNote(req: Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
addRecentNote
|
addRecentNote
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
|
|
||||||
interface ResponseData {
|
interface ResponseData {
|
||||||
noteTitles: Record<string, string>;
|
noteTitles: Record<string, string>;
|
||||||
@ -76,6 +76,6 @@ function getRelationMap(req: Request) {
|
|||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getRelationMap
|
getRelationMap
|
||||||
};
|
};
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import beccaService = require('../../becca/becca_service');
|
import beccaService from "../../becca/becca_service.js";
|
||||||
import revisionService = require('../../services/revisions');
|
import revisionService from "../../services/revisions.js";
|
||||||
import utils = require('../../services/utils');
|
import utils from "../../services/utils.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import cls = require('../../services/cls');
|
import cls from "../../services/cls.js";
|
||||||
import path = require('path');
|
import path from "path";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import blobService = require('../../services/blob');
|
import blobService from "../../services/blob.js";
|
||||||
import eraseService = require("../../services/erase");
|
import eraseService from "../../services/erase.js";
|
||||||
import { Request, Response } from 'express';
|
import { Request, Response } from 'express';
|
||||||
import BRevision = require('../../becca/entities/brevision');
|
import BRevision from "../../becca/entities/brevision.js";
|
||||||
import BNote = require('../../becca/entities/bnote');
|
import BNote from "../../becca/entities/bnote.js";
|
||||||
import { NotePojo } from '../../becca/becca-interface';
|
import { NotePojo } from '../../becca/becca-interface.js';
|
||||||
|
|
||||||
interface NotePath {
|
interface NotePath {
|
||||||
noteId: string;
|
noteId: string;
|
||||||
@ -64,6 +64,10 @@ function getRevision(req: Request) {
|
|||||||
function getRevisionFilename(revision: BRevision) {
|
function getRevisionFilename(revision: BRevision) {
|
||||||
let filename = utils.formatDownloadTitle(revision.title, revision.type, revision.mime);
|
let filename = utils.formatDownloadTitle(revision.title, revision.type, revision.mime);
|
||||||
|
|
||||||
|
if (!revision.dateCreated) {
|
||||||
|
throw new Error("Missing creation date for revision.");
|
||||||
|
}
|
||||||
|
|
||||||
const extension = path.extname(filename);
|
const extension = path.extname(filename);
|
||||||
const date = revision.dateCreated
|
const date = revision.dateCreated
|
||||||
.substr(0, 19)
|
.substr(0, 19)
|
||||||
@ -200,7 +204,7 @@ function getNotePathData(note: BNote): NotePath | undefined {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getRevisionBlob,
|
getRevisionBlob,
|
||||||
getRevisions,
|
getRevisions,
|
||||||
getRevision,
|
getRevision,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import scriptService = require('../../services/script');
|
import scriptService from "../../services/script.js";
|
||||||
import attributeService = require('../../services/attributes');
|
import attributeService from "../../services/attributes.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import syncService = require('../../services/sync');
|
import syncService from "../../services/sync.js";
|
||||||
import sql = require('../../services/sql');
|
import sql from "../../services/sql.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
interface ScriptBody {
|
interface ScriptBody {
|
||||||
@ -131,7 +131,7 @@ function getBundle(req: Request) {
|
|||||||
return scriptService.getScriptBundleForFrontend(note, script, params);
|
return scriptService.getScriptBundleForFrontend(note, script, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
exec,
|
exec,
|
||||||
run,
|
run,
|
||||||
getStartupBundles,
|
getStartupBundles,
|
||||||
|
@ -2,21 +2,21 @@
|
|||||||
|
|
||||||
import { Request } from "express";
|
import { Request } from "express";
|
||||||
|
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
import SearchContext = require('../../services/search/search_context');
|
import SearchContext from "../../services/search/search_context.js";
|
||||||
import searchService = require('../../services/search/services/search');
|
import searchService, { EMPTY_RESULT, SearchNoteResult } from "../../services/search/services/search.js";
|
||||||
import bulkActionService = require('../../services/bulk_actions');
|
import bulkActionService from "../../services/bulk_actions.js";
|
||||||
import cls = require('../../services/cls');
|
import cls from "../../services/cls.js";
|
||||||
import attributeFormatter = require('../../services/attribute_formatter');
|
import attributeFormatter from "../../services/attribute_formatter.js";
|
||||||
import ValidationError = require('../../errors/validation_error');
|
import ValidationError from "../../errors/validation_error.js";
|
||||||
import SearchResult = require("../../services/search/search_result");
|
import SearchResult from "../../services/search/search_result.js";
|
||||||
|
|
||||||
function searchFromNote(req: Request) {
|
function searchFromNote(req: Request): SearchNoteResult {
|
||||||
const note = becca.getNoteOrThrow(req.params.noteId);
|
const note = becca.getNoteOrThrow(req.params.noteId);
|
||||||
|
|
||||||
if (!note) {
|
if (!note) {
|
||||||
// this can be triggered from recent changes, and it's harmless to return an empty list rather than fail
|
// this can be triggered from recent changes, and it's harmless to return an empty list rather than fail
|
||||||
return [];
|
return EMPTY_RESULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note.type !== 'search') {
|
if (note.type !== 'search') {
|
||||||
@ -126,7 +126,7 @@ function searchTemplates() {
|
|||||||
}).map(note => note.noteId);
|
}).map(note => note.noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
searchFromNote,
|
searchFromNote,
|
||||||
searchAndExecute,
|
searchAndExecute,
|
||||||
getRelatedNotes,
|
getRelatedNotes,
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import imageType = require('image-type');
|
import imageType from "image-type";
|
||||||
import imageService = require('../../services/image');
|
import imageService from "../../services/image.js";
|
||||||
import noteService = require('../../services/notes');
|
import noteService from "../../services/notes.js";
|
||||||
import sanitize_attribute_name = require('../../services/sanitize_attribute_name');
|
import sanitize_attribute_name from "../../services/sanitize_attribute_name.js";
|
||||||
import specialNotesService = require('../../services/special_notes');
|
import specialNotesService from "../../services/special_notes.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
import { AppRequest } from '../route-interface';
|
import { AppRequest } from '../route-interface.js';
|
||||||
|
|
||||||
function uploadImage(req: AppRequest) {
|
function uploadImage(req: AppRequest) {
|
||||||
const file = req.file;
|
const file = req.file;
|
||||||
@ -84,7 +84,7 @@ function saveNote(req: Request) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
uploadImage,
|
uploadImage,
|
||||||
saveNote
|
saveNote
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
import sqlInit = require('../../services/sql_init');
|
import sqlInit from "../../services/sql_init.js";
|
||||||
import setupService = require('../../services/setup');
|
import setupService from "../../services/setup.js";
|
||||||
import log = require('../../services/log');
|
import log from "../../services/log.js";
|
||||||
import appInfo = require('../../services/app_info');
|
import appInfo from "../../services/app_info.js";
|
||||||
import { Request } from 'express';
|
import { Request } from 'express';
|
||||||
|
|
||||||
function getStatus() {
|
function getStatus() {
|
||||||
@ -51,7 +51,7 @@ function getSyncSeed() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getStatus,
|
getStatus,
|
||||||
setupNewDocument,
|
setupNewDocument,
|
||||||
setupSyncFromServer,
|
setupSyncFromServer,
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
import { Request } from "express";
|
import { Request } from "express";
|
||||||
|
|
||||||
import similarityService = require('../../becca/similarity');
|
import similarityService from "../../becca/similarity.js";
|
||||||
import becca = require('../../becca/becca');
|
import becca from "../../becca/becca.js";
|
||||||
|
|
||||||
async function getSimilarNotes(req: Request) {
|
async function getSimilarNotes(req: Request) {
|
||||||
const noteId = req.params.noteId;
|
const noteId = req.params.noteId;
|
||||||
@ -13,6 +13,6 @@ async function getSimilarNotes(req: Request) {
|
|||||||
return await similarityService.findSimilarNotes(noteId);
|
return await similarityService.findSimilarNotes(noteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
export = {
|
export default {
|
||||||
getSimilarNotes
|
getSimilarNotes
|
||||||
};
|
};
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user