Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
various becca migration fixes
zadam8417d4a4ea2f
diff --git a/package-lock.json b/package-lock.jsonindex f2f36e7e13..ea91ac0601 100644--- a/package-lock.json+++ b/package-lock.json@@ -204,9 +204,9 @@}},"@electron/universal": {- "version": "1.0.4",- "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.0.4.tgz",- "integrity": "sha512-ajZoumi4XwqwmZe8YVhu4XGkZBCPyWZsVCQONPTIe9TUlleSN+dic3YpXlaWcilx/HOzTdldTKtabNTeI0gDoA==",+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-1.0.5.tgz",+ "integrity": "sha512-zX9O6+jr2NMyAdSkwEUlyltiI4/EBLu2Ls/VD3pUQdi3cAYeYfdQnT2AJJ38HE4QxLccbU13LSpccw1IWlkyag==","dev": true,"requires": {"@malept/cross-spawn-promise": "^1.1.0",@@ -711,9 +711,9 @@"dev": true},"@types/eslint": {- "version": "7.2.7",- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.7.tgz",- "integrity": "sha512-EHXbc1z2GoQRqHaAT7+grxlTJ3WE2YNeD6jlpPoRc83cCoThRY+NUWjCUZaYmk51OICkPXn2hhphcWcWXgNW0Q==",+ "version": "7.2.10",+ "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz",+ "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==","dev": true,"requires": {"@types/estree": "*",@@ -1165,34 +1165,34 @@"dev": true},"app-builder-lib": {- "version": "22.11.1",- "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-22.11.1.tgz",- "integrity": "sha512-oHpXomred4MeDzdLBMNuBtyEMiskX4wwQE+23CKFMqVfLEzpRwErZW+xegFi8aa/rhAOdED0THSHTcIr5rylIQ==",+ "version": "22.11.3",+ "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-22.11.3.tgz",+ "integrity": "sha512-u40ESAF/wPVlRPkS0hRjtClzUcS0PQ61bb5ZN8+d039cmwtS7myRVYucck58c9GOyXfvyO1hHaJii5I+QrBtdA==","dev": true,"requires": {"7zip-bin": "~5.1.1","@develar/schema-utils": "~2.6.5",- "@electron/universal": "1.0.4",+ "@electron/universal": "1.0.5","@malept/flatpak-bundler": "^0.4.0","async-exit-hook": "^2.0.1","bluebird-lst": "^1.0.9",- "builder-util": "22.11.1",- "builder-util-runtime": "8.7.4",+ "builder-util": "22.11.3",+ "builder-util-runtime": "8.7.5","chromium-pickle-js": "^0.2.0","debug": "^4.3.2","ejs": "^3.1.6",- "electron-publish": "22.11.1",- "fs-extra": "^9.1.0",- "hosted-git-info": "^4.0.0",+ "electron-publish": "22.11.2",+ "fs-extra": "^10.0.0",+ "hosted-git-info": "^4.0.2","is-ci": "^3.0.0",- "istextorbinary": "^5.12.0",- "js-yaml": "^4.0.0",+ "isbinaryfile": "^4.0.8",+ "js-yaml": "^4.1.0","lazy-val": "^1.0.4","minimatch": "^3.0.4",- "read-config-file": "6.1.0",+ "read-config-file": "6.2.0","sanitize-filename": "^1.6.3",- "semver": "^7.3.4",- "temp-file": "^3.3.7"+ "semver": "^7.3.5",+ "temp-file": "^3.4.0"},"dependencies": {"debug": {@@ -1204,18 +1204,6 @@"ms": "2.1.2"}},- "fs-extra": {- "version": "9.1.0",- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",- "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",- "dev": true,- "requires": {- "at-least-node": "^1.0.0",- "graceful-fs": "^4.2.0",- "jsonfile": "^6.0.1",- "universalify": "^2.0.0"- }- },"hosted-git-info": {"version": "4.0.2","resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz",@@ -1225,27 +1213,11 @@"lru-cache": "^6.0.0"}},- "jsonfile": {- "version": "6.1.0",- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",- "dev": true,- "requires": {- "graceful-fs": "^4.1.6",- "universalify": "^2.0.0"- }- },"ms": {"version": "2.1.2","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz","integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==","dev": true- },- "universalify": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",- "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",- "dev": true}}},@@ -1442,12 +1414,6 @@"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz","integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA=="},- "binaryextensions": {- "version": "4.15.0",- "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-4.15.0.tgz",- "integrity": "sha512-MkUl3szxXolQ2scI1PM14WOT951KnaTNJ0eMKg7WzOI4kvSxyNo/Cygx4LOBNhwyINhAuSQpJW1rYD9aBSxGaw==",- "dev": true- },"bindings": {"version": "1.5.0","resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",@@ -1671,16 +1637,24 @@"integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow=="},"browserslist": {- "version": "4.16.3",- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.3.tgz",- "integrity": "sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw==",+ "version": "4.16.6",+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz",+ "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==","dev": true,"requires": {- "caniuse-lite": "^1.0.30001181",- "colorette": "^1.2.1",- "electron-to-chromium": "^1.3.649",+ "caniuse-lite": "^1.0.30001219",+ "colorette": "^1.2.2",+ "electron-to-chromium": "^1.3.723","escalade": "^3.1.1",- "node-releases": "^1.1.70"+ "node-releases": "^1.1.71"+ },+ "dependencies": {+ "colorette": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",+ "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",+ "dev": true+ }}},"buffer": {@@ -1730,27 +1704,36 @@"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="},"builder-util": {- "version": "22.11.1",- "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-22.11.1.tgz",- "integrity": "sha512-3U/ALRUA/neNxGIP/G06sqAiMmCjAgIrRN2wWdAop6s/WKpzYRh+8alFUCLyfSanmxXjnzfJt9dy4TL+HHh6Rw==",+ "version": "22.11.3",+ "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-22.11.3.tgz",+ "integrity": "sha512-az4s7iyf1ZPXaSVgCY+YoUcBVNspHz/f2lZSXTeXpPUjiKcbV+jzewWdw8yPWFUZ9UDArI5AVhW2bQfyBRjgVQ==","dev": true,"requires": {"7zip-bin": "~5.1.1","@types/debug": "^4.1.5",- "@types/fs-extra": "^9.0.7",+ "@types/fs-extra": "^9.0.11","app-builder-bin": "3.5.13","bluebird-lst": "^1.0.9",- "builder-util-runtime": "8.7.4",- "chalk": "^4.1.0",+ "builder-util-runtime": "8.7.5",+ "chalk": "^4.1.1","debug": "^4.3.2",- "fs-extra": "^9.1.0",+ "fs-extra": "^10.0.0","is-ci": "^3.0.0",- "js-yaml": "^4.0.0",+ "js-yaml": "^4.1.0","source-map-support": "^0.5.19","stat-mode": "^1.0.0",- "temp-file": "^3.3.7"+ "temp-file": "^3.4.0"},"dependencies": {+ "@types/fs-extra": {+ "version": "9.0.11",+ "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.11.tgz",+ "integrity": "sha512-mZsifGG4QeQ7hlkhO56u7zt/ycBgGxSVsFI/6lGTU34VtwkiqrrSDgw0+ygs8kFGWcXnFQWMrzF2h7TtDFNixA==",+ "dev": true,+ "requires": {+ "@types/node": "*"+ }+ },"ansi-styles": {"version": "4.3.0","resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",@@ -1794,46 +1777,18 @@"ms": "2.1.2"}},- "fs-extra": {- "version": "9.1.0",- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",- "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",- "dev": true,- "requires": {- "at-least-node": "^1.0.0",- "graceful-fs": "^4.2.0",- "jsonfile": "^6.0.1",- "universalify": "^2.0.0"- }- },- "jsonfile": {- "version": "6.1.0",- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",- "dev": true,- "requires": {- "graceful-fs": "^4.1.6",- "universalify": "^2.0.0"- }- },"ms": {"version": "2.1.2","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz","integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==","dev": true- },- "universalify": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",- "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",- "dev": true}}},"builder-util-runtime": {- "version": "8.7.4",- "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.7.4.tgz",- "integrity": "sha512-2vDOwH0cyyCLQwW0Tsrg3RKKQpEcrV70KFun39E8RPzNFBOv9ds9juK8WUnO6ml+xJWKkKTjWLFdF3y+8GbPOw==",+ "version": "8.7.5",+ "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.7.5.tgz",+ "integrity": "sha512-fgUFHKtMNjdvH6PDRFntdIGUPgwZ69sXsAqEulCtoiqgWes5agrMq/Ud274zjJRTbckYh2PHh8/1CpFc6dpsbQ==","dev": true,"requires": {"debug": "^4.3.2",@@ -1939,9 +1894,9 @@"dev": true},"caniuse-lite": {- "version": "1.0.30001204",- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001204.tgz",- "integrity": "sha512-JUdjWpcxfJ9IPamy2f5JaRDCaqJOxDzOSKtbdx4rH9VivMd1vIzoPumsJa9LoMIi4Fx2BV2KZOxWhNkBjaYivQ==",+ "version": "1.0.30001228",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz",+ "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==","dev": true},"caseless": {@@ -2017,13 +1972,10 @@"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="},"chrome-trace-event": {- "version": "1.0.2",- "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz",- "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==",- "dev": true,- "requires": {- "tslib": "^1.9.0"- }+ "version": "1.0.3",+ "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz",+ "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==",+ "dev": true},"chromium-pickle-js": {"version": "0.2.0",@@ -2755,32 +2707,20 @@}},"dmg-builder": {- "version": "22.11.1",- "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-22.11.1.tgz",- "integrity": "sha512-FZIIYpEs/ZfKJbRKjTjpQAHJKjRBlgd6QDUEAuC6OuyHUwwrflQay1rNTwp7spqbu9HDHipiQevX/e8dFmkQmw==",+ "version": "22.11.3",+ "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-22.11.3.tgz",+ "integrity": "sha512-NGlorMQF2YGboVtHM8zP5EHxYhrxFGjtsnX6YCr9BV1bsjSPVyBJZpuxKnOOLj86zlYWYeiNGyj4NeUOLGgUCA==","dev": true,"requires": {- "app-builder-lib": "22.11.1",- "builder-util": "22.11.1",- "builder-util-runtime": "8.7.4",+ "app-builder-lib": "22.11.3",+ "builder-util": "22.11.3",+ "builder-util-runtime": "8.7.5","dmg-license": "^1.0.8",- "fs-extra": "^9.1.0",+ "fs-extra": "^10.0.0","iconv-lite": "^0.6.2",- "js-yaml": "^4.0.0"+ "js-yaml": "^4.1.0"},"dependencies": {- "fs-extra": {- "version": "9.1.0",- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",- "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",- "dev": true,- "requires": {- "at-least-node": "^1.0.0",- "graceful-fs": "^4.2.0",- "jsonfile": "^6.0.1",- "universalify": "^2.0.0"- }- },"iconv-lite": {"version": "0.6.2","resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz",@@ -2789,22 +2729,6 @@"requires": {"safer-buffer": ">= 2.1.2 < 3.0.0"}- },- "jsonfile": {- "version": "6.1.0",- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",- "dev": true,- "requires": {- "graceful-fs": "^4.1.6",- "universalify": "^2.0.0"- }- },- "universalify": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",- "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",- "dev": true}}},@@ -2892,9 +2816,9 @@}},"dotenv": {- "version": "8.6.0",- "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz",- "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==",+ "version": "9.0.2",+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-9.0.2.tgz",+ "integrity": "sha512-I9OvvrHp4pIARv4+x9iuewrWycX6CcZtoAu1XrzPxc5UygMJXJZYmBsynku8IkrJwgypE5DGNjDPmPRhDCptUg==","dev": true},"dotenv-expand": {@@ -2918,16 +2842,6 @@"safer-buffer": "^2.1.0"}},- "editions": {- "version": "6.1.0",- "resolved": "https://registry.npmjs.org/editions/-/editions-6.1.0.tgz",- "integrity": "sha512-h6nWEyIocfgho9J3sTSuhU/WoFOu1hTX75rPBebNrbF38Y9QFDjCDizYXdikHTySW7Y3mSxli8bpDz9RAtc7rA==",- "dev": true,- "requires": {- "errlop": "^4.0.0",- "version-range": "^1.0.0"- }- },"ee-first": {"version": "1.1.1","resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",@@ -2942,9 +2856,9 @@}},"electron": {- "version": "13.0.0-beta.23",- "resolved": "https://registry.npmjs.org/electron/-/electron-13.0.0-beta.23.tgz",- "integrity": "sha512-JGHwQRTqzMsvG0/nxTPpKov999rE5kfYryYve1tKBfXvtyMWAcNlkYh2/u5eWZXcyYWVljq3i0sN+U1IQgx+Rw==",+ "version": "13.0.0-beta.24",+ "resolved": "https://registry.npmjs.org/electron/-/electron-13.0.0-beta.24.tgz",+ "integrity": "sha512-2zgmhrjdkWrKsBIepF1XkRCn4ODFxd4lgB58BLv3E66yiQJC0ugOnHoqeZcsskQ7bBMGGQwGAzB5nwOJ/83BOg==","dev": true,"requires": {"@electron/get": "^1.0.1",@@ -2961,23 +2875,23 @@}},"electron-builder": {- "version": "22.11.1",- "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-22.11.1.tgz",- "integrity": "sha512-IbAhv31idKzTR8KNQ+AIRf9J5vfU+9PzpG2STKHjYYWwGhfhZ5H4YfR0xH8xiwI4gaL1uTrfiq7fnpQxafhF2A==",- "dev": true,- "requires": {- "@types/yargs": "^16.0.0",- "app-builder-lib": "22.11.1",- "builder-util": "22.11.1",- "builder-util-runtime": "8.7.4",- "chalk": "^4.1.0",- "dmg-builder": "22.11.1",- "fs-extra": "^9.1.0",+ "version": "22.11.3",+ "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-22.11.3.tgz",+ "integrity": "sha512-STv4uU3q00FzVgW9kMpRXSrhJxogzAZgIhFZl0mBZQC1VOAajNiEBsZPaU32jP23oxlgLQExj/ux6/frYk5vGA==",+ "dev": true,+ "requires": {+ "@types/yargs": "^16.0.1",+ "app-builder-lib": "22.11.3",+ "builder-util": "22.11.3",+ "builder-util-runtime": "8.7.5",+ "chalk": "^4.1.1",+ "dmg-builder": "22.11.3",+ "fs-extra": "^10.0.0","is-ci": "^3.0.0","lazy-val": "^1.0.4",- "read-config-file": "6.1.0",+ "read-config-file": "6.2.0","update-notifier": "^5.1.0",- "yargs": "^16.2.0"+ "yargs": "^17.0.1"},"dependencies": {"ansi-regex": {@@ -3037,34 +2951,12 @@"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==","dev": true},- "fs-extra": {- "version": "9.1.0",- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",- "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",- "dev": true,- "requires": {- "at-least-node": "^1.0.0",- "graceful-fs": "^4.2.0",- "jsonfile": "^6.0.1",- "universalify": "^2.0.0"- }- },"is-fullwidth-code-point": {"version": "3.0.0","resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz","integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==","dev": true},- "jsonfile": {- "version": "6.1.0",- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",- "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",- "dev": true,- "requires": {- "graceful-fs": "^4.1.6",- "universalify": "^2.0.0"- }- },"string-width": {"version": "4.2.2","resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",@@ -3085,12 +2977,6 @@"ansi-regex": "^5.0.0"}},- "universalify": {- "version": "2.0.0",- "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",- "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",- "dev": true- },"wrap-ansi": {"version": "7.0.0","resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",@@ -3109,9 +2995,9 @@"dev": true},"yargs": {- "version": "16.2.0",- "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",- "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",+ "version": "17.0.1",+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.1.tgz",+ "integrity": "sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==","dev": true,"requires": {"cliui": "^7.0.2",@@ -3494,13 +3380,13 @@}},"electron-publish": {- "version": "22.11.1",- "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.11.1.tgz",- "integrity": "sha512-M8aXlIuP0QcGCdSzMvv67m8sZYdRpXFfiGpFbZOXJlO3Io/3jkNvbnUMVfhbamlmYrQKNSRJzB7te/pn+qYneA==",+ "version": "22.11.2",+ "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-22.11.2.tgz",+ "integrity": "sha512-RSrDyYL407QRryIN0QhQGJc5PjHK4gdCwTHYTH5Zl43753ZLVUMRmzW768H0Tb8hVM2VOymy8pNnQAHB5egoiQ==","dev": true,"requires": {"@types/fs-extra": "^9.0.7",- "builder-util": "22.11.1",+ "builder-util": "22.11.2","builder-util-runtime": "8.7.4","chalk": "^4.1.0","fs-extra": "^9.1.0",@@ -3517,6 +3403,38 @@"color-convert": "^2.0.1"}},+ "builder-util": {+ "version": "22.11.2",+ "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-22.11.2.tgz",+ "integrity": "sha512-n5QkoRcNKy7KrBO8trpk7WRgdpBnOu68KVm+roSbDtZaW1qAmBplyThxnczcvjByVwD+UrsKd62eNIARiz2jyw==",+ "dev": true,+ "requires": {+ "7zip-bin": "~5.1.1",+ "@types/debug": "^4.1.5",+ "@types/fs-extra": "^9.0.7",+ "app-builder-bin": "3.5.13",+ "bluebird-lst": "^1.0.9",+ "builder-util-runtime": "8.7.4",+ "chalk": "^4.1.0",+ "debug": "^4.3.2",+ "fs-extra": "^9.1.0",+ "is-ci": "^3.0.0",+ "js-yaml": "^4.0.0",+ "source-map-support": "^0.5.19",+ "stat-mode": "^1.0.0",+ "temp-file": "^3.3.7"+ }+ },+ "builder-util-runtime": {+ "version": "8.7.4",+ "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-8.7.4.tgz",+ "integrity": "sha512-2vDOwH0cyyCLQwW0Tsrg3RKKQpEcrV70KFun39E8RPzNFBOv9ds9juK8WUnO6ml+xJWKkKTjWLFdF3y+8GbPOw==",+ "dev": true,+ "requires": {+ "debug": "^4.3.2",+ "sax": "^1.2.4"+ }+ },"chalk": {"version": "4.1.1","resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz",@@ -3542,6 +3460,15 @@"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==","dev": true},+ "debug": {+ "version": "4.3.2",+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",+ "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",+ "dev": true,+ "requires": {+ "ms": "2.1.2"+ }+ },"fs-extra": {"version": "9.1.0","resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",@@ -3570,6 +3497,12 @@"integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==","dev": true},+ "ms": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",+ "dev": true+ },"universalify": {"version": "2.0.0","resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",@@ -3788,9 +3721,9 @@}},"electron-to-chromium": {- "version": "1.3.700",- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.700.tgz",- "integrity": "sha512-wQtaxVZzpOeCjW1CGuC5W3bYjE2jglvk076LcTautBOB9UtHztty7wNzjVsndiMcSsdUsdMy5w76w5J1U7OPTQ==",+ "version": "1.3.727",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz",+ "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==","dev": true},"electron-window-state": {@@ -3830,9 +3763,9 @@}},"enhanced-resolve": {- "version": "5.8.0",- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz",- "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==",+ "version": "5.8.2",+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz",+ "integrity": "sha512-F27oB3WuHDzvR2DOGNTaYy0D5o0cnrv8TeI482VM4kYgQd/FT9lUQwuNsJ0oOHtBUq7eiW5ytqzp7nBFknL+GA==","dev": true,"requires": {"graceful-fs": "^4.2.4",@@ -3856,12 +3789,6 @@"integrity": "sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==","dev": true},- "errlop": {- "version": "4.1.0",- "resolved": "https://registry.npmjs.org/errlop/-/errlop-4.1.0.tgz",- "integrity": "sha512-vul6gGBuVt0M2TPi1/WrcL86+Hb3Q2Tpu3TME3sbVhZrYf7J1ZMHCodI25RQKCVurh56qTfvgM0p3w5cT4reSQ==",- "dev": true- },"error-ex": {"version": "1.3.2","resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",@@ -5096,6 +5023,12 @@"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz","integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="},+ "isbinaryfile": {+ "version": "4.0.8",+ "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.8.tgz",+ "integrity": "sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w==",+ "dev": true+ },"isexe": {"version": "2.0.0","resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",@@ -5112,17 +5045,6 @@"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz","integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="},- "istextorbinary": {- "version": "5.12.0",- "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-5.12.0.tgz",- "integrity": "sha512-wLDRWD7qpNTYubk04+q3en1+XZGS4vYWK0+SxNSXJLaITMMEK+J3o/TlOMyULeH1qozVZ9uUkKcyMA8odyxz8w==",- "dev": true,- "requires": {- "binaryextensions": "^4.15.0",- "editions": "^6.1.0",- "textextensions": "^5.11.0"- }- },"jake": {"version": "10.8.2","resolved": "https://registry.npmjs.org/jake/-/jake-10.8.2.tgz",@@ -6687,14 +6609,14 @@}},"read-config-file": {- "version": "6.1.0",- "resolved": "https://registry.npmjs.org/read-config-file/-/read-config-file-6.1.0.tgz",- "integrity": "sha512-Z3ua8JTbQgrDNDWD0zMtwE2Np+RGeL+Jew5T7bSRfJGcq+t883wExEXNWLQqMaStfRp9Xz6RPsx01/jruhn+tg==",+ "version": "6.2.0",+ "resolved": "https://registry.npmjs.org/read-config-file/-/read-config-file-6.2.0.tgz",+ "integrity": "sha512-gx7Pgr5I56JtYz+WuqEbQHj/xWo+5Vwua2jhb1VwM4Wid5PqYmZ4i00ZB0YEGIfkVBsCv9UrjgyqCiQfS/Oosg==","dev": true,"requires": {- "dotenv": "^8.2.0",+ "dotenv": "^9.0.2","dotenv-expand": "^5.1.0",- "js-yaml": "^4.0.0",+ "js-yaml": "^4.1.0","json5": "^2.2.0","lazy-val": "^1.0.4"}@@ -7723,32 +7645,19 @@}},"temp-file": {- "version": "3.3.7",- "resolved": "https://registry.npmjs.org/temp-file/-/temp-file-3.3.7.tgz",- "integrity": "sha512-9tBJKt7GZAQt/Rg0QzVWA8Am8c1EFl+CAv04/aBVqlx5oyfQ508sFIABshQ0xbZu6mBrFLWIUXO/bbLYghW70g==",+ "version": "3.4.0",+ "resolved": "https://registry.npmjs.org/temp-file/-/temp-file-3.4.0.tgz",+ "integrity": "sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==","dev": true,"requires": {"async-exit-hook": "^2.0.1",- "fs-extra": "^8.1.0"- },- "dependencies": {- "fs-extra": {- "version": "8.1.0",- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",- "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",- "dev": true,- "requires": {- "graceful-fs": "^4.2.0",- "jsonfile": "^4.0.0",- "universalify": "^0.1.0"- }- }+ "fs-extra": "^10.0.0"}},"terser": {- "version": "5.6.1",- "resolved": "https://registry.npmjs.org/terser/-/terser-5.6.1.tgz",- "integrity": "sha512-yv9YLFQQ+3ZqgWCUk+pvNJwgUTdlIxUk1WTN+RnaFJe2L7ipG2csPT0ra2XRm7Cs8cxN7QXmK1rFzEwYEQkzXw==",+ "version": "5.7.0",+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.0.tgz",+ "integrity": "sha512-HP5/9hp2UaZt5fYkuhNBR8YyRcT8juw8+uFbAme53iN9hblvKnLUTKkmwJG6ocWpIKf8UK4DoeWG4ty0J6S6/g==","dev": true,"requires": {"commander": "^2.20.0",@@ -7795,12 +7704,6 @@}}},- "textextensions": {- "version": "5.12.0",- "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-5.12.0.tgz",- "integrity": "sha512-IYogUDaP65IXboCiPPC0jTLLBzYlhhw2Y4b0a2trPgbHNGGGEfuHE6tds+yDcCf4mpNDaGISFzwSSezcXt+d6w==",- "dev": true- },"timm": {"version": "1.7.0","resolved": "https://registry.npmjs.org/timm/-/timm-1.7.0.tgz",@@ -7887,12 +7790,6 @@"utf8-byte-length": "^1.0.1"}},- "tslib": {- "version": "1.14.1",- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",- "dev": true- },"tsscmp": {"version": "1.0.6","resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz",@@ -8174,21 +8071,6 @@"extsprintf": "^1.2.0"}},- "version-compare": {- "version": "1.1.0",- "resolved": "https://registry.npmjs.org/version-compare/-/version-compare-1.1.0.tgz",- "integrity": "sha512-zVKtPOJTC9x23lzS4+4D7J+drq80BXVYAmObnr5zqxxFVH7OffJ1lJlAS7LYsQNV56jx/wtbw0UV7XHLrvd6kQ==",- "dev": true- },- "version-range": {- "version": "1.1.0",- "resolved": "https://registry.npmjs.org/version-range/-/version-range-1.1.0.tgz",- "integrity": "sha512-R1Ggfg2EXamrnrV3TkZ6yBNgITDbclB3viwSjbZ3+eK0VVNK4ajkYJTnDz5N0bIMYDtK9MUBvXJUnKO5RWWJ6w==",- "dev": true,- "requires": {- "version-compare": "^1.0.0"- }- },"w3c-hr-time": {"version": "1.0.2","resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",@@ -8230,9 +8112,9 @@"integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="},"webpack": {- "version": "5.36.2",- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.36.2.tgz",- "integrity": "sha512-XJumVnnGoH2dV+Pk1VwgY4YT6AiMKpVoudUFCNOXMIVrEKPUgEwdIfWPjIuGLESAiS8EdIHX5+TiJz/5JccmRg==",+ "version": "5.37.0",+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.37.0.tgz",+ "integrity": "sha512-yvdhgcI6QkQkDe1hINBAJ1UNevqNGTVaCkD2SSJcB8rcrNNl922RI8i2DXUAuNfANoxwsiXXEA4ZPZI9q2oGLA==","dev": true,"requires": {"@types/eslint-scope": "^3.7.0",diff --git a/package.json b/package.jsonindex 9b976d740e..8d4b7d2c1b 100644--- a/package.json+++ b/package.json@@ -80,8 +80,8 @@},"devDependencies": {"cross-env": "7.0.3",- "electron": "13.0.0-beta.23",- "electron-builder": "22.11.1",+ "electron": "13.0.0-beta.24",+ "electron-builder": "22.11.3","electron-packager": "15.2.0","electron-rebuild": "2.3.5","esm": "3.2.25",@@ -89,7 +89,7 @@"jsdoc": "3.6.6","lorem-ipsum": "2.0.3","rcedit": "3.0.0",- "webpack": "5.36.2",+ "webpack": "5.37.0","webpack-cli": "4.7.0"},"optionalDependencies": {diff --git a/src/public/app/services/froca.js b/src/public/app/services/froca.jsindex 87476432b6..48c84576f3 100644--- a/src/public/app/services/froca.js+++ b/src/public/app/services/froca.js@@ -187,7 +187,7 @@ class Froca {}const branches = [...note.getBranches(), ...note.getChildBranches()];-+console.log("searchResultNoteIds", searchResultNoteIds);searchResultNoteIds.forEach((resultNoteId, index) => branches.push({// branchId should be repeatable since sometimes we reload some notes without rerendering the treebranchId: "virt-" + note.noteId + '-' + resultNoteId,@@ -197,6 +197,8 @@ class Froca {fromSearchNote: true}));+ console.log("branches", branches);+// update this note with standard (parent) branches + virtual (children) branchesthis.addResp({notes: [note],diff --git a/src/public/app/services/tab_context.js b/src/public/app/services/tab_context.jsindex 26c0ecbd62..8bb1c92f36 100644--- a/src/public/app/services/tab_context.js+++ b/src/public/app/services/tab_context.js@@ -102,8 +102,8 @@ class TabContext extends Component {/** @property {NoteShort} */get note() {- if (this.noteId && !(this.noteId in froca.notes)) {- logError(`Cannot find tabContext's note id='${this.noteId}'`);+ if (!this.noteId || !(this.noteId in froca.notes)) {+ return null;}return froca.notes[this.noteId];diff --git a/src/public/app/services/tree.js b/src/public/app/services/tree.jsindex c87798f8b7..be9131e944 100644--- a/src/public/app/services/tree.js+++ b/src/public/app/services/tree.js@@ -49,10 +49,13 @@ async function resolveNotePathToSegments(notePath, hoistedNoteId = 'root', logErconst parentNoteId = path[i++];if (childNoteId !== null) {- const child = await froca.getNote(childNoteId);+ const child = await froca.getNote(childNoteId, !logErrors);if (!child) {- console.log(`Can't find note ${childNoteId}`);+ if (logErrors) {+ ws.logError(`Can't find note ${childNoteId}`);+ }+return;}diff --git a/src/routes/api/search.js b/src/routes/api/search.jsindex efe06f3f24..d6f9691ac4 100644--- a/src/routes/api/search.js+++ b/src/routes/api/search.js@@ -1,12 +1,12 @@"use strict";-const repository = require('../../services/repository');-const SearchContext = require('../../services/search/search_context.js');+const becca = require('../../services/becca/becca');+const SearchContext = require('../../services/search/search_context');const log = require('../../services/log');const scriptService = require('../../services/script');const searchService = require('../../services/search/services/search');-const noteRevisionService = require("../../services/note_revisions.js");-const {formatAttrForSearch} = require("../../services/attribute_formatter.js");+const noteRevisionService = require("../../services/note_revisions");+const {formatAttrForSearch} = require("../../services/attribute_formatter");async function searchFromNoteInt(note) {let searchResultNoteIds;diff --git a/src/services/becca/entities/note.js b/src/services/becca/entities/note.jsindex 472868df1d..249be39e51 100644--- a/src/services/becca/entities/note.js+++ b/src/services/becca/entities/note.js@@ -5,9 +5,9 @@ const log = require('../../log');const sql = require('../../sql');const utils = require('../../utils');const dateUtils = require('../../date_utils');-const entityChangesService = require('../../entity_changes.js');-const AbstractEntity = require("./abstract_entity.js");-const NoteRevision = require("./note_revision.js");+const entityChangesService = require('../../entity_changes');+const AbstractEntity = require("./abstract_entity");+const NoteRevision = require("./note_revision");const LABEL = 'label';const RELATION = 'relation';@@ -861,6 +861,143 @@ class Note extends AbstractEntity {return notePaths.some(path => path.includes(ancestorNoteId));}+ /**+ * Update's given attribute's value or creates it if it doesn't exist+ *+ * @param {string} type - attribute type (label, relation, etc.)+ * @param {string} name - attribute name+ * @param {string} [value] - attribute value (optional)+ */+ setAttribute(type, name, value) {+ const attributes = this.getOwnedAttributes();+ const attr = attributes.find(attr => attr.type === type && attr.name === name);++ if (attr) {+ if (attr.value !== value) {+ attr.value = value;+ attr.save();+ }+ }+ else {+ const Attribute = require("./attribute");++ new Attribute({+ noteId: this.noteId,+ type: type,+ name: name,+ value: value !== undefined ? value : ""+ }).save();+ }+ }++ /**+ * Removes given attribute name-value pair if it exists.+ *+ * @param {string} type - attribute type (label, relation, etc.)+ * @param {string} name - attribute name+ * @param {string} [value] - attribute value (optional)+ */+ removeAttribute(type, name, value) {+ const attributes = this.getOwnedAttributes();++ for (const attribute of attributes) {+ if (attribute.type === type && attribute.name === name && (value === undefined || value === attribute.value)) {+ attribute.markAsDeleted();+ }+ }+ }++ /**+ * @return {Attribute}+ */+ addAttribute(type, name, value = "", isInheritable = false, position = 1000) {+ const Attribute = require("./attribute");++ return new Attribute({+ noteId: this.noteId,+ type: type,+ name: name,+ value: value,+ isInheritable: isInheritable,+ position: position+ }).save();+ }++ addLabel(name, value = "", isInheritable = false) {+ return this.addAttribute(LABEL, name, value, isInheritable);+ }++ addRelation(name, targetNoteId, isInheritable = false) {+ return this.addAttribute(RELATION, name, targetNoteId, isInheritable);+ }++ /**+ * Based on enabled, attribute is either set or removed.+ *+ * @param {string} type - attribute type ('relation', 'label' etc.)+ * @param {boolean} enabled - toggle On or Off+ * @param {string} name - attribute name+ * @param {string} [value] - attribute value (optional)+ */+ toggleAttribute(type, enabled, name, value) {+ if (enabled) {+ this.setAttribute(type, name, value);+ }+ else {+ this.removeAttribute(type, name, value);+ }+ }++ /**+ * Based on enabled, label is either set or removed.+ *+ * @param {boolean} enabled - toggle On or Off+ * @param {string} name - label name+ * @param {string} [value] - label value (optional)+ */+ toggleLabel(enabled, name, value) { return this.toggleAttribute(LABEL, enabled, name, value); }++ /**+ * Based on enabled, relation is either set or removed.+ *+ * @param {boolean} enabled - toggle On or Off+ * @param {string} name - relation name+ * @param {string} [value] - relation value (noteId)+ */+ toggleRelation(enabled, name, value) { return this.toggleAttribute(RELATION, enabled, name, value); }++ /**+ * Update's given label's value or creates it if it doesn't exist+ *+ * @param {string} name - label name+ * @param {string} [value] - label value+ */+ setLabel(name, value) { return this.setAttribute(LABEL, name, value); }++ /**+ * Update's given relation's value or creates it if it doesn't exist+ *+ * @param {string} name - relation name+ * @param {string} value - relation value (noteId)+ */+ setRelation(name, value) { return this.setAttribute(RELATION, name, value); }++ /**+ * Remove label name-value pair, if it exists.+ *+ * @param {string} name - label name+ * @param {string} [value] - label value+ */+ removeLabel(name, value) { return this.removeAttribute(LABEL, name, value); }++ /**+ * Remove relation name-value pair, if it exists.+ *+ * @param {string} name - relation name+ * @param {string} [value] - relation value (noteId)+ */+ removeRelation(name, value) { return this.removeAttribute(RELATION, name, value); }+decrypt() {if (this.isProtected && !this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) {try {diff --git a/src/services/cloning.js b/src/services/cloning.jsindex 37d401891c..42d58c931e 100644--- a/src/services/cloning.js+++ b/src/services/cloning.js@@ -4,7 +4,6 @@ const sql = require('./sql');const eventChangesService = require('./entity_changes.js');const treeService = require('./tree');const noteService = require('./notes');-const repository = require('./repository');const Branch = require('../services/becca/entities/branch');const TaskContext = require("./task_context.js");const utils = require('./utils');@@ -56,7 +55,8 @@ function ensureNoteIsPresentInParent(noteId, parentNoteId, prefix) {}function ensureNoteIsAbsentFromParent(noteId, parentNoteId) {- const branch = repository.getEntity(`SELECT * FROM branches WHERE noteId = ? AND parentNoteId = ? AND isDeleted = 0`, [noteId, parentNoteId]);+ const branchId = sql.getValue(`SELECT branchId FROM branches WHERE noteId = ? AND parentNoteId = ? AND isDeleted = 0`, [noteId, parentNoteId]);+ const branch = becca.getBranch(branchId);if (branch) {const deleteId = utils.randomString(10);diff --git a/src/services/tree.js b/src/services/tree.jsindex d22303fae7..6cab39a9ba 100644--- a/src/services/tree.js+++ b/src/services/tree.js@@ -2,7 +2,6 @@const sql = require('./sql');const log = require('./log');-const repository = require('./repository');const Branch = require('../services/becca/entities/branch');const entityChangesService = require('./entity_changes.js');const protectedSessionService = require('./protected_session');@@ -60,7 +59,9 @@ function validateParentChild(parentNoteId, childNoteId, branchId = null) {}function getExistingBranch(parentNoteId, childNoteId) {- return repository.getEntity('SELECT * FROM branches WHERE noteId = ? AND parentNoteId = ? AND isDeleted = 0', [childNoteId, parentNoteId]);+ const branchId = sql.getValue('SELECT branchId FROM branches WHERE noteId = ? AND parentNoteId = ? AND isDeleted = 0', [childNoteId, parentNoteId]);++ return becca.getBranch(branchId);}/**@@ -192,7 +193,8 @@ function setNoteToParent(noteId, prefix, parentNoteId) {}// case where there might be more such branches is ignored. It's expected there should be just one- const branch = repository.getEntity("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ? AND prefix = ?", [noteId, prefix]);+ const branchId = sql.getValue("SELECT branchId FROM branches WHERE isDeleted = 0 AND noteId = ? AND prefix = ?", [noteId, prefix]);+ const branch = becca.getBranch(branchId);if (branch) {if (!parentNoteId) {@@ -211,7 +213,8 @@ function setNoteToParent(noteId, prefix, parentNoteId) {throw new Error(`Cannot create a branch for ${noteId} which is deleted.`);}- const branch = repository.getEntity('SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ? AND parentNoteId = ?', [noteId, parentNoteId]);+ const branchId = sql.getValue('SELECT branchId FROM branches WHERE isDeleted = 0 AND noteId = ? AND parentNoteId = ?', [noteId, parentNoteId]);+ const branch = becca.getBranch(branchId);if (branch) {branch.prefix = prefix;