From 534c71491b53fdf312df65a8ae4ac1196ffc2aa5 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 16 Apr 2022 00:17:32 +0200 Subject: [PATCH] fix docs --- docs/backend_api/Attribute.html | 307 +++++++++++- docs/backend_api/BackendScriptApi.html | 4 +- docs/backend_api/Branch.html | 307 +++++++++++- docs/backend_api/EtapiToken.html | 301 +++++++++++- docs/backend_api/Note.html | 443 ++++++++++++++---- docs/backend_api/NoteRevision.html | 315 ++++++++++++- docs/backend_api/Option.html | 297 +++++++++++- docs/backend_api/RecentNote.html | 295 +++++++++++- .../becca_entities_attribute.js.html | 6 +- .../backend_api/becca_entities_branch.js.html | 6 +- .../becca_entities_etapi_token.js.html | 17 +- docs/backend_api/becca_entities_note.js.html | 7 +- .../becca_entities_note_revision.js.html | 6 +- .../backend_api/becca_entities_option.js.html | 6 +- .../becca_entities_recent_note.js.html | 6 +- docs/backend_api/global.html | 4 +- docs/backend_api/index.html | 4 +- docs/backend_api/module-sql.html | 16 +- .../services_backend_script_api.js.html | 6 +- docs/backend_api/services_sql.js.html | 17 +- docs/frontend_api/Attribute.html | 2 +- docs/frontend_api/Branch.html | 2 +- docs/frontend_api/FrontendScriptApi.html | 2 +- docs/frontend_api/NoteComplement.html | 2 +- docs/frontend_api/NoteShort.html | 2 +- docs/frontend_api/entities_attribute.js.html | 2 +- docs/frontend_api/entities_branch.js.html | 2 +- .../entities_note_complement.js.html | 2 +- docs/frontend_api/entities_note_short.js.html | 2 +- docs/frontend_api/global.html | 2 +- docs/frontend_api/index.html | 2 +- .../services_frontend_script_api.js.html | 2 +- .../widgets_collapsible_widget.js.html | 2 +- src/becca/entities/abstract_entity.js | 13 + src/becca/entities/attribute.js | 2 + src/becca/entities/branch.js | 2 + src/becca/entities/etapi_token.js | 2 + src/becca/entities/note.js | 2 + src/becca/entities/note_revision.js | 2 + src/becca/entities/option.js | 2 + src/becca/entities/recent_note.js | 2 + 41 files changed, 2223 insertions(+), 200 deletions(-) diff --git a/docs/backend_api/Attribute.html b/docs/backend_api/Attribute.html index 72b5ea2a3..59b518036 100644 --- a/docs/backend_api/Attribute.html +++ b/docs/backend_api/Attribute.html @@ -94,7 +94,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -128,6 +128,17 @@ and relation (representing named relationship between source and target note) +

Extends

+ + + + + + + + @@ -194,7 +205,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -262,7 +273,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -330,7 +341,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -398,7 +409,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -466,7 +477,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -534,7 +545,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -602,7 +613,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -670,7 +681,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -746,7 +757,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -851,7 +862,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -956,7 +967,7 @@ and relation (representing named relationship between source and target note)Source:
@@ -1005,6 +1016,274 @@ and relation (representing named relationship between source and target note)markAsDeleted(deleteIdopt) + + + + + + +
+ Mark the entity as (soft) deleted. It will be completely erased later. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
deleteId + + + + <optional>
+ + + + + +
+ + null + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

save() → {AbstractEntity}

+ + + + + + +
+ Saves entity - executes SQL, but doesn't commit the transaction on its own +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +AbstractEntity + + +
+
+ + + + + + + + @@ -1020,13 +1299,13 @@ and relation (representing named relationship between source and target note)
diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html index 0221756a2..d99d0c219 100644 --- a/docs/backend_api/BackendScriptApi.html +++ b/docs/backend_api/BackendScriptApi.html @@ -6073,13 +6073,13 @@ exists, then we'll use that transaction.
diff --git a/docs/backend_api/Branch.html b/docs/backend_api/Branch.html index cf98e4e82..4be4b47f5 100644 --- a/docs/backend_api/Branch.html +++ b/docs/backend_api/Branch.html @@ -94,7 +94,7 @@ parents.
Source:
@@ -128,6 +128,17 @@ parents. +

