diff --git a/docs/backend_api/ApiToken.html b/docs/backend_api/ApiToken.html
index 8642aa735..d0243577f 100644
--- a/docs/backend_api/ApiToken.html
+++ b/docs/backend_api/ApiToken.html
@@ -282,13 +282,13 @@
diff --git a/docs/backend_api/Attribute.html b/docs/backend_api/Attribute.html
index b3d34fc0c..500540758 100644
--- a/docs/backend_api/Attribute.html
+++ b/docs/backend_api/Attribute.html
@@ -420,13 +420,13 @@
diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html
index 99ea4eb64..20a81859d 100644
--- a/docs/backend_api/BackendScriptApi.html
+++ b/docs/backend_api/BackendScriptApi.html
@@ -1925,7 +1925,7 @@
-
getImage(imageId) → {Promise.<(Image|null)>}
+ getImage(imageId) → {Promise.<(Image|null)>}
@@ -2056,7 +2056,7 @@
-Promise.<(Image|null)>
+Promise.<(Image|null)>
@@ -3808,13 +3808,13 @@ transactional by default.
diff --git a/docs/backend_api/Branch.html b/docs/backend_api/Branch.html
index d1dcb70c4..8bb6a257d 100644
--- a/docs/backend_api/Branch.html
+++ b/docs/backend_api/Branch.html
@@ -505,13 +505,13 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
diff --git a/docs/backend_api/Entity.html b/docs/backend_api/Entity.html
index 01f52046f..f3afcb969 100644
--- a/docs/backend_api/Entity.html
+++ b/docs/backend_api/Entity.html
@@ -210,13 +210,13 @@
diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html
index 3f58d4527..9a7d18e45 100644
--- a/docs/backend_api/Note.html
+++ b/docs/backend_api/Note.html
@@ -613,7 +613,7 @@
Source:
@@ -809,7 +809,7 @@
Source:
@@ -1005,7 +1005,7 @@
Source:
@@ -1177,7 +1177,7 @@
Source:
@@ -1342,7 +1342,7 @@
Source:
@@ -1518,7 +1518,7 @@
Source:
@@ -1622,7 +1622,7 @@
Source:
@@ -1722,7 +1722,7 @@
Source:
@@ -1826,7 +1826,7 @@
Source:
@@ -1979,7 +1979,7 @@
Source:
@@ -2144,7 +2144,7 @@
Source:
@@ -2297,7 +2297,7 @@
Source:
@@ -2353,7 +2353,7 @@
- (async) getNoteImages() → {Promise.<Array.<NoteImage>>}
+ (async) getLinks() → {Promise.<Array.<Link>>}
@@ -2401,7 +2401,7 @@
Source:
@@ -2435,7 +2435,111 @@
-Promise.<Array.<NoteImage>>
+Promise.<Array.<Link>>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (async) getLinksWithDeleted() → {Promise.<Array.<Link>>}
+
+
+
+
+
+
+
+ Return all links from this note, including deleted ones.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Promise.<Array.<Link>>
@@ -2501,7 +2605,7 @@
- Source:
@@ -2605,7 +2709,7 @@
- Source:
@@ -2758,7 +2862,7 @@
- Source:
@@ -2923,7 +3027,7 @@
- Source:
@@ -3076,7 +3180,7 @@
- Source:
@@ -3232,7 +3336,7 @@
- Source:
@@ -3340,7 +3444,7 @@
- Source:
@@ -3440,7 +3544,7 @@
- Source:
@@ -3496,6 +3600,110 @@
+ (async) getTargetRelations() → {Promise.<Array.<Attribute>>}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ relations targetting this specific note
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Promise.<Array.<Attribute>>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(async) hasAttribute(type, name) → {Promise.<boolean>}
@@ -3616,7 +3824,7 @@
- Source:
@@ -3720,7 +3928,7 @@
- Source:
@@ -3873,7 +4081,7 @@
- Source:
@@ -4026,7 +4234,7 @@
- Source:
@@ -4135,7 +4343,7 @@ Cache is note instance scoped.
- Source:
@@ -4217,7 +4425,7 @@ Cache is note instance scoped.
- Source:
@@ -4321,7 +4529,7 @@ Cache is note instance scoped.
- Source:
@@ -4425,7 +4633,7 @@ Cache is note instance scoped.
- Source:
@@ -4529,7 +4737,7 @@ Cache is note instance scoped.
- Source:
@@ -4633,7 +4841,7 @@ Cache is note instance scoped.
- Source:
@@ -4860,7 +5068,7 @@ Cache is note instance scoped.
- Source:
@@ -5056,7 +5264,7 @@ Cache is note instance scoped.
- Source:
@@ -5252,7 +5460,7 @@ Cache is note instance scoped.
- Source:
@@ -5479,7 +5687,7 @@ Cache is note instance scoped.
- Source:
@@ -5675,7 +5883,7 @@ Cache is note instance scoped.
- Source:
@@ -5871,7 +6079,7 @@ Cache is note instance scoped.
- Source:
@@ -6129,7 +6337,7 @@ Cache is note instance scoped.
- Source:
@@ -6356,7 +6564,7 @@ Cache is note instance scoped.
- Source:
@@ -6583,7 +6791,7 @@ Cache is note instance scoped.
- Source:
@@ -6645,13 +6853,13 @@ Cache is note instance scoped.
diff --git a/docs/backend_api/NoteRevision.html b/docs/backend_api/NoteRevision.html
index 317a91731..146c08842 100644
--- a/docs/backend_api/NoteRevision.html
+++ b/docs/backend_api/NoteRevision.html
@@ -397,13 +397,13 @@
diff --git a/docs/backend_api/Option.html b/docs/backend_api/Option.html
index 74de22bc1..959be9ced 100644
--- a/docs/backend_api/Option.html
+++ b/docs/backend_api/Option.html
@@ -305,13 +305,13 @@
diff --git a/docs/backend_api/RecentNote.html b/docs/backend_api/RecentNote.html
index 86e19d189..be57c5c3e 100644
--- a/docs/backend_api/RecentNote.html
+++ b/docs/backend_api/RecentNote.html
@@ -282,13 +282,13 @@
diff --git a/docs/backend_api/entities_api_token.js.html b/docs/backend_api/entities_api_token.js.html
index d066908b5..254b8941c 100644
--- a/docs/backend_api/entities_api_token.js.html
+++ b/docs/backend_api/entities_api_token.js.html
@@ -69,13 +69,13 @@ module.exports = ApiToken;
diff --git a/docs/backend_api/entities_attribute.js.html b/docs/backend_api/entities_attribute.js.html
index 5783b5f41..06422b789 100644
--- a/docs/backend_api/entities_attribute.js.html
+++ b/docs/backend_api/entities_attribute.js.html
@@ -128,13 +128,13 @@ module.exports = Attribute;
diff --git a/docs/backend_api/entities_branch.js.html b/docs/backend_api/entities_branch.js.html
index edd23b3b6..771deed06 100644
--- a/docs/backend_api/entities_branch.js.html
+++ b/docs/backend_api/entities_branch.js.html
@@ -99,13 +99,13 @@ module.exports = Branch;
diff --git a/docs/backend_api/entities_entity.js.html b/docs/backend_api/entities_entity.js.html
index 3559ae81d..4e3728629 100644
--- a/docs/backend_api/entities_entity.js.html
+++ b/docs/backend_api/entities_entity.js.html
@@ -87,13 +87,13 @@ module.exports = Entity;
diff --git a/docs/backend_api/entities_note.js.html b/docs/backend_api/entities_note.js.html
index c9aa8c347..c3044d95f 100644
--- a/docs/backend_api/entities_note.js.html
+++ b/docs/backend_api/entities_note.js.html
@@ -64,9 +64,14 @@ class Note extends Entity {
super(row);
this.isProtected = !!this.isProtected;
+ /* true if content (meaning any kind of potentially encrypted content) is either not encrypted
+ * or encrypted, but with available protected session (so effectively decrypted) */
+ this.isContentAvailable = true;
// check if there's noteId, otherwise this is a new entity which wasn't encrypted yet
if (this.isProtected && this.noteId) {
+ this.isContentAvailable = protectedSessionService.isProtectedSessionAvailable();
+
protectedSessionService.decryptNote(this);
}
@@ -127,6 +132,13 @@ class Note extends Entity {
return await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
}
+ /**
+ * @returns {Promise<Attribute[]>} relations targetting this specific note
+ */
+ async getTargetRelations() {
+ return await repository.getEntities("SELECT * FROM attributes WHERE type = 'relation' AND isDeleted = 0 AND value = ?", [this.noteId]);
+ }
+
/**
* @param {string} [name] - attribute name to filter
* @returns {Promise<Attribute[]>} all note's attributes, including inherited ones
@@ -497,10 +509,19 @@ class Note extends Entity {
}
/**
- * @returns {Promise<NoteImage[]>}
+ * @returns {Promise<Link[]>}
*/
- async getNoteImages() {
- return await repository.getEntities("SELECT * FROM note_images WHERE noteId = ? AND isDeleted = 0", [this.noteId]);
+ async getLinks() {
+ return await repository.getEntities("SELECT * FROM links WHERE noteId = ? AND isDeleted = 0", [this.noteId]);
+ }
+
+ /**
+ * Return all links from this note, including deleted ones.
+ *
+ * @returns {Promise<Link[]>}
+ */
+ async getLinksWithDeleted() {
+ return await repository.getEntities("SELECT * FROM links WHERE noteId = ?", [this.noteId]);
}
/**
@@ -595,13 +616,13 @@ module.exports = Note;
diff --git a/docs/backend_api/entities_note_revision.js.html b/docs/backend_api/entities_note_revision.js.html
index 141785ab6..6925798bb 100644
--- a/docs/backend_api/entities_note_revision.js.html
+++ b/docs/backend_api/entities_note_revision.js.html
@@ -85,13 +85,13 @@ module.exports = NoteRevision;
diff --git a/docs/backend_api/entities_option.js.html b/docs/backend_api/entities_option.js.html
index 9349f16da..de304d431 100644
--- a/docs/backend_api/entities_option.js.html
+++ b/docs/backend_api/entities_option.js.html
@@ -72,13 +72,13 @@ module.exports = Option;
diff --git a/docs/backend_api/entities_recent_note.js.html b/docs/backend_api/entities_recent_note.js.html
index 64161f6ae..937f18f85 100644
--- a/docs/backend_api/entities_recent_note.js.html
+++ b/docs/backend_api/entities_recent_note.js.html
@@ -69,13 +69,13 @@ module.exports = RecentNote;
diff --git a/docs/backend_api/global.html b/docs/backend_api/global.html
index f24e8b242..84c6ab028 100644
--- a/docs/backend_api/global.html
+++ b/docs/backend_api/global.html
@@ -588,13 +588,13 @@
diff --git a/docs/backend_api/index.html b/docs/backend_api/index.html
index bc8a0fb26..76800ee58 100644
--- a/docs/backend_api/index.html
+++ b/docs/backend_api/index.html
@@ -50,13 +50,13 @@
diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html
index 4e49f4eb6..d283db72c 100644
--- a/docs/backend_api/services_backend_script_api.js.html
+++ b/docs/backend_api/services_backend_script_api.js.html
@@ -272,13 +272,13 @@ module.exports = BackendScriptApi;
diff --git a/docs/frontend_api/Branch.html b/docs/frontend_api/Branch.html
index 90ea874fc..e98118fe1 100644
--- a/docs/frontend_api/Branch.html
+++ b/docs/frontend_api/Branch.html
@@ -719,7 +719,7 @@
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html
index dd6f5247f..8ef12bc77 100644
--- a/docs/frontend_api/FrontendScriptApi.html
+++ b/docs/frontend_api/FrontendScriptApi.html
@@ -2846,7 +2846,7 @@ Internally this serializes the anonymous function into string and sends it to ba
diff --git a/docs/frontend_api/NoteFull.html b/docs/frontend_api/NoteFull.html
index 5dfb0e209..09c62a160 100644
--- a/docs/frontend_api/NoteFull.html
+++ b/docs/frontend_api/NoteFull.html
@@ -279,7 +279,7 @@
diff --git a/docs/frontend_api/NoteShort.html b/docs/frontend_api/NoteShort.html
index 5c2f1b23e..3ae4b0aec 100644
--- a/docs/frontend_api/NoteShort.html
+++ b/docs/frontend_api/NoteShort.html
@@ -1316,7 +1316,7 @@ Its notable omission is the note content.
diff --git a/docs/frontend_api/entities_branch.js.html b/docs/frontend_api/entities_branch.js.html
index 8fd3106c1..74826cdfb 100644
--- a/docs/frontend_api/entities_branch.js.html
+++ b/docs/frontend_api/entities_branch.js.html
@@ -76,7 +76,7 @@ export default Branch;
diff --git a/docs/frontend_api/entities_note_full.js.html b/docs/frontend_api/entities_note_full.js.html
index a14a9f0e0..820bf364a 100644
--- a/docs/frontend_api/entities_note_full.js.html
+++ b/docs/frontend_api/entities_note_full.js.html
@@ -64,7 +64,7 @@ export default NoteFull;
diff --git a/docs/frontend_api/entities_note_short.js.html b/docs/frontend_api/entities_note_short.js.html
index 28367adff..1a6cc0cd1 100644
--- a/docs/frontend_api/entities_note_short.js.html
+++ b/docs/frontend_api/entities_note_short.js.html
@@ -128,7 +128,7 @@ export default NoteShort;
diff --git a/docs/frontend_api/global.html b/docs/frontend_api/global.html
index 56e1bb957..52cf8fb2e 100644
--- a/docs/frontend_api/global.html
+++ b/docs/frontend_api/global.html
@@ -339,7 +339,7 @@
diff --git a/docs/frontend_api/index.html b/docs/frontend_api/index.html
index 08d878fb3..cd41ca3e4 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 4cf24ebeb..d45428a52 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -92,7 +92,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
.addClass("ui-icon ui-icon-" + opts.icon);
const button = $('<button>')
- .addClass("btn btn-xs")
+ .addClass("btn btn-sm")
.click(opts.action)
.append(icon)
.append($("<span>").text(opts.title));
@@ -269,7 +269,7 @@ export default FrontendScriptApi;