Skip to content

Build your personal knowledge base with Trilium Notes

updated API docs

azivner6a786cad83d3
diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html
index 986d1d8428..2ce1c467d9 100644
--- a/docs/backend_api/BackendScriptApi.html
+++ b/docs/backend_api/BackendScriptApi.html
@@ -3010,7 +3010,7 @@ the backend.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line234">line 234</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line236">line 236</a>
</li></ul></dd>
diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html
index fc34ea9bc2..bf222ab85a 100644
--- a/docs/backend_api/Note.html
+++ b/docs/backend_api/Note.html
@@ -373,7 +373,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line29">line 29</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line30">line 30</a>
</li></ul></dd>
@@ -438,17 +438,13 @@
- <h4 class="name" id="findChildNotesWithAttribute"><span class="type-signature">(async) </span>findChildNotesWithAttribute<span class="signature">(type, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
+ <h4 class="name" id="getAttribute"><span class="type-signature">(async) </span>getAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
-<div class="description">
- Finds child notes with given attribute name and value. Only own attributes are considered, not inherited ones
-</div>
-
@@ -470,8 +466,6 @@
<th>Type</th>
- <th>Attributes</th>
-
@@ -497,14 +491,6 @@
</td>
- <td class="attributes">
-
-
-
-
-
- </td>
-
@@ -528,14 +514,6 @@
</td>
- <td class="attributes">
-
-
-
-
-
- </td>
-
@@ -543,39 +521,6 @@
</tr>
-
- <tr>
-
- <td class="name"><code>value</code></td>
-
-
- <td class="type">
-
-
-<span class="param-type">string</span>
-
-
-
- </td>
-
-
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
-
-
- </td>
-
-
-
-
- <td class="description last">attribute value</td>
- </tr>
-
-
</tbody>
</table>
@@ -613,7 +558,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line443">line 443</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line254">line 254</a>
</li></ul></dd>
@@ -639,6 +584,10 @@
<h5>Returns:</h5>
+<div class="param-desc">
+ attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
+</div>
+
<dl>
@@ -647,7 +596,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Promise.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -665,17 +614,13 @@
- <h4 class="name" id="findChildNotesWithLabel"><span class="type-signature">(async) </span>findChildNotesWithLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
+ <h4 class="name" id="getAttributes"><span class="type-signature">(async) </span>getAttributes<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
-<div class="description">
- Finds notes with given label name and value. Only own labels are considered, not inherited ones
-</div>
-
@@ -721,37 +666,6 @@
- </td>
-
-
- <td class="attributes">
-
-
-
-
-
- </td>
-
-
-
-
- <td class="description last">label name</td>
- </tr>
-
-
-
- <tr>
-
- <td class="name"><code>value</code></td>
-
-
- <td class="type">
-
-
-<span class="param-type">string</span>
-
-
-
</td>
@@ -768,7 +682,7 @@
- <td class="description last">label value</td>
+ <td class="description last">attribute name to filter</td>
</tr>
@@ -809,7 +723,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line481">line 481</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line123">line 123</a>
</li></ul></dd>
@@ -835,6 +749,10 @@
<h5>Returns:</h5>
+<div class="param-desc">
+ all note's attributes, including inherited ones
+</div>
+
<dl>
@@ -843,7 +761,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
</dd>
@@ -861,17 +779,13 @@
- <h4 class="name" id="findChildNotesWithRelation"><span class="type-signature">(async) </span>findChildNotesWithRelation<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
+ <h4 class="name" id="getAttributeValue"><span class="type-signature">(async) </span>getAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
-<div class="description">
- Finds notes with given relation name and value. Only own relations are considered, not inherited ones
-</div>
-
@@ -893,8 +807,6 @@
<th>Type</th>
- <th>Attributes</th>
-
@@ -907,7 +819,7 @@
<tr>
- <td class="name"><code>name</code></td>
+ <td class="name"><code>type</code></td>
<td class="type">
@@ -920,25 +832,17 @@
</td>
- <td class="attributes">
-
-
-
-
-
- </td>
-
- <td class="description last">relation name</td>
+ <td class="description last">attribute type (label, relation, etc.)</td>
</tr>
<tr>
- <td class="name"><code>value</code></td>
+ <td class="name"><code>name</code></td>
<td class="type">
@@ -951,20 +855,10 @@
</td>
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
-
- </td>
-
-
- <td class="description last">relation value</td>
+ <td class="description last">attribute name</td>
</tr>
@@ -1005,7 +899,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line490">line 490</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line265">line 265</a>
</li></ul></dd>
@@ -1031,6 +925,10 @@
<h5>Returns:</h5>
+<div class="param-desc">
+ attribute value of given type and name or null if no such attribute exists.
+</div>
+
<dl>
@@ -1039,7 +937,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Promise.&lt;string></span>
</dd>
@@ -1057,7 +955,7 @@
- <h4 class="name" id="getAttribute"><span class="type-signature">(async) </span>getAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+ <h4 class="name" id="getBranches"><span class="type-signature">(async) </span>getBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
@@ -1072,76 +970,104 @@
- <h5>Parameters:</h5>
+
+
+
+
+<dl class="details">
+
-<table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
+
- <th>Type</th>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line552">line 552</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
+ </dd>
+</dl>
+
- <tr>
-
- <td class="name"><code>type</code></td>
-
- <td class="type">
-
-
-<span class="param-type">string</span>
-
- </td>
+
-
+
- <td class="description last">attribute type (label, relation, etc.)</td>
- </tr>
+
+ <h4 class="name" id="getChildBranches"><span class="type-signature">(async) </span>getChildBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
+
- <tr>
-
- <td class="name"><code>name</code></td>
-
- <td class="type">
-
-
-<span class="param-type">string</span>
-
- </td>
-
-
- <td class="description last">attribute name</td>
- </tr>
-
- </tbody>
-</table>
+
@@ -1177,7 +1103,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line251">line 251</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line580">line 580</a>
</li></ul></dd>
@@ -1204,7 +1130,7 @@
<div class="param-desc">
- attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
+ child branches of this note
</div>
@@ -1215,7 +1141,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;<a href="Attribute.html">Attribute</a>></span>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
</dd>
@@ -1233,7 +1159,7 @@
- <h4 class="name" id="getAttributes"><span class="type-signature">(async) </span>getAttributes<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+ <h4 class="name" id="getChildNotes"><span class="type-signature">(async) </span>getChildNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
@@ -1248,65 +1174,108 @@
- <h5>Parameters:</h5>
+
+
+
+
+<dl class="details">
+
-<table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
+
- <th>Type</th>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line566">line 566</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
- <th>Attributes</th>
-
+<div class="param-desc">
+ child notes of this note
+</div>
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
- <th class="last">Description</th>
- </tr>
- </thead>
- <tbody>
+ </dd>
+</dl>
+
- <tr>
-
- <td class="name"><code>name</code></td>
-
- <td class="type">
-
-
-<span class="param-type">string</span>
-
- </td>
+
- <td class="attributes">
-
- &lt;optional><br>
-
-
+
+
+
+ <h4 class="name" id="getDescendantNoteIds"><span class="type-signature">(async) </span>getDescendantNoteIds<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;string>>}</span></h4>
+
+
+
+
+
+
+
+
-
- </td>
-
-
- <td class="description last">attribute name to filter</td>
- </tr>
-
- </tbody>
-</table>
@@ -1342,7 +1311,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line120">line 120</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line441">line 441</a>
</li></ul></dd>
@@ -1369,7 +1338,7 @@
<div class="param-desc">
- all note's attributes, including inherited ones
+ return list of all descendant noteIds of this note. Returning just noteIds because number of notes can be huge. Includes also this note's noteId
</div>
@@ -1380,7 +1349,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">Promise.&lt;Array.&lt;string>></span>
</dd>
@@ -1398,13 +1367,17 @@
- <h4 class="name" id="getAttributeValue"><span class="type-signature">(async) </span>getAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
+ <h4 class="name" id="getDescendantNotesWithAttribute"><span class="type-signature">(async) </span>getDescendantNotesWithAttribute<span class="signature">(type, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
+<div class="description">
+ Finds descendant notes with given attribute name and value. Only own attributes are considered, not inherited ones
+</div>
+
@@ -1426,6 +1399,8 @@
<th>Type</th>
+ <th>Attributes</th>
+
@@ -1451,6 +1426,14 @@
</td>
+ <td class="attributes">
+
+
+
+
+
+ </td>
+
@@ -1474,10 +1457,51 @@
</td>
+ <td class="attributes">
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">attribute name</td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>value</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
- <td class="description last">attribute name</td>
+ <td class="description last">attribute value</td>
</tr>
@@ -1518,7 +1542,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line262">line 262</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line464">line 464</a>
</li></ul></dd>
@@ -1544,10 +1568,6 @@
<h5>Returns:</h5>
-<div class="param-desc">
- attribute value of given type and name or null if no such attribute exists.
-</div>
-
<dl>
@@ -1556,7 +1576,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;string></span>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
</dd>
@@ -1574,13 +1594,16 @@
- <h4 class="name" id="getBranches"><span class="type-signature">(async) </span>getBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
+ <h4 class="name" id="getDescendantNotesWithLabel"><span class="type-signature">(async) </span>getDescendantNotesWithLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
+<div class="description">
+ Finds descendant notes with given label name and value. Only own labels are considered, not inherited ones
+</div>
@@ -1590,96 +1613,141 @@
+ <h5>Parameters:</h5>
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+ <th>Type</th>
-<dl class="details">
+
+ <th>Attributes</th>
+
-
+
-
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+ <tbody>
-
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
-
+ <td class="type">
+
+
+<span class="param-type">string</span>
-
-
+
+ </td>
-
+
+ <td class="attributes">
+
-
+
-
+
+ </td>
+
-
+
-
+ <td class="description last">label name</td>
+ </tr>
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line531">line 531</a>
- </li></ul></dd>
-
+ <tr>
+
+ <td class="name"><code>value</code></td>
+
-
+ <td class="type">
+
+
+<span class="param-type">string</span>
-
-</dl>
+
+ </td>
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+ </td>
+
+
+ <td class="description last">label value</td>
+ </tr>
+
+ </tbody>
+</table>
-<h5>Returns:</h5>
+<dl class="details">
-
+
+
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
+
+
- </dd>
-</dl>
+
+
+
+
+
-
-
+
- <h4 class="name" id="getChildBranches"><span class="type-signature">(async) </span>getChildBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line502">line 502</a>
+ </li></ul></dd>
+
+
+</dl>
@@ -1693,47 +1761,45 @@
-<dl class="details">
+<h5>Returns:</h5>
-
+
-
-
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
-
-
+ </dd>
+</dl>
-
-
-
-
-
+
+
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line559">line 559</a>
- </li></ul></dd>
-
-
+ <h4 class="name" id="getDescendantNotesWithRelation"><span class="type-signature">(async) </span>getDescendantNotesWithRelation<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
-
-</dl>
+<div class="description">
+ Finds descendant notes with given relation name and value. Only own relations are considered, not inherited ones
+</div>
@@ -1743,54 +1809,96 @@
+ <h5>Parameters:</h5>
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
-<h5>Returns:</h5>
+ <th>Type</th>
-<div class="param-desc">
- child branches of this note
-</div>
+ <th>Attributes</th>
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
+ <tbody>
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
- </dd>
-</dl>
+ <td class="type">
+
+
+<span class="param-type">string</span>
-
+
+ </td>
+
+ <td class="attributes">
+
+
+
+ </td>
+
-
-
+ <td class="description last">relation name</td>
+ </tr>
- <h4 class="name" id="getChildNotes"><span class="type-signature">(async) </span>getChildNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
-
-
+ <tr>
+
+ <td class="name"><code>value</code></td>
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+ </td>
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+ </td>
+
+
+ <td class="description last">relation value</td>
+ </tr>
+
+ </tbody>
+</table>
@@ -1826,7 +1934,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line545">line 545</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line511">line 511</a>
</li></ul></dd>
@@ -1852,10 +1960,6 @@
<h5>Returns:</h5>
-<div class="param-desc">
- child notes of this note
-</div>
-
<dl>
@@ -1979,7 +2083,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line349">line 349</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line352">line 352</a>
</li></ul></dd>
@@ -2144,7 +2248,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line145">line 145</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line148">line 148</a>
</li></ul></dd>
@@ -2309,7 +2413,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line137">line 137</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line140">line 140</a>
</li></ul></dd>
@@ -2462,7 +2566,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line361">line 361</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line364">line 364</a>
</li></ul></dd>
@@ -2570,7 +2674,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line506">line 506</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line527">line 527</a>
</li></ul></dd>
@@ -2674,7 +2778,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line524">line 524</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line545">line 545</a>
</li></ul></dd>
@@ -2774,7 +2878,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line105">line 105</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line108">line 108</a>
</li></ul></dd>
@@ -2878,7 +2982,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line571">line 571</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line592">line 592</a>
</li></ul></dd>
@@ -3031,7 +3135,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line355">line 355</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line358">line 358</a>
</li></ul></dd>
@@ -3196,7 +3300,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line161">line 161</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line164">line 164</a>
</li></ul></dd>
@@ -3361,7 +3465,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line153">line 153</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line156">line 156</a>
</li></ul></dd>
@@ -3514,7 +3618,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line429">line 429</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line376">line 376</a>
</li></ul></dd>
@@ -3670,7 +3774,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line367">line 367</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line370">line 370</a>
</li></ul></dd>
@@ -3778,7 +3882,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line497">line 497</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line518">line 518</a>
</li></ul></dd>
@@ -3878,7 +3982,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line86">line 86</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line89">line 89</a>
</li></ul></dd>
@@ -3986,7 +4090,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line515">line 515</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line536">line 536</a>
</li></ul></dd>
@@ -4086,7 +4190,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line112">line 112</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line115">line 115</a>
</li></ul></dd>
@@ -4262,7 +4366,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line242">line 242</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line245">line 245</a>
</li></ul></dd>
@@ -4366,7 +4470,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line538">line 538</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line559">line 559</a>
</li></ul></dd>
@@ -4519,7 +4623,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line337">line 337</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line340">line 340</a>
</li></ul></dd>
@@ -4672,7 +4776,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line343">line 343</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line346">line 346</a>
</li></ul></dd>
@@ -4781,7 +4885,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line169">line 169</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line172">line 172</a>
</li></ul></dd>
@@ -4863,7 +4967,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line81">line 81</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line84">line 84</a>
</li></ul></dd>
@@ -4967,7 +5071,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line75">line 75</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line76">line 76</a>
</li></ul></dd>
@@ -5071,7 +5175,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line70">line 70</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line71">line 71</a>
</li></ul></dd>
@@ -5175,7 +5279,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line65">line 65</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line66">line 66</a>
</li></ul></dd>
@@ -5279,7 +5383,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line174">line 174</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line177">line 177</a>
</li></ul></dd>
@@ -5506,7 +5610,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line320">line 320</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line323">line 323</a>
</li></ul></dd>
@@ -5702,7 +5806,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line414">line 414</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line427">line 427</a>
</li></ul></dd>
@@ -5898,7 +6002,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line423">line 423</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line436">line 436</a>
</li></ul></dd>
@@ -6125,7 +6229,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line294">line 294</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line297">line 297</a>
</li></ul></dd>
@@ -6321,7 +6425,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line396">line 396</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line409">line 409</a>
</li></ul></dd>
@@ -6517,7 +6621,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line405">line 405</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line418">line 418</a>
</li></ul></dd>
@@ -6775,7 +6879,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line277">line 277</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line280">line 280</a>
</li></ul></dd>
@@ -7002,7 +7106,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line377">line 377</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line390">line 390</a>
</li></ul></dd>
@@ -7229,7 +7333,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line387">line 387</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line400">line 400</a>
</li></ul></dd>
diff --git a/docs/backend_api/entities_attribute.js.html b/docs/backend_api/entities_attribute.js.html
index f77e6a54da..646b5a0670 100644
--- a/docs/backend_api/entities_attribute.js.html
+++ b/docs/backend_api/entities_attribute.js.html
@@ -133,6 +133,11 @@ class Attribute extends Entity {
this.dateModified = dateUtils.nowDate();
}
}
+
+ // cannot be static!
+ updatePojo(pojo) {
+ delete pojo.isOwned;
+ }
}
module.exports = Attribute;</code></pre>
diff --git a/docs/backend_api/entities_branch.js.html b/docs/backend_api/entities_branch.js.html
index 041584115e..1f0ab47fb3 100644
--- a/docs/backend_api/entities_branch.js.html
+++ b/docs/backend_api/entities_branch.js.html
@@ -87,6 +87,11 @@ class Branch extends Entity {
this.dateModified = dateUtils.nowDate();
}
}
+
+ // cannot be static!
+ updatePojo(pojo) {
+ delete pojo.origParentNoteId;
+ }
}
module.exports = Branch;</code></pre>
diff --git a/docs/backend_api/entities_note.js.html b/docs/backend_api/entities_note.js.html
index e72456186d..07e582d585 100644
--- a/docs/backend_api/entities_note.js.html
+++ b/docs/backend_api/entities_note.js.html
@@ -32,6 +32,7 @@ const Entity = require('./entity');
const Attribute = require('./attribute');
const protectedSessionService = require('../services/protected_session');
const repository = require('../services/repository');
+const sql = require('../services/sql');
const dateUtils = require('../services/date_utils');
const LABEL = 'label';
@@ -102,7 +103,9 @@ class Note extends Entity {
/** @returns {boolean} true if this note is JavaScript (code or attachment) */
isJavaScript() {
return (this.type === "code" || this.type === "file")
- &amp;&amp; (this.mime.startsWith("application/javascript") || this.mime === "application/x-javascript");
+ &amp;&amp; (this.mime.startsWith("application/javascript")
+ || this.mime === "application/x-javascript"
+ || this.mime === "text/javascript");
}
/** @returns {boolean} true if this note is HTML */
@@ -394,6 +397,16 @@ class Note extends Entity {
*/
async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
+ /**
+ * @param {string} name
+ * @returns {Promise&lt;Note>|null} target note of the relation or null (if target is empty or note was not found)
+ */
+ async getRelationTarget(name) {
+ const relation = await this.getRelation(name);
+
+ return relation ? await repository.getNote(relation.value) : null;
+ }
+
/**
* Based on enabled, label is either set or removed.
*
@@ -451,24 +464,32 @@ class Note extends Entity {
async removeRelation(name, value) { return await this.removeAttribute(RELATION, name, value); }
/**
- * @param {string} name
- * @returns {Promise&lt;Note>|null} target note of the relation or null (if target is empty or note was not found)
+ * @return {Promise&lt;string[]>} return list of all descendant noteIds of this note. Returning just noteIds because number of notes can be huge. Includes also this note's noteId
*/
- async getRelationTarget(name) {
- const relation = await this.getRelation(name);
-
- return relation ? await repository.getNote(relation.value) : null;
+ async getDescendantNoteIds() {
+ return await sql.getColumn(`
+ WITH RECURSIVE
+ tree(noteId) AS (
+ SELECT ?
+ UNION
+ SELECT branches.noteId FROM branches
+ JOIN tree ON branches.parentNoteId = tree.noteId
+ JOIN notes ON notes.noteId = branches.noteId
+ WHERE notes.isDeleted = 0
+ AND branches.isDeleted = 0
+ )
+ SELECT noteId FROM tree`, [this.noteId]);
}
/**
- * Finds child notes with given attribute name and value. Only own attributes are considered, not inherited ones
+ * Finds descendant notes with given attribute name and value. Only own attributes are considered, not inherited ones
*
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @param {string} [value] - attribute value
* @returns {Promise&lt;Note[]>}
*/
- async findChildNotesWithAttribute(type, name, value) {
+ async getDescendantNotesWithAttribute(type, name, value) {
const params = [this.noteId, name];
let valueCondition = "";
@@ -500,22 +521,22 @@ class Note extends Entity {
}
/**
- * Finds notes with given label name and value. Only own labels are considered, not inherited ones
+ * Finds descendant notes with given label name and value. Only own labels are considered, not inherited ones
*
* @param {string} name - label name
* @param {string} [value] - label value
* @returns {Promise&lt;Note[]>}
*/
- async findChildNotesWithLabel(name, value) { return await this.findChildNotesWithAttribute(LABEL, name, value); }
+ async getDescendantNotesWithLabel(name, value) { return await this.getDescendantNotesWithAttribute(LABEL, name, value); }
/**
- * Finds notes with given relation name and value. Only own relations are considered, not inherited ones
+ * Finds descendant notes with given relation name and value. Only own relations are considered, not inherited ones
*
* @param {string} name - relation name
* @param {string} [value] - relation value
* @returns {Promise&lt;Note[]>}
*/
- async findChildNotesWithRelation(name, value) { return await this.findChildNotesWithAttribute(RELATION, name, value); }
+ async getDescendantNotesWithRelation(name, value) { return await this.getDescendantNotesWithAttribute(RELATION, name, value); }
/**
* Returns note revisions of this note.
@@ -615,10 +636,6 @@ class Note extends Entity {
// we do this here because encryption needs the note ID for the IV
this.generateIdIfNecessary();
- if (this.isProtected) {
- protectedSessionService.encryptNote(this);
- }
-
if (!this.isDeleted) {
this.isDeleted = false;
}
@@ -633,6 +650,17 @@ class Note extends Entity {
this.dateModified = dateUtils.nowDate();
}
}
+
+ // cannot be static!
+ updatePojo(pojo) {
+ if (pojo.isProtected) {
+ protectedSessionService.encryptNote(pojo);
+ }
+
+ delete pojo.jsonContent;
+ delete pojo.isContentAvailable;
+ delete pojo.__attributeCache;
+ }
}
module.exports = Note;</code></pre>
diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html
index 914220018f..5cc8cc3936 100644
--- a/docs/backend_api/services_backend_script_api.js.html
+++ b/docs/backend_api/services_backend_script_api.js.html
@@ -253,6 +253,8 @@ function BackendScriptApi(startNote, currentNote, originEntity) {
*/
this.transactional = sql.transactional;
+ this.sql = sql;
+
/**
* Trigger tree refresh in all connected clients. This is required when some tree change happens in
* the backend.
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html
index f2a68ba02b..1cbea7dd91 100644
--- a/docs/frontend_api/FrontendScriptApi.html
+++ b/docs/frontend_api/FrontendScriptApi.html
@@ -81,7 +81,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line16">line 16</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line17">line 17</a>
</li></ul></dd>
@@ -221,7 +221,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line22">line 22</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line23">line 23</a>
</li></ul></dd>
@@ -334,7 +334,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line24">line 24</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line25">line 25</a>
</li></ul></dd>
@@ -444,7 +444,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line20">line 20</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line21">line 21</a>
</li></ul></dd>
@@ -573,7 +573,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line41">line 41</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line42">line 42</a>
</li></ul></dd>
@@ -726,7 +726,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line33">line 33</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line34">line 34</a>
</li></ul></dd>
@@ -879,7 +879,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line60">line 60</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line61">line 61</a>
</li></ul></dd>
@@ -1057,7 +1057,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line197">line 197</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line198">line 198</a>
</li></ul></dd>
@@ -1188,7 +1188,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line157">line 157</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line158">line 158</a>
</li></ul></dd>
@@ -1292,7 +1292,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line221">line 221</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line222">line 222</a>
</li></ul></dd>
@@ -1396,7 +1396,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line203">line 203</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line204">line 204</a>
</li></ul></dd>
@@ -1500,7 +1500,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line215">line 215</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line216">line 216</a>
</li></ul></dd>
@@ -1609,7 +1609,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line150">line 150</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line151">line 151</a>
</li></ul></dd>
@@ -1808,7 +1808,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line142">line 142</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line143">line 143</a>
</li></ul></dd>
@@ -1957,7 +1957,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line209">line 209</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line210">line 210</a>
</li></ul></dd>
@@ -2088,7 +2088,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line164">line 164</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line165">line 165</a>
</li></ul></dd>
@@ -2196,7 +2196,7 @@ otherwise (by e.g. createNoteLink())
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line188">line 188</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line189">line 189</a>
</li></ul></dd>
@@ -2373,7 +2373,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line110">line 110</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line111">line 111</a>
</li></ul></dd>
@@ -2526,7 +2526,138 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line227">line 227</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line228">line 228</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="setupElementTooltip"><span class="type-signature"></span>setupElementTooltip<span class="signature">($el)</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>$el</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">object</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">jquery object on which to setup the tooltip</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line234">line 234</a>
</li></ul></dd>
@@ -2661,7 +2792,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line180">line 180</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line181">line 181</a>
</li></ul></dd>
@@ -2796,7 +2927,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line172">line 172</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line173">line 173</a>
</li></ul></dd>
diff --git a/docs/frontend_api/NoteShort.html b/docs/frontend_api/NoteShort.html
index e9a05c8b8a..a637cb8ba6 100644
--- a/docs/frontend_api/NoteShort.html
+++ b/docs/frontend_api/NoteShort.html
@@ -94,7 +94,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line5">line 5</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line12">line 12</a>
</li></ul></dd>
@@ -182,7 +182,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line19">line 19</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line26">line 26</a>
</li></ul></dd>
@@ -240,7 +240,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line13">line 13</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line20">line 20</a>
</li></ul></dd>
@@ -298,7 +298,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line17">line 17</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line24">line 24</a>
</li></ul></dd>
@@ -356,7 +356,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line9">line 9</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line16">line 16</a>
</li></ul></dd>
@@ -414,7 +414,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line11">line 11</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line18">line 18</a>
</li></ul></dd>
@@ -472,7 +472,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line15">line 15</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line22">line 22</a>
</li></ul></dd>
@@ -500,19 +500,91 @@ Its notable omission is the note content.</div>
- <h4 class="name" id="getBranches"><span class="type-signature">(async) </span>getBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
+ <h4 class="name" id="getAttribute"><span class="type-signature">(async) </span>getAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+
+ <td class="name"><code>type</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">attribute type (label, relation, etc.)</td>
+ </tr>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+ </td>
+
+
+ <td class="description last">attribute name</td>
+ </tr>
+
+ </tbody>
+</table>
@@ -548,7 +620,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line29">line 29</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line144">line 144</a>
</li></ul></dd>
@@ -574,6 +646,10 @@ Its notable omission is the note content.</div>
<h5>Returns:</h5>
+<div class="param-desc">
+ attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
+</div>
+
<dl>
@@ -582,7 +658,7 @@ Its notable omission is the note content.</div>
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
+<span class="param-type">Promise.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -600,19 +676,80 @@ Its notable omission is the note content.</div>
- <h4 class="name" id="getChildBranches"><span class="type-signature">(async) </span>getChildBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
+ <h4 class="name" id="getAttributes"><span class="type-signature">(async) </span>getAttributes<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+ </td>
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+ </td>
+
+
+ <td class="description last">attribute name to filter</td>
+ </tr>
+
+ </tbody>
+</table>
@@ -648,7 +785,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line43">line 43</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line85">line 85</a>
</li></ul></dd>
@@ -682,7 +819,7 @@ Its notable omission is the note content.</div>
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
</dd>
@@ -700,19 +837,91 @@ Its notable omission is the note content.</div>
- <h4 class="name" id="getChildNoteIds"><span class="type-signature"></span>getChildNoteIds<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
+ <h4 class="name" id="getAttributeValue"><span class="type-signature">(async) </span>getAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+ <tr>
+
+ <td class="name"><code>type</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">attribute type (label, relation, etc.)</td>
+ </tr>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+ </td>
+
+
+ <td class="description last">attribute name</td>
+ </tr>
+
+ </tbody>
+</table>
@@ -748,7 +957,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line65">line 65</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line155">line 155</a>
</li></ul></dd>
@@ -774,6 +983,10 @@ Its notable omission is the note content.</div>
<h5>Returns:</h5>
+<div class="param-desc">
+ attribute value of given type and name or null if no such attribute exists.
+</div>
+
<dl>
@@ -782,7 +995,7 @@ Its notable omission is the note content.</div>
</dt>
<dd>
-<span class="param-type">Array.&lt;string></span>
+<span class="param-type">Promise.&lt;string></span>
</dd>
@@ -800,7 +1013,7 @@ Its notable omission is the note content.</div>
- <h4 class="name" id="getChildNotes"><span class="type-signature">(async) </span>getChildNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>>}</span></h4>
+ <h4 class="name" id="getBranches"><span class="type-signature">(async) </span>getBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
@@ -848,7 +1061,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line70">line 70</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line36">line 36</a>
</li></ul></dd>
@@ -882,7 +1095,7 @@ Its notable omission is the note content.</div>
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>></span>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
</dd>
@@ -900,7 +1113,7 @@ Its notable omission is the note content.</div>
- <h4 class="name" id="getParentNoteIds"><span class="type-signature"></span>getParentNoteIds<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
+ <h4 class="name" id="getChildBranches"><span class="type-signature">(async) </span>getChildBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>>}</span></h4>
@@ -948,7 +1161,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line55">line 55</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line50">line 50</a>
</li></ul></dd>
@@ -982,7 +1195,7 @@ Its notable omission is the note content.</div>
</dt>
<dd>
-<span class="param-type">Array.&lt;string></span>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
</dd>
@@ -1000,7 +1213,7 @@ Its notable omission is the note content.</div>
- <h4 class="name" id="getParentNotes"><span class="type-signature">(async) </span>getParentNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>>}</span></h4>
+ <h4 class="name" id="getChildNoteIds"><span class="type-signature"></span>getChildNoteIds<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
@@ -1048,7 +1261,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line60">line 60</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line72">line 72</a>
</li></ul></dd>
@@ -1082,7 +1295,7 @@ Its notable omission is the note content.</div>
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>></span>
+<span class="param-type">Array.&lt;string></span>
</dd>
@@ -1100,7 +1313,7 @@ Its notable omission is the note content.</div>
- <h4 class="name" id="hasChildren"><span class="type-signature"></span>hasChildren<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+ <h4 class="name" id="getChildNotes"><span class="type-signature">(async) </span>getChildNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>>}</span></h4>
@@ -1148,7 +1361,7 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line37">line 37</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line77">line 77</a>
</li></ul></dd>
@@ -1182,7 +1395,7 @@ Its notable omission is the note content.</div>
</dt>
<dd>
-<span class="param-type">boolean</span>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>></span>
</dd>
@@ -1200,19 +1413,68 @@ Its notable omission is the note content.</div>
- <h4 class="name" id="isJson"><span class="type-signature"></span>isJson<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+ <h4 class="name" id="getLabel"><span class="type-signature">(async) </span>getLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+ </td>
+
+
+ <td class="description last">label name</td>
+ </tr>
+
+ </tbody>
+</table>
@@ -1248,7 +1510,2255 @@ Its notable omission is the note content.</div>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line24">line 24</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line177">line 177</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ label if it exists, null otherwise
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;<a href="Attribute.html">Attribute</a>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getLabelDefinitions"><span class="type-signature">(async) </span>getLabelDefinitions<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">label name to filter</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line110">line 110</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ all note's label definitions, including inherited ones
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getLabels"><span class="type-signature">(async) </span>getLabels<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">label name to filter</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line102">line 102</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ all note's labels (attributes with type label), including inherited ones
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getLabelValue"><span class="type-signature">(async) </span>getLabelValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">label name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line189">line 189</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ label value if label exists, null otherwise
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;string></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getParentNoteIds"><span class="type-signature"></span>getParentNoteIds<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line62">line 62</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Array.&lt;string></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getParentNotes"><span class="type-signature">(async) </span>getParentNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line67">line 67</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getRelation"><span class="type-signature">(async) </span>getRelation<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">relation name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line183">line 183</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ relation if it exists, null otherwise
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;<a href="Attribute.html">Attribute</a>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getRelationDefinitions"><span class="type-signature">(async) </span>getRelationDefinitions<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">relation name to filter</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line126">line 126</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ all note's relation definitions including inherited ones
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getRelations"><span class="type-signature">(async) </span>getRelations<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+ <th>Attributes</th>
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last">relation name to filter</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line118">line 118</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ all note's relations (attributes with type relation), including inherited ones
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getRelationTarget"><span class="type-signature">(async) </span>getRelationTarget<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;Note>|null}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last"></td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line201">line 201</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ target note of the relation or null (if target is empty or note was not found)
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;Note></span>
+|
+
+<span class="param-type">null</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getRelationValue"><span class="type-signature">(async) </span>getRelationValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">relation name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line195">line 195</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ relation value if relation exists, null otherwise
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;string></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="hasAttribute"><span class="type-signature">(async) </span>hasAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>type</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">attribute type (label, relation, etc.)</td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">attribute name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line135">line 135</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ true if note has an attribute with given type and name (including inherited)
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;boolean></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="hasChildren"><span class="type-signature"></span>hasChildren<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line44">line 44</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">boolean</span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="hasLabel"><span class="type-signature">(async) </span>hasLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">label name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line165">line 165</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ true if label exists (including inherited)
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;boolean></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="hasRelation"><span class="type-signature">(async) </span>hasRelation<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h5>Parameters:</h5>
+
+
+<table class="params">
+ <thead>
+ <tr>
+
+ <th>Name</th>
+
+
+ <th>Type</th>
+
+
+
+
+
+ <th class="last">Description</th>
+ </tr>
+ </thead>
+
+ <tbody>
+
+
+ <tr>
+
+ <td class="name"><code>name</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">string</span>
+
+
+
+ </td>
+
+
+
+
+
+ <td class="description last">relation name</td>
+ </tr>
+
+
+ </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line171">line 171</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+<div class="param-desc">
+ true if relation exists (including inherited)
+</div>
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">Promise.&lt;boolean></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="invalidateAttributeCache"><span class="type-signature"></span>invalidateAttributeCache<span class="signature">()</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+<div class="description">
+ Clear note's attributes cache to force fresh reload for next attribute request.
+Cache is note instance scoped.
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line211">line 211</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="isJson"><span class="type-signature"></span>isJson<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line31">line 31</a>
</li></ul></dd>
diff --git a/docs/frontend_api/entities_attribute.js.html b/docs/frontend_api/entities_attribute.js.html
new file mode 100644
index 0000000000..bdba252b11
--- /dev/null
+++ b/docs/frontend_api/entities_attribute.js.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <title>JSDoc: Source: entities/attribute.js</title>
+
+ <script src="scripts/prettify/prettify.js"> </script>
+ <script src="scripts/prettify/lang-css.js"> </script>
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+ <h1 class="page-title">Source: entities/attribute.js</h1>
+
+
+
+
+
+
+ <section>
+ <article>
+ <pre class="prettyprint source linenums"><code>class Attribute {
+ constructor(treeCache, row) {
+ this.treeCache = treeCache;
+ /** @param {string} attributeId */
+ this.attributeId = row.attributeId;
+ /** @param {string} noteId */
+ this.noteId = row.noteId;
+ /** @param {string} type */
+ this.type = row.type;
+ /** @param {string} name */
+ this.name = row.name;
+ /** @param {string} value */
+ this.value = row.value;
+ /** @param {int} position */
+ this.position = row.position;
+ /** @param {boolean} isInheritable */
+ this.isInheritable = row.isInheritable;
+ /** @param {boolean} isDeleted */
+ this.isDeleted = row.isDeleted;
+ /** @param {string} dateCreated */
+ this.dateCreated = row.dateCreated;
+ /** @param {string} dateModified */
+ this.dateModified = row.dateModified;
+ }
+
+ /** @returns {NoteShort} */
+ async getNote() {
+ return await this.treeCache.getNote(this.noteId);
+ }
+
+ get toString() {
+ return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name})`;
+ }
+}</code></pre>
+ </article>
+ </section>
+
+
+
+
+</div>
+
+<nav>
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Branch.html">Branch</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteFull.html">NoteFull</a></li><li><a href="NoteShort.html">NoteShort</a></li></ul><h3><a href="global.html">Global</a></h3>
+</nav>
+
+<br class="clear">
+
+<footer>
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
diff --git a/docs/frontend_api/entities_branch.js.html b/docs/frontend_api/entities_branch.js.html
index 28f5c6d0ed..3062203ad3 100644
--- a/docs/frontend_api/entities_branch.js.html
+++ b/docs/frontend_api/entities_branch.js.html
@@ -42,7 +42,7 @@ class Branch {
/** @param {string} */
this.prefix = row.prefix;
/** @param {boolean} */
- this.isExpanded = row.isExpanded;
+ this.isExpanded = !!row.isExpanded;
}
/** @returns {NoteShort} */
diff --git a/docs/frontend_api/entities_note_short.js.html b/docs/frontend_api/entities_note_short.js.html
index 8e27bc89cc..1ade082db9 100644
--- a/docs/frontend_api/entities_note_short.js.html
+++ b/docs/frontend_api/entities_note_short.js.html
@@ -26,7 +26,14 @@
<section>
<article>
- <pre class="prettyprint source linenums"><code>/**
+ <pre class="prettyprint source linenums"><code>import server from '../services/server.js';
+
+const LABEL = 'label';
+const LABEL_DEFINITION = 'label-definition';
+const RELATION = 'relation';
+const RELATION_DEFINITION = 'relation-definition';
+
+/**
* This note's representation is used in note tree and is kept in TreeCache.
* Its notable omission is the note content.
*/
@@ -99,6 +106,140 @@ class NoteShort {
return await this.treeCache.getNotes(this.getChildNoteIds());
}
+ /**
+ * @param {string} [name] - attribute name to filter
+ * @returns {Promise&lt;Attribute[]>}
+ */
+ async getAttributes(name) {
+ if (!this.attributeCache) {
+ this.attributeCache = await server.get('notes/' + this.noteId + '/attributes');
+ }
+
+ if (name) {
+ return this.attributeCache.filter(attr => attr.name === name);
+ }
+ else {
+ return this.attributeCache;
+ }
+ }
+
+ /**
+ * @param {string} [name] - label name to filter
+ * @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), including inherited ones
+ */
+ async getLabels(name) {
+ return (await this.getAttributes(name)).filter(attr => attr.type === LABEL);
+ }
+
+ /**
+ * @param {string} [name] - label name to filter
+ * @returns {Promise&lt;Attribute[]>} all note's label definitions, including inherited ones
+ */
+ async getLabelDefinitions(name) {
+ return (await this.getAttributes(name)).filter(attr => attr.type === LABEL_DEFINITION);
+ }
+
+ /**
+ * @param {string} [name] - relation name to filter
+ * @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones
+ */
+ async getRelations(name) {
+ return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
+ }
+
+ /**
+ * @param {string} [name] - relation name to filter
+ * @returns {Promise&lt;Attribute[]>} all note's relation definitions including inherited ones
+ */
+ async getRelationDefinitions(name) {
+ return (await this.getAttributes(name)).filter(attr => attr.type === RELATION_DEFINITION);
+ }
+
+ /**
+ * @param {string} type - attribute type (label, relation, etc.)
+ * @param {string} name - attribute name
+ * @returns {Promise&lt;boolean>} true if note has an attribute with given type and name (including inherited)
+ */
+ async hasAttribute(type, name) {
+ return !!await this.getAttribute(type, name);
+ }
+
+ /**
+ * @param {string} type - attribute type (label, relation, etc.)
+ * @param {string} name - attribute name
+ * @returns {Promise&lt;Attribute>} attribute of given type and name. If there's more such attributes, first is returned. Returns null if there's no such attribute belonging to this note.
+ */
+ async getAttribute(type, name) {
+ const attributes = await this.getAttributes();
+
+ return attributes.find(attr => attr.type === type &amp;&amp; attr.name === name);
+ }
+
+ /**
+ * @param {string} type - attribute type (label, relation, etc.)
+ * @param {string} name - attribute name
+ * @returns {Promise&lt;string>} attribute value of given type and name or null if no such attribute exists.
+ */
+ async getAttributeValue(type, name) {
+ const attr = await this.getAttribute(type, name);
+
+ return attr ? attr.value : null;
+ }
+
+ /**
+ * @param {string} name - label name
+ * @returns {Promise&lt;boolean>} true if label exists (including inherited)
+ */
+ async hasLabel(name) { return await this.hasAttribute(LABEL, name); }
+
+ /**
+ * @param {string} name - relation name
+ * @returns {Promise&lt;boolean>} true if relation exists (including inherited)
+ */
+ async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
+
+ /**
+ * @param {string} name - label name
+ * @returns {Promise&lt;Attribute>} label if it exists, null otherwise
+ */
+ async getLabel(name) { return await this.getAttribute(LABEL, name); }
+
+ /**
+ * @param {string} name - relation name
+ * @returns {Promise&lt;Attribute>} relation if it exists, null otherwise
+ */
+ async getRelation(name) { return await this.getAttribute(RELATION, name); }
+
+ /**
+ * @param {string} name - label name
+ * @returns {Promise&lt;string>} label value if label exists, null otherwise
+ */
+ async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
+
+ /**
+ * @param {string} name - relation name
+ * @returns {Promise&lt;string>} relation value if relation exists, null otherwise
+ */
+ async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
+
+ /**
+ * @param {string} name
+ * @returns {Promise&lt;Note>|null} target note of the relation or null (if target is empty or note was not found)
+ */
+ async getRelationTarget(name) {
+ const relation = await this.getRelation(name);
+
+ return relation ? await repository.getNote(relation.value) : null;
+ }
+
+ /**
+ * Clear note's attributes cache to force fresh reload for next attribute request.
+ * Cache is note instance scoped.
+ */
+ invalidateAttributeCache() {
+ this.attributeCache = null;
+ }
+
get toString() {
return `Note(noteId=${this.noteId}, title=${this.title})`;
}
@@ -107,6 +248,7 @@ class NoteShort {
const dto = Object.assign({}, this);
delete dto.treeCache;
delete dto.archived;
+ delete dto.attributeCache;
return dto;
}
diff --git a/docs/frontend_api/global.html b/docs/frontend_api/global.html
index 369553f4c2..a73e78e1b1 100644
--- a/docs/frontend_api/global.html
+++ b/docs/frontend_api/global.html
@@ -303,7 +303,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line47">line 47</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line48">line 48</a>
</li></ul></dd>
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html
index 20a3ecf24d..9ce981b93c 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -34,6 +34,7 @@ import linkService from './link.js';
import treeCache from './tree_cache.js';
import noteDetailService from './note_detail.js';
import noteTypeService from './note_type.js';
+import noteTooltipService from './note_tooltip.js';
/**
* This is the main frontend API interface for scripts. It's published in the local "api" object.
@@ -253,6 +254,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
* @param {array} types - list of mime types to be used
*/
this.setCodeMimeTypes = noteTypeService.setCodeMimeTypes;
+
+ /**
+ * @method
+ * @param {object} $el - jquery object on which to setup the tooltip
+ */
+ this.setupElementTooltip = noteTooltipService.setupElementTooltip
}
export default FrontendScriptApi;</code></pre>