Extends

+ + + + + + + + @@ -194,7 +205,7 @@ parents.
Source:
@@ -252,7 +263,7 @@ parents.
Source:
@@ -320,7 +331,7 @@ parents.
Source:
@@ -388,7 +399,7 @@ parents.
Source:
@@ -456,7 +467,7 @@ parents.
Source:
@@ -514,7 +525,7 @@ parents.
Source:
@@ -582,7 +593,7 @@ parents.
Source:
@@ -650,7 +661,7 @@ parents.
Source:
@@ -718,7 +729,7 @@ parents.
Source:
@@ -738,6 +749,278 @@ parents. +

Methods

+ + + + + + + +

markAsDeleted(deleteIdopt)

+ + + + + + +
+ Mark the entity as (soft) deleted. It will be completely erased later. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
deleteId + + + + <optional>
+ + + + + +
+ + null + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

save() → {AbstractEntity}

+ + + + + + +
+ Saves entity - executes SQL, but doesn't commit the transaction on its own +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +AbstractEntity + + +
+
+ + + + + + + + + @@ -752,13 +1035,13 @@ parents.
diff --git a/docs/backend_api/EtapiToken.html b/docs/backend_api/EtapiToken.html index 0eefe143f..bffcb3658 100644 --- a/docs/backend_api/EtapiToken.html +++ b/docs/backend_api/EtapiToken.html @@ -99,7 +99,7 @@ from tokenHash and token.
Source:
@@ -133,6 +133,17 @@ from tokenHash and token. +

Extends

+ + + + + + + + @@ -199,7 +210,7 @@ from tokenHash and token.
Source:
@@ -267,7 +278,7 @@ from tokenHash and token.
Source:
@@ -335,7 +346,7 @@ from tokenHash and token.
Source:
@@ -403,7 +414,7 @@ from tokenHash and token.
Source:
@@ -471,7 +482,7 @@ from tokenHash and token.
Source:
@@ -539,7 +550,7 @@ from tokenHash and token.
Source:
@@ -559,6 +570,278 @@ from tokenHash and token. +

Methods

+ + + + + + + +

markAsDeleted(deleteIdopt)

+ + + + + + +
+ Mark the entity as (soft) deleted. It will be completely erased later. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
deleteId + + + + <optional>
+ + + + + +
+ + null + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

save() → {AbstractEntity}

+ + + + + + +
+ Saves entity - executes SQL, but doesn't commit the transaction on its own +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +AbstractEntity + + +
+
+ + + + + + + + + @@ -573,13 +856,13 @@ from tokenHash and token.
diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html index 37f32b8f6..5a24d464a 100644 --- a/docs/backend_api/Note.html +++ b/docs/backend_api/Note.html @@ -93,7 +93,7 @@
Source:
@@ -127,6 +127,17 @@ +

Extends

+ + + + + + + + @@ -193,7 +204,7 @@
Source:
@@ -268,7 +279,7 @@
Source:
@@ -336,7 +347,7 @@
Source:
@@ -404,7 +415,7 @@
Source:
@@ -475,7 +486,7 @@
Source:
@@ -543,7 +554,7 @@
Source:
@@ -611,7 +622,7 @@
Source:
@@ -679,7 +690,7 @@
Source:
@@ -747,7 +758,7 @@
Source:
@@ -822,7 +833,7 @@
Source:
@@ -890,7 +901,7 @@
Source:
@@ -958,7 +969,7 @@
Source:
@@ -1026,7 +1037,7 @@
Source:
@@ -1101,7 +1112,7 @@
Source:
@@ -1169,7 +1180,7 @@
Source:
@@ -1237,7 +1248,7 @@
Source:
@@ -1305,7 +1316,7 @@
Source:
@@ -1373,7 +1384,7 @@
Source:
@@ -1441,7 +1452,7 @@
Source:
@@ -1517,7 +1528,7 @@
Source:
@@ -1619,7 +1630,7 @@
Source:
@@ -1721,7 +1732,7 @@
Source:
@@ -1827,7 +1838,7 @@
Source:
@@ -2001,7 +2012,7 @@
Source:
@@ -2201,7 +2212,7 @@
Source:
@@ -2379,7 +2390,7 @@
Source:
@@ -2490,7 +2501,7 @@
Source:
@@ -2592,7 +2603,7 @@
Source:
@@ -2694,7 +2705,7 @@
Source:
@@ -2796,7 +2807,7 @@
Source:
@@ -2898,7 +2909,7 @@
Source:
@@ -3006,7 +3017,7 @@
Source:
@@ -3112,7 +3123,7 @@
Source:
@@ -3263,7 +3274,7 @@
Source:
@@ -3433,7 +3444,7 @@
Source:
@@ -3588,7 +3599,7 @@
Source:
@@ -3758,7 +3769,7 @@
Source:
@@ -3864,7 +3875,7 @@
Source:
@@ -4066,7 +4077,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4244,7 +4255,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4402,7 +4413,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4572,7 +4583,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4727,7 +4738,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -4897,7 +4908,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5052,7 +5063,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5222,7 +5233,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5377,7 +5388,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5486,7 +5497,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5588,7 +5599,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5739,7 +5750,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -5909,7 +5920,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6064,7 +6075,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6173,7 +6184,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6282,7 +6293,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6384,7 +6395,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6486,7 +6497,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6588,7 +6599,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6695,7 +6706,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6797,7 +6808,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -6948,7 +6959,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7126,7 +7137,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7281,7 +7292,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7436,7 +7447,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7591,7 +7602,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7741,7 +7752,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7847,7 +7858,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -7953,7 +7964,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8059,7 +8070,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8165,7 +8176,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8271,7 +8282,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8323,6 +8334,163 @@ This method can be significantly faster than the getAttribute() + + + + + + +

markAsDeleted(deleteIdopt)

+ + + + + + +
+ Mark the entity as (soft) deleted. It will be completely erased later. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
deleteId + + + + <optional>
+ + + + + +
+ + null + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + @@ -8504,7 +8672,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8684,7 +8852,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8864,7 +9032,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -8894,6 +9062,117 @@ This method can be significantly faster than the getAttribute() + + + + + + +

save() → {AbstractEntity}

+ + + + + + +
+ Saves entity - executes SQL, but doesn't commit the transaction on its own +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +AbstractEntity + + +
+
+ + + + + + + @@ -9075,7 +9354,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9255,7 +9534,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9415,7 +9694,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9657,7 +9936,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -9868,7 +10147,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -10079,7 +10358,7 @@ This method can be significantly faster than the getAttribute()
Source:
@@ -10125,13 +10404,13 @@ This method can be significantly faster than the getAttribute()
diff --git a/docs/backend_api/NoteRevision.html b/docs/backend_api/NoteRevision.html index 627628042..f9575d7df 100644 --- a/docs/backend_api/NoteRevision.html +++ b/docs/backend_api/NoteRevision.html @@ -94,7 +94,7 @@ It's used for seamless note versioning.
Source:
@@ -128,6 +128,17 @@ It's used for seamless note versioning. +

Extends

+ + + + + + + + @@ -194,7 +205,7 @@ It's used for seamless note versioning.
Source:
@@ -262,7 +273,7 @@ It's used for seamless note versioning.
Source:
@@ -330,7 +341,7 @@ It's used for seamless note versioning.
Source:
@@ -398,7 +409,7 @@ It's used for seamless note versioning.
Source:
@@ -466,7 +477,7 @@ It's used for seamless note versioning.
Source:
@@ -534,7 +545,7 @@ It's used for seamless note versioning.
Source:
@@ -602,7 +613,7 @@ It's used for seamless note versioning.
Source:
@@ -670,7 +681,7 @@ It's used for seamless note versioning.
Source:
@@ -738,7 +749,7 @@ It's used for seamless note versioning.
Source:
@@ -806,7 +817,7 @@ It's used for seamless note versioning.
Source:
@@ -874,7 +885,7 @@ It's used for seamless note versioning.
Source:
@@ -942,7 +953,7 @@ It's used for seamless note versioning.
Source:
@@ -1018,7 +1029,7 @@ It's used for seamless note versioning.
Source:
@@ -1120,7 +1131,7 @@ It's used for seamless note versioning.
Source:
@@ -1222,7 +1233,7 @@ It's used for seamless note versioning.
Source:
@@ -1275,6 +1286,274 @@ It's used for seamless note versioning. + + + + + +

markAsDeleted(deleteIdopt)

+ + + + + + +
+ Mark the entity as (soft) deleted. It will be completely erased later. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
deleteId + + + + <optional>
+ + + + + +
+ + null + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

save() → {AbstractEntity}

+ + + + + + +
+ Saves entity - executes SQL, but doesn't commit the transaction on its own +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +AbstractEntity + + +
+
+ + + + + + + + @@ -1290,13 +1569,13 @@ It's used for seamless note versioning.
diff --git a/docs/backend_api/Option.html b/docs/backend_api/Option.html index 6778a7407..2c43460c7 100644 --- a/docs/backend_api/Option.html +++ b/docs/backend_api/Option.html @@ -93,7 +93,7 @@
Source:
@@ -127,6 +127,17 @@ +

Extends

+ + + + + + + + @@ -193,7 +204,7 @@
Source:
@@ -261,7 +272,7 @@
Source:
@@ -329,7 +340,7 @@
Source:
@@ -397,7 +408,7 @@
Source:
@@ -417,6 +428,278 @@ +

Methods

+ + + + + + + +

markAsDeleted(deleteIdopt)

+ + + + + + +
+ Mark the entity as (soft) deleted. It will be completely erased later. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
deleteId + + + + <optional>
+ + + + + +
+ + null + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

save() → {AbstractEntity}

+ + + + + + +
+ Saves entity - executes SQL, but doesn't commit the transaction on its own +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +AbstractEntity + + +
+
+ + + + + + + + + @@ -431,13 +714,13 @@
diff --git a/docs/backend_api/RecentNote.html b/docs/backend_api/RecentNote.html index 1e3c22af3..264580c72 100644 --- a/docs/backend_api/RecentNote.html +++ b/docs/backend_api/RecentNote.html @@ -93,7 +93,7 @@
Source:
@@ -127,6 +127,17 @@ +

Extends

+ + + + + + + + @@ -193,7 +204,7 @@
Source:
@@ -261,7 +272,7 @@
Source:
@@ -329,7 +340,7 @@
Source:
@@ -349,6 +360,278 @@ +

Methods

+ + + + + + + +

markAsDeleted(deleteIdopt)

+ + + + + + +
+ Mark the entity as (soft) deleted. It will be completely erased later. +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
deleteId + + + + <optional>
+ + + + + +
+ + null + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

save() → {AbstractEntity}

+ + + + + + +
+ Saves entity - executes SQL, but doesn't commit the transaction on its own +
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +AbstractEntity + + +
+
+ + + + + + + + + @@ -363,13 +646,13 @@
diff --git a/docs/backend_api/becca_entities_attribute.js.html b/docs/backend_api/becca_entities_attribute.js.html index c3c28d026..10515c065 100644 --- a/docs/backend_api/becca_entities_attribute.js.html +++ b/docs/backend_api/becca_entities_attribute.js.html @@ -37,6 +37,8 @@ const promotedAttributeDefinitionParser = require("../../services/promoted_attri /** * Attribute is an abstract concept which has two real uses - label (key - value pair) * and relation (representing named relationship between source and target note) + * + * @extends AbstractEntity */ class Attribute extends AbstractEntity { static get entityName() { return "attributes"; } @@ -245,13 +247,13 @@ module.exports = Attribute;
diff --git a/docs/backend_api/becca_entities_branch.js.html b/docs/backend_api/becca_entities_branch.js.html index 9acf0a14f..94ffed9dc 100644 --- a/docs/backend_api/becca_entities_branch.js.html +++ b/docs/backend_api/becca_entities_branch.js.html @@ -36,6 +36,8 @@ const dateUtils = require("../../services/date_utils"); /** * Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple * parents. + * + * @extends AbstractEntity */ class Branch extends AbstractEntity { static get entityName() { return "branches"; } @@ -193,13 +195,13 @@ module.exports = Branch;
diff --git a/docs/backend_api/becca_entities_etapi_token.js.html b/docs/backend_api/becca_entities_etapi_token.js.html index 8f74155d7..da33cc50d 100644 --- a/docs/backend_api/becca_entities_etapi_token.js.html +++ b/docs/backend_api/becca_entities_etapi_token.js.html @@ -30,16 +30,17 @@ const dateUtils = require('../../services/date_utils'); const AbstractEntity = require("./abstract_entity"); -const sql = require("../../services/sql.js"); /** * EtapiToken is an entity representing token used to authenticate against Trilium REST API from client applications. * Used by: * - Trilium Sender * - ETAPI clients - * + * * The format user is presented with is "<etapiTokenId>_<tokenHash>". This is also called "authToken" to distinguish it * from tokenHash and token. + * + * @extends AbstractEntity */ class EtapiToken extends AbstractEntity { static get entityName() { return "etapi_tokens"; } @@ -70,10 +71,12 @@ class EtapiToken extends AbstractEntity { this.utcDateModified = row.utcDateModified || this.utcDateCreated; /** @type {boolean} */ this.isDeleted = !!row.isDeleted; - - this.becca.etapiTokens[this.etapiTokenId] = this; + + if (this.etapiTokenId) { + this.becca.etapiTokens[this.etapiTokenId] = this; + } } - + init() { if (this.etapiTokenId) { this.becca.etapiTokens[this.etapiTokenId] = this; @@ -111,13 +114,13 @@ module.exports = EtapiToken;
diff --git a/docs/backend_api/becca_entities_note.js.html b/docs/backend_api/becca_entities_note.js.html index c34f9ca82..2aae3ae51 100644 --- a/docs/backend_api/becca_entities_note.js.html +++ b/docs/backend_api/becca_entities_note.js.html @@ -42,6 +42,8 @@ const RELATION = 'relation'; /** * Trilium's main entity which can represent text note, image, code note, file attachment etc. + * + * @extends AbstractEntity */ class Note extends AbstractEntity { static get entityName() { return "notes"; } @@ -1155,6 +1157,7 @@ class Note extends AbstractEntity { if (this.isProtected && !this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) { try { this.title = protectedSessionService.decryptString(this.title); + this.flatTextCache = null; this.isDecrypted = true; } @@ -1220,13 +1223,13 @@ module.exports = Note;
diff --git a/docs/backend_api/becca_entities_note_revision.js.html b/docs/backend_api/becca_entities_note_revision.js.html index c9a914a1e..a1f9ca729 100644 --- a/docs/backend_api/becca_entities_note_revision.js.html +++ b/docs/backend_api/becca_entities_note_revision.js.html @@ -39,6 +39,8 @@ const AbstractEntity = require("./abstract_entity"); /** * NoteRevision represents snapshot of note's title and content at some point in the past. * It's used for seamless note versioning. + * + * @extends AbstractEntity */ class NoteRevision extends AbstractEntity { static get entityName() { return "note_revisions"; } @@ -230,13 +232,13 @@ module.exports = NoteRevision;
diff --git a/docs/backend_api/becca_entities_option.js.html b/docs/backend_api/becca_entities_option.js.html index 54244d7f1..15d02ab4d 100644 --- a/docs/backend_api/becca_entities_option.js.html +++ b/docs/backend_api/becca_entities_option.js.html @@ -33,6 +33,8 @@ const AbstractEntity = require("./abstract_entity"); /** * Option represents name-value pair, either directly configurable by the user or some system property. + * + * @extends AbstractEntity */ class Option extends AbstractEntity { static get entityName() { return "options"; } @@ -81,13 +83,13 @@ module.exports = Option;
diff --git a/docs/backend_api/becca_entities_recent_note.js.html b/docs/backend_api/becca_entities_recent_note.js.html index 9f3a32049..3c7e3b40b 100644 --- a/docs/backend_api/becca_entities_recent_note.js.html +++ b/docs/backend_api/becca_entities_recent_note.js.html @@ -33,6 +33,8 @@ const AbstractEntity = require("./abstract_entity"); /** * RecentNote represents recently visited note. + * + * @extends AbstractEntity */ class RecentNote extends AbstractEntity { static get entityName() { return "recent_notes"; } @@ -69,13 +71,13 @@ module.exports = RecentNote;
diff --git a/docs/backend_api/global.html b/docs/backend_api/global.html index 44aefb433..18ade2d89 100644 --- a/docs/backend_api/global.html +++ b/docs/backend_api/global.html @@ -1083,13 +1083,13 @@
diff --git a/docs/backend_api/index.html b/docs/backend_api/index.html index 09371c322..0799c2465 100644 --- a/docs/backend_api/index.html +++ b/docs/backend_api/index.html @@ -50,13 +50,13 @@
diff --git a/docs/backend_api/module-sql.html b/docs/backend_api/module-sql.html index 4c32d5ffb..a129e51d9 100644 --- a/docs/backend_api/module-sql.html +++ b/docs/backend_api/module-sql.html @@ -208,7 +208,7 @@
Source:
@@ -388,7 +388,7 @@
Source:
@@ -590,7 +590,7 @@
Source:
@@ -792,7 +792,7 @@
Source:
@@ -994,7 +994,7 @@
Source:
@@ -1196,7 +1196,7 @@
Source:
@@ -1252,13 +1252,13 @@
diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html index c90667e2a..e9641e25b 100644 --- a/docs/backend_api/services_backend_script_api.js.html +++ b/docs/backend_api/services_backend_script_api.js.html @@ -321,7 +321,7 @@ function BackendScriptApi(currentNote, apiParams) { * * @param message */ - this.log = message => log.info(`Script "${currentNote.title}" (${currentNote.noteId}): ${message}`); + this.log = message => log.info(message); /** * Returns root note of the calendar. @@ -467,13 +467,13 @@ module.exports = BackendScriptApi;
diff --git a/docs/backend_api/services_sql.js.html b/docs/backend_api/services_sql.js.html index 0f6652db6..ccfeaa984 100644 --- a/docs/backend_api/services_sql.js.html +++ b/docs/backend_api/services_sql.js.html @@ -36,6 +36,7 @@ const log = require('./log'); const Database = require('better-sqlite3'); const dataDir = require('./data_dir'); const cls = require('./cls'); +const fs = require("fs-extra"); const dbConnection = new Database(dataDir.DOCUMENT_PATH); dbConnection.pragma('journal_mode = WAL'); @@ -304,6 +305,15 @@ function fillParamList(paramIds, truncate = true) { s.run(paramIds); } +async function copyDatabase(targetFilePath) { + try { + fs.unlinkSync(targetFilePath); + } catch (e) { + } // unlink throws exception if the file did not exist + + await dbConnection.backup(targetFilePath); +} + module.exports = { dbConnection, insert, @@ -375,7 +385,8 @@ module.exports = { executeScript, transactional, upsert, - fillParamList + fillParamList, + copyDatabase }; @@ -387,13 +398,13 @@ module.exports = {
diff --git a/docs/frontend_api/Attribute.html b/docs/frontend_api/Attribute.html index d3623966a..2dd81757d 100644 --- a/docs/frontend_api/Attribute.html +++ b/docs/frontend_api/Attribute.html @@ -748,7 +748,7 @@ and relation (representing named relationship between source and target note) diff --git a/docs/frontend_api/Branch.html b/docs/frontend_api/Branch.html index dd5aec666..62f0c7722 100644 --- a/docs/frontend_api/Branch.html +++ b/docs/frontend_api/Branch.html @@ -1062,7 +1062,7 @@ parents.
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html index d925e268c..59f3b0fff 100644 --- a/docs/frontend_api/FrontendScriptApi.html +++ b/docs/frontend_api/FrontendScriptApi.html @@ -6666,7 +6666,7 @@ Typical use case is when new note has been created, we should wait until it is s
diff --git a/docs/frontend_api/NoteComplement.html b/docs/frontend_api/NoteComplement.html index be954630b..53a162fef 100644 --- a/docs/frontend_api/NoteComplement.html +++ b/docs/frontend_api/NoteComplement.html @@ -781,7 +781,7 @@
diff --git a/docs/frontend_api/NoteShort.html b/docs/frontend_api/NoteShort.html index 178d41f85..2bfe195bd 100644 --- a/docs/frontend_api/NoteShort.html +++ b/docs/frontend_api/NoteShort.html @@ -7269,7 +7269,7 @@ This note's representation is used in note tree and is kept in Froca.
diff --git a/docs/frontend_api/entities_attribute.js.html b/docs/frontend_api/entities_attribute.js.html index 9f859d8ae..387d4eb2e 100644 --- a/docs/frontend_api/entities_attribute.js.html +++ b/docs/frontend_api/entities_attribute.js.html @@ -110,7 +110,7 @@ export default Attribute;
diff --git a/docs/frontend_api/entities_branch.js.html b/docs/frontend_api/entities_branch.js.html index b5a53597d..0ef296b32 100644 --- a/docs/frontend_api/entities_branch.js.html +++ b/docs/frontend_api/entities_branch.js.html @@ -99,7 +99,7 @@ export default Branch;
diff --git a/docs/frontend_api/entities_note_complement.js.html b/docs/frontend_api/entities_note_complement.js.html index 1a17e1c48..eb5f6203a 100644 --- a/docs/frontend_api/entities_note_complement.js.html +++ b/docs/frontend_api/entities_note_complement.js.html @@ -82,7 +82,7 @@ export default NoteComplement;
diff --git a/docs/frontend_api/entities_note_short.js.html b/docs/frontend_api/entities_note_short.js.html index a82770d7d..20a9ad597 100644 --- a/docs/frontend_api/entities_note_short.js.html +++ b/docs/frontend_api/entities_note_short.js.html @@ -848,7 +848,7 @@ export default NoteShort;
diff --git a/docs/frontend_api/global.html b/docs/frontend_api/global.html index 441ecb139..e3bb5cbf0 100644 --- a/docs/frontend_api/global.html +++ b/docs/frontend_api/global.html @@ -431,7 +431,7 @@
diff --git a/docs/frontend_api/index.html b/docs/frontend_api/index.html index 3ea1a69d5..590530faa 100644 --- a/docs/frontend_api/index.html +++ b/docs/frontend_api/index.html @@ -56,7 +56,7 @@
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index ba3bad2bd..451ca46bc 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -529,7 +529,7 @@ export default FrontendScriptApi;
diff --git a/docs/frontend_api/widgets_collapsible_widget.js.html b/docs/frontend_api/widgets_collapsible_widget.js.html index 905052e62..ed31ad9b3 100644 --- a/docs/frontend_api/widgets_collapsible_widget.js.html +++ b/docs/frontend_api/widgets_collapsible_widget.js.html @@ -81,7 +81,7 @@ export default class CollapsibleWidget extends NoteContextAwareWidget {
diff --git a/src/becca/entities/abstract_entity.js b/src/becca/entities/abstract_entity.js index 5fa814a75..9981373c3 100644 --- a/src/becca/entities/abstract_entity.js +++ b/src/becca/entities/abstract_entity.js @@ -10,6 +10,9 @@ const log = require("../../services/log"); let becca = null; +/** + * Base class for all backend entities. + */ class AbstractEntity { beforeSaving() { this.generateIdIfNecessary(); @@ -62,6 +65,11 @@ class AbstractEntity { return this.getPojo(); } + /** + * Saves entity - executes SQL, but doesn't commit the transaction on its own + * + * @returns {AbstractEntity} + */ save() { const entityName = this.constructor.entityName; const primaryKeyName = this.constructor.primaryKeyName; @@ -100,6 +108,11 @@ class AbstractEntity { return this; } + /** + * Mark the entity as (soft) deleted. It will be completely erased later. + * + * @param [deleteId=null] + */ markAsDeleted(deleteId = null) { const entityId = this[this.constructor.primaryKeyName]; const entityName = this.constructor.entityName; diff --git a/src/becca/entities/attribute.js b/src/becca/entities/attribute.js index 5cdc23231..4d6cb969d 100644 --- a/src/becca/entities/attribute.js +++ b/src/becca/entities/attribute.js @@ -9,6 +9,8 @@ const promotedAttributeDefinitionParser = require("../../services/promoted_attri /** * Attribute is an abstract concept which has two real uses - label (key - value pair) * and relation (representing named relationship between source and target note) + * + * @extends AbstractEntity */ class Attribute extends AbstractEntity { static get entityName() { return "attributes"; } diff --git a/src/becca/entities/branch.js b/src/becca/entities/branch.js index 75543232b..10ce46a54 100644 --- a/src/becca/entities/branch.js +++ b/src/becca/entities/branch.js @@ -8,6 +8,8 @@ const dateUtils = require("../../services/date_utils"); /** * Branch represents a relationship between a child note and its parent note. Trilium allows a note to have multiple * parents. + * + * @extends AbstractEntity */ class Branch extends AbstractEntity { static get entityName() { return "branches"; } diff --git a/src/becca/entities/etapi_token.js b/src/becca/entities/etapi_token.js index 170e79bc8..8085d11b4 100644 --- a/src/becca/entities/etapi_token.js +++ b/src/becca/entities/etapi_token.js @@ -11,6 +11,8 @@ const AbstractEntity = require("./abstract_entity"); * * The format user is presented with is "_". This is also called "authToken" to distinguish it * from tokenHash and token. + * + * @extends AbstractEntity */ class EtapiToken extends AbstractEntity { static get entityName() { return "etapi_tokens"; } diff --git a/src/becca/entities/note.js b/src/becca/entities/note.js index 43e1c93f1..5f23e2d15 100644 --- a/src/becca/entities/note.js +++ b/src/becca/entities/note.js @@ -14,6 +14,8 @@ const RELATION = 'relation'; /** * Trilium's main entity which can represent text note, image, code note, file attachment etc. + * + * @extends AbstractEntity */ class Note extends AbstractEntity { static get entityName() { return "notes"; } diff --git a/src/becca/entities/note_revision.js b/src/becca/entities/note_revision.js index cd9ce86f6..db8a997cf 100644 --- a/src/becca/entities/note_revision.js +++ b/src/becca/entities/note_revision.js @@ -11,6 +11,8 @@ const AbstractEntity = require("./abstract_entity"); /** * NoteRevision represents snapshot of note's title and content at some point in the past. * It's used for seamless note versioning. + * + * @extends AbstractEntity */ class NoteRevision extends AbstractEntity { static get entityName() { return "note_revisions"; } diff --git a/src/becca/entities/option.js b/src/becca/entities/option.js index 03760e515..cbb3eb576 100644 --- a/src/becca/entities/option.js +++ b/src/becca/entities/option.js @@ -5,6 +5,8 @@ const AbstractEntity = require("./abstract_entity"); /** * Option represents name-value pair, either directly configurable by the user or some system property. + * + * @extends AbstractEntity */ class Option extends AbstractEntity { static get entityName() { return "options"; } diff --git a/src/becca/entities/recent_note.js b/src/becca/entities/recent_note.js index 62fd6cd26..e93577b40 100644 --- a/src/becca/entities/recent_note.js +++ b/src/becca/entities/recent_note.js @@ -5,6 +5,8 @@ const AbstractEntity = require("./abstract_entity"); /** * RecentNote represents recently visited note. + * + * @extends AbstractEntity */ class RecentNote extends AbstractEntity { static get entityName() { return "recent_notes"; }