Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
API docs updates
zadamaf10f0f52ac5
diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.htmlindex dabe2ae48e..c76b51f48a 100644--- a/docs/backend_api/Note.html+++ b/docs/backend_api/Note.html@@ -557,7 +557,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#line482">line 482</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line540">line 540</a></li></ul></dd>@@ -659,7 +659,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#line764">line 764</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line868">line 868</a></li></ul></dd>@@ -837,7 +837,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#line389">line 389</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line436">line 436</a></li></ul></dd>@@ -895,7 +895,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"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>+ <h4 class="name" id="getAttributes"><span class="type-signature">(async) </span>getAttributes<span class="signature">(type<span class="signature-attributes">opt</span>, name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>@@ -935,6 +935,39 @@<tbody>+ <tr>++ <td class="name"><code>type</code></td>+++ <td class="type">+++<span class="param-type">string</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++++ </td>+++++ <td class="description last">(optional) attribute type to filter</td>+ </tr>+++<tr><td class="name"><code>name</code></td>@@ -963,7 +996,7 @@- <td class="description last">attribute name to filter</td>+ <td class="description last">(optional) attribute name to filter</td></tr>@@ -1004,7 +1037,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#line243">line 243</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line254">line 254</a></li></ul></dd>@@ -1062,7 +1095,7 @@- <h4 class="name" id="getAttributeValue"><span class="type-signature">(async) </span>getAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> → {Promise.<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"> → {Promise.<(string|null)>}</span></h4>@@ -1182,7 +1215,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#line400">line 400</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line447">line 447</a></li></ul></dd>@@ -1222,7 +1255,7 @@</dt><dd>-<span class="param-type">Promise.<string></span>+<span class="param-type">Promise.<(string|null)></span></dd>@@ -1288,7 +1321,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#line710">line 710</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line814">line 814</a></li></ul></dd>@@ -1390,7 +1423,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#line738">line 738</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line842">line 842</a></li></ul></dd>@@ -1496,7 +1529,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#line724">line 724</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line828">line 828</a></li></ul></dd>@@ -1704,7 +1737,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#line610">line 610</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line714">line 714</a></li></ul></dd>@@ -1937,7 +1970,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#line633">line 633</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line737">line 737</a></li></ul></dd>@@ -2135,7 +2168,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#line671">line 671</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line775">line 775</a></li></ul></dd>@@ -2333,7 +2366,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#line680">line 680</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line784">line 784</a></li></ul></dd>@@ -2489,7 +2522,7 @@- <h4 class="name" id="getLabel"><span class="type-signature">(async) </span>getLabel<span class="signature">(name)</span><span class="type-signature"> → {Promise.<<a href="Attribute.html">Attribute</a>>}</span></h4>+ <h4 class="name" id="getLabel"><span class="type-signature">(async) </span>getLabel<span class="signature">(name)</span><span class="type-signature"> → {Promise.<(<a href="Attribute.html">Attribute</a>|null)>}</span></h4>@@ -2586,7 +2619,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#line521">line 521</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line591">line 591</a></li></ul></dd>@@ -2626,7 +2659,7 @@</dt><dd>-<span class="param-type">Promise.<<a href="Attribute.html">Attribute</a>></span>+<span class="param-type">Promise.<(<a href="Attribute.html">Attribute</a>|null)></span></dd>@@ -2753,7 +2786,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#line268">line 268</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line293">line 293</a></li></ul></dd>@@ -2920,7 +2953,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#line260">line 260</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line277">line 277</a></li></ul></dd>@@ -2978,7 +3011,7 @@- <h4 class="name" id="getLabelValue"><span class="type-signature">(async) </span>getLabelValue<span class="signature">(name)</span><span class="type-signature"> → {Promise.<string>}</span></h4>+ <h4 class="name" id="getLabelValue"><span class="type-signature">(async) </span>getLabelValue<span class="signature">(name)</span><span class="type-signature"> → {Promise.<(string|null)>}</span></h4>@@ -3075,7 +3108,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#line533">line 533</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line615">line 615</a></li></ul></dd>@@ -3115,7 +3148,7 @@</dt><dd>-<span class="param-type">Promise.<string></span>+<span class="param-type">Promise.<(string|null)></span></dd>@@ -3187,7 +3220,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#line697">line 697</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line801">line 801</a></li></ul></dd>@@ -3289,7 +3322,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#line226">line 226</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line236">line 236</a></li></ul></dd>@@ -3349,19 +3382,118 @@ This method can be significantly faster than the getAttribute()- <h4 class="name" id="getOwnedAttributes"><span class="type-signature">(async) </span>getOwnedAttributes<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>+ <h4 class="name" id="getOwnedAttributes"><span class="type-signature">(async) </span>getOwnedAttributes<span class="signature">(type<span class="signature-attributes">opt</span>, name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>+++++++<div class="description">+ This method is a faster variant of getAttributes() which looks for only owned attributes.+Use when inheritance is not needed and/or in batch/performance sensitive operations.+</div>++++++++++ <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>type</code></td>+++ <td class="type">+++<span class="param-type">string</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++++ </td>+++++ <td class="description last">(optional) attribute type to filter</td>+ </tr>++ <tr>++ <td class="name"><code>name</code></td>+++ <td class="type">+++<span class="param-type">string</span>++ </td>++ <td class="attributes">++ <optional><br>++++ </td>+++ <td class="description last">(optional) attribute name to filter</td>+ </tr>++ </tbody>+</table>@@ -3397,7 +3529,7 @@ This method can be significantly faster than the getAttribute()<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#line204">line 204</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line212">line 212</a></li></ul></dd>@@ -3426,9 +3558,7 @@ This method can be significantly faster than the getAttribute()<div class="param-desc">- attributes belonging to this specific note (excludes inherited attributes)--This method can be significantly faster than the getAttributes()+ note's "owned" attributes - excluding inherited ones</div>@@ -3457,19 +3587,91 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="getParentNotes"><span class="type-signature">(async) </span>getParentNotes<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="Note.html">Note</a>>>}</span></h4>+ <h4 class="name" id="getOwnedAttributeValue"><span class="type-signature">(async) </span>getOwnedAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> → {Promise.<(string|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>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>@@ -3505,7 +3707,7 @@ This method can be significantly faster than the getAttributes()<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#line750">line 750</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line458">line 458</a></li></ul></dd>@@ -3534,7 +3736,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- parent notes of this note (note can have multiple parents because of cloning)+ attribute value of given type and name or null if no such attribute exists.</div>@@ -3545,7 +3747,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">Promise.<Array.<<a href="Note.html">Note</a>>></span>+<span class="param-type">Promise.<(string|null)></span></dd>@@ -3563,7 +3765,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="getRelation"><span class="type-signature">(async) </span>getRelation<span class="signature">(name)</span><span class="type-signature"> → {Promise.<<a href="Attribute.html">Attribute</a>>}</span></h4>+ <h4 class="name" id="getOwnedLabel"><span class="type-signature">(async) </span>getOwnedLabel<span class="signature">(name)</span><span class="type-signature"> → {Promise.<(<a href="Attribute.html">Attribute</a>|null)>}</span></h4>@@ -3619,7 +3821,7 @@ This method can be significantly faster than the getAttributes()- <td class="description last">relation name</td>+ <td class="description last">label name</td></tr>@@ -3660,7 +3862,7 @@ This method can be significantly faster than the getAttributes()<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#line527">line 527</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line597">line 597</a></li></ul></dd>@@ -3689,7 +3891,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- relation if it exists, null otherwise+ label if it exists, null otherwise</div>@@ -3700,7 +3902,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">Promise.<<a href="Attribute.html">Attribute</a>></span>+<span class="param-type">Promise.<(<a href="Attribute.html">Attribute</a>|null)></span></dd>@@ -3718,7 +3920,7 @@ This method can be significantly faster than the getAttributes()- <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"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>+ <h4 class="name" id="getOwnedLabels"><span class="type-signature">(async) </span>getOwnedLabels<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>@@ -3786,7 +3988,7 @@ This method can be significantly faster than the getAttributes()- <td class="description last">relation name to filter</td>+ <td class="description last">label name to filter</td></tr>@@ -3827,7 +4029,7 @@ This method can be significantly faster than the getAttributes()<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#line299">line 299</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line285">line 285</a></li></ul></dd>@@ -3856,7 +4058,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- all note's relation definitions including inherited ones+ all note's labels (attributes with type label), excluding inherited ones</div>@@ -3885,7 +4087,7 @@ This method can be significantly faster than the getAttributes()- <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"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>+ <h4 class="name" id="getOwnedLabelValue"><span class="type-signature">(async) </span>getOwnedLabelValue<span class="signature">(name)</span><span class="type-signature"> → {Promise.<(string|null)>}</span></h4>@@ -3913,8 +4115,6 @@ This method can be significantly faster than the getAttributes()<th>Type</th>- <th>Attributes</th>-@@ -3940,20 +4140,10 @@ This method can be significantly faster than the getAttributes()</td>- <td class="attributes">-- <optional><br>------ </td>-- <td class="description last">relation name to filter</td>+ <td class="description last">label name</td></tr>@@ -3994,7 +4184,7 @@ This method can be significantly faster than the getAttributes()<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#line276">line 276</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line621">line 621</a></li></ul></dd>@@ -4023,7 +4213,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- all note's relations (attributes with type relation), including inherited ones+ label value if label exists, null otherwise</div>@@ -4034,7 +4224,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">Promise.<Array.<<a href="Attribute.html">Attribute</a>>></span>+<span class="param-type">Promise.<(string|null)></span></dd>@@ -4052,7 +4242,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="getRelationTarget"><span class="type-signature">(async) </span>getRelationTarget<span class="signature">(name)</span><span class="type-signature"> → {Promise.<<a href="Note.html">Note</a>>|null}</span></h4>+ <h4 class="name" id="getOwnedRelation"><span class="type-signature">(async) </span>getOwnedRelation<span class="signature">(name)</span><span class="type-signature"> → {Promise.<(<a href="Attribute.html">Attribute</a>|null)>}</span></h4>@@ -4108,7 +4298,7 @@ This method can be significantly faster than the getAttributes()- <td class="description last"></td>+ <td class="description last">relation name</td></tr>@@ -4149,7 +4339,7 @@ This method can be significantly faster than the getAttributes()<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#line609">line 609</a></li></ul></dd>@@ -4178,7 +4368,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- target note of the relation or null (if target is empty or note was not found)+ relation if it exists, null otherwise</div>@@ -4189,10 +4379,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">Promise.<<a href="Note.html">Note</a>></span>-|--<span class="param-type">null</span>+<span class="param-type">Promise.<(<a href="Attribute.html">Attribute</a>|null)></span></dd>@@ -4210,7 +4397,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="getRelationTargets"><span class="type-signature">(async) </span>getRelationTargets<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<Array.<<a href="Note.html">Note</a>>>}</span></h4>+ <h4 class="name" id="getOwnedRelations"><span class="type-signature">(async) </span>getOwnedRelations<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>@@ -4319,7 +4506,7 @@ This method can be significantly faster than the getAttributes()<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#line284">line 284</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line309">line 309</a></li></ul></dd>@@ -4347,6 +4534,10 @@ This method can be significantly faster than the getAttributes()<h5>Returns:</h5>+<div class="param-desc">+ all note's relations (attributes with type relation), excluding inherited ones+</div>+<dl>@@ -4355,7 +4546,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">Promise.<Array.<<a href="Note.html">Note</a>>></span>+<span class="param-type">Promise.<Array.<<a href="Attribute.html">Attribute</a>>></span></dd>@@ -4373,7 +4564,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="getRelationValue"><span class="type-signature">(async) </span>getRelationValue<span class="signature">(name)</span><span class="type-signature"> → {Promise.<string>}</span></h4>+ <h4 class="name" id="getOwnedRelationTarget"><span class="type-signature">(async) </span>getOwnedRelationTarget<span class="signature">(name)</span><span class="type-signature"> → {Promise.<<a href="Note.html">Note</a>>|null}</span></h4>@@ -4429,7 +4620,7 @@ This method can be significantly faster than the getAttributes()- <td class="description last">relation name</td>+ <td class="description last"></td></tr>@@ -4470,7 +4661,7 @@ This method can be significantly faster than the getAttributes()<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#line539">line 539</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line649">line 649</a></li></ul></dd>@@ -4499,7 +4690,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- relation value if relation exists, null otherwise+ target note of the relation or null (if target is empty or note was not found)</div>@@ -4510,7 +4701,1236 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">Promise.<string></span>+<span class="param-type">Promise.<<a href="Note.html">Note</a>></span>+|++<span class="param-type">null</span>+++ </dd>+</dl>++++++++++++++ <h4 class="name" id="getOwnedRelationValue"><span class="type-signature">(async) </span>getOwnedRelationValue<span class="signature">(name)</span><span class="type-signature"> → {Promise.<(string|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">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.js.html">entities/note.js</a>, <a href="entities_note.js.html#line633">line 633</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.<(string|null)></span>+++ </dd>+</dl>++++++++++++++ <h4 class="name" id="getParentNotes"><span class="type-signature">(async) </span>getParentNotes<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="Note.html">Note</a>>>}</span></h4>+++++++++++++++++++<dl class="details">+++++++++++++++++++++++++++ <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#line854">line 854</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++<div class="param-desc">+ parent notes of this note (note can have multiple parents because of cloning)+</div>++++<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">Promise.<Array.<<a href="Note.html">Note</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"> → {Promise.<(<a href="Attribute.html">Attribute</a>|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">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.js.html">entities/note.js</a>, <a href="entities_note.js.html#line603">line 603</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.<(<a href="Attribute.html">Attribute</a>|null)></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"> → {Promise.<Array.<<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">++ <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.js.html">entities/note.js</a>, <a href="entities_note.js.html#line332">line 332</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.<Array.<<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"> → {Promise.<Array.<<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">++ <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.js.html">entities/note.js</a>, <a href="entities_note.js.html#line301">line 301</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.<Array.<<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"> → {Promise.<<a href="Note.html">Note</a>>|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.js.html">entities/note.js</a>, <a href="entities_note.js.html#line639">line 639</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.<<a href="Note.html">Note</a>></span>+|++<span class="param-type">null</span>+++ </dd>+</dl>++++++++++++++ <h4 class="name" id="getRelationTargets"><span class="type-signature">(async) </span>getRelationTargets<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<Array.<<a href="Note.html">Note</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">++ <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.js.html">entities/note.js</a>, <a href="entities_note.js.html#line317">line 317</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++++<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">Promise.<Array.<<a href="Note.html">Note</a>>></span>+++ </dd>+</dl>++++++++++++++ <h4 class="name" id="getRelationValue"><span class="type-signature">(async) </span>getRelationValue<span class="signature">(name)</span><span class="type-signature"> → {Promise.<(string|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">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.js.html">entities/note.js</a>, <a href="entities_note.js.html#line627">line 627</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.<(string|null)></span></dd>@@ -4535,16 +5955,402 @@ This method can be significantly faster than the getAttributes()-<div class="description">- Returns note revisions of this note.+<div class="description">+ Returns note revisions of this note.+</div>++++++++++++++<dl class="details">+++++++++++++++++++++++++++ <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#line791">line 791</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++++<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">Promise.<Array.<<a href="NoteRevision.html">NoteRevision</a>>></span>+++ </dd>+</dl>++++++++++++++ <h4 class="name" id="getScriptEnv"><span class="type-signature"></span>getScriptEnv<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>+++++++++++++++++++<dl class="details">+++++++++++++++++++++++++++ <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#line183">line 183</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++<div class="param-desc">+ JS script environment - either "frontend" or "backend"+</div>++++<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">string</span>+++ </dd>+</dl>++++++++++++++ <h4 class="name" id="getTargetRelations"><span class="type-signature">(async) </span>getTargetRelations<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>+++++++++++++++++++<dl class="details">+++++++++++++++++++++++++++ <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#line245">line 245</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++<div class="param-desc">+ relations targetting this specific note</div>+<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">Promise.<Array.<<a href="Attribute.html">Attribute</a>>></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"> → {Promise.<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>@@ -4580,7 +6386,7 @@ This method can be significantly faster than the getAttributes()<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#line687">line 687</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line418">line 418</a></li></ul></dd>@@ -4608,6 +6414,10 @@ This method can be significantly faster than the getAttributes()<h5>Returns:</h5>+<div class="param-desc">+ true if note has an attribute with given type and name (including inherited)+</div>+<dl>@@ -4616,7 +6426,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">Promise.<Array.<<a href="NoteRevision.html">NoteRevision</a>>></span>+<span class="param-type">Promise.<boolean></span></dd>@@ -4634,7 +6444,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="getScriptEnv"><span class="type-signature"></span>getScriptEnv<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>+ <h4 class="name" id="hasChildren"><span class="type-signature">(async) </span>hasChildren<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>@@ -4682,7 +6492,7 @@ This method can be significantly faster than the getAttributes()<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#line183">line 183</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line821">line 821</a></li></ul></dd>@@ -4711,7 +6521,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- JS script environment - either "frontend" or "backend"+ - true if note has children</div>@@ -4722,7 +6532,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">string</span>+<span class="param-type">boolean</span></dd>@@ -4740,7 +6550,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="getTargetRelations"><span class="type-signature">(async) </span>getTargetRelations<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>+ <h4 class="name" id="hasLabel"><span class="type-signature">(async) </span>hasLabel<span class="signature">(name)</span><span class="type-signature"> → {Promise.<boolean>}</span></h4>@@ -4755,6 +6565,55 @@ This method can be significantly faster than the getAttributes()+ <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>++@@ -4788,7 +6647,7 @@ This method can be significantly faster than the getAttributes()<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#line235">line 235</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line567">line 567</a></li></ul></dd>@@ -4817,7 +6676,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- relations targetting this specific note+ true if label exists (including inherited)</div>@@ -4828,7 +6687,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">Promise.<Array.<<a href="Attribute.html">Attribute</a>>></span>+<span class="param-type">Promise.<boolean></span></dd>@@ -4846,7 +6705,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="hasAttribute"><span class="type-signature">(async) </span>hasAttribute<span class="signature">(type, name)</span><span class="type-signature"> → {Promise.<boolean>}</span></h4>+ <h4 class="name" id="hasOwnedAttribute"><span class="type-signature">(async) </span>hasOwnedAttribute<span class="signature">(type, name)</span><span class="type-signature"> → {Promise.<boolean>}</span></h4>@@ -4966,7 +6825,7 @@ This method can be significantly faster than the getAttributes()<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#line380">line 380</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line427">line 427</a></li></ul></dd>@@ -4995,7 +6854,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- true if note has an attribute with given type and name (including inherited)+ true if note has an attribute with given type and name (excluding inherited)</div>@@ -5024,7 +6883,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="hasChildren"><span class="type-signature">(async) </span>hasChildren<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>+ <h4 class="name" id="hasOwnedLabel"><span class="type-signature">(async) </span>hasOwnedLabel<span class="signature">(name)</span><span class="type-signature"> → {Promise.<boolean>}</span></h4>@@ -5039,6 +6898,55 @@ This method can be significantly faster than the getAttributes()+ <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>++@@ -5072,7 +6980,7 @@ This method can be significantly faster than the getAttributes()<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#line717">line 717</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line573">line 573</a></li></ul></dd>@@ -5101,7 +7009,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- - true if note has children+ true if label exists (excluding inherited)</div>@@ -5112,7 +7020,7 @@ This method can be significantly faster than the getAttributes()</dt><dd>-<span class="param-type">boolean</span>+<span class="param-type">Promise.<boolean></span></dd>@@ -5130,7 +7038,7 @@ This method can be significantly faster than the getAttributes()- <h4 class="name" id="hasLabel"><span class="type-signature">(async) </span>hasLabel<span class="signature">(name)</span><span class="type-signature"> → {Promise.<boolean>}</span></h4>+ <h4 class="name" id="hasOwnedRelation"><span class="type-signature">(async) </span>hasOwnedRelation<span class="signature">(name)</span><span class="type-signature"> → {Promise.<boolean>}</span></h4>@@ -5186,7 +7094,7 @@ This method can be significantly faster than the getAttributes()- <td class="description last">label name</td>+ <td class="description last">relation name</td></tr>@@ -5227,7 +7135,7 @@ This method can be significantly faster than the getAttributes()<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#line509">line 509</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line585">line 585</a></li></ul></dd>@@ -5256,7 +7164,7 @@ This method can be significantly faster than the getAttributes()<div class="param-desc">- true if label exists (including inherited)+ true if relation exists (excluding inherited)</div>@@ -5382,7 +7290,7 @@ This method can be significantly faster than the getAttributes()<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#line579">line 579</a></li></ul></dd>@@ -5493,7 +7401,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#line307">line 307</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line340">line 340</a></li></ul></dd>@@ -5621,7 +7529,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#line785">line 785</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line889">line 889</a></li></ul></dd>@@ -6257,7 +8165,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#line312">line 312</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line346">line 346</a></li></ul></dd>@@ -6486,7 +8394,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#line466">line 466</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line524">line 524</a></li></ul></dd>@@ -6684,7 +8592,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#line596">line 596</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line700">line 700</a></li></ul></dd>@@ -6882,7 +8790,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#line605">line 605</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line709">line 709</a></li></ul></dd>@@ -7111,7 +9019,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#line432">line 432</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line490">line 490</a></li></ul></dd>@@ -7513,7 +9421,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#line578">line 578</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line682">line 682</a></li></ul></dd>@@ -7711,7 +9619,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#line587">line 587</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line691">line 691</a></li></ul></dd>@@ -7971,7 +9879,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#line415">line 415</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line473">line 473</a></li></ul></dd>@@ -8200,7 +10108,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#line559">line 559</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line663">line 663</a></li></ul></dd>@@ -8429,7 +10337,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#line569">line 569</a>+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line673">line 673</a></li></ul></dd>diff --git a/docs/backend_api/entities_note.js.html b/docs/backend_api/entities_note.js.htmlindex 9f32a00eea..cbe5cd3ef1 100644--- a/docs/backend_api/entities_note.js.html+++ b/docs/backend_api/entities_note.js.html@@ -224,26 +224,36 @@ class Note extends Entity {return null;}+ async loadOwnedAttributesToCache() {+ this.__ownedAttributeCache = await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);+ return this.__ownedAttributeCache;+ }+/**- * @returns {Promise<Attribute[]>} attributes belonging to this specific note (excludes inherited attributes)+ * This method is a faster variant of getAttributes() which looks for only owned attributes.+ * Use when inheritance is not needed and/or in batch/performance sensitive operations.*- * This method can be significantly faster than the getAttributes()+ * @param {string} [type] - (optional) attribute type to filter+ * @param {string} [name] - (optional) attribute name to filter+ * @returns {Promise<Attribute[]>} note's "owned" attributes - excluding inherited ones*/async getOwnedAttributes(type, name) {- let query = `SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`;- const params = [this.noteId];-- if (type) {- query += ` AND type = ?`;- params.push(type);+ if (!this.__ownedAttributeCache) {+ await this.loadOwnedAttributesToCache();}- if (name) {- query += ` AND name = ?`;- params.push(name);+ if (type && name) {+ return this.__ownedAttributeCache.filter(attr => attr.type === type && attr.name === name);+ }+ else if (type) {+ return this.__ownedAttributeCache.filter(attr => attr.type === type);+ }+ else if (name) {+ return this.__ownedAttributeCache.filter(attr => attr.name === name);+ }+ else {+ return this.__ownedAttributeCache.slice();}-- return await repository.getEntities(query, params);}/**@@ -265,19 +275,26 @@ class Note extends Entity {}/**- * @param {string} [name] - attribute name to filter+ * @param {string} [type] - (optional) attribute type to filter+ * @param {string} [name] - (optional) attribute name to filter* @returns {Promise<Attribute[]>} all note's attributes, including inherited ones*/- async getAttributes(name) {+ async getAttributes(type, name) {if (!this.__attributeCache) {await this.loadAttributesToCache();}- if (name) {+ if (type && name) {+ return this.__attributeCache.filter(attr => attr.type === type && attr.name === name);+ }+ else if (type) {+ return this.__attributeCache.filter(attr => attr.type === type);+ }+ else if (name) {return this.__attributeCache.filter(attr => attr.name === name);}else {- return this.__attributeCache;+ return this.__attributeCache.slice();}}@@ -286,7 +303,15 @@ class Note extends Entity {* @returns {Promise<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);+ return await this.getAttributes(LABEL, name);+ }++ /**+ * @param {string} [name] - label name to filter+ * @returns {Promise<Attribute[]>} all note's labels (attributes with type label), excluding inherited ones+ */+ async getOwnedLabels(name) {+ return await this.getOwnedAttributes(LABEL, name);}/**@@ -294,7 +319,7 @@ class Note extends Entity {* @returns {Promise<Attribute[]>} all note's label definitions, including inherited ones*/async getLabelDefinitions(name) {- return (await this.getAttributes(name)).filter(attr => attr.type === LABEL_DEFINITION);+ return await this.getAttributes(LABEL_DEFINITION, name);}/**@@ -302,7 +327,15 @@ class Note extends Entity {* @returns {Promise<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);+ return await this.getAttributes(RELATION, name);+ }++ /**+ * @param {string} [name] - relation name to filter+ * @returns {Promise<Attribute[]>} all note's relations (attributes with type relation), excluding inherited ones+ */+ async getOwnedRelations(name) {+ return await this.getOwnedAttributes(RELATION, name);}/**@@ -325,7 +358,7 @@ class Note extends Entity {* @returns {Promise<Attribute[]>} all note's relation definitions including inherited ones*/async getRelationDefinitions(name) {- return (await this.getAttributes(name)).filter(attr => attr.type === RELATION_DEFINITION);+ return await this.getAttributes(RELATION_DEFINITION, name);}/**@@ -334,6 +367,7 @@ class Note extends Entity {*/invalidateAttributeCache() {this.__attributeCache = null;+ this.__ownedAttributeCache = null;}/** @returns {Promise<void>} */@@ -343,11 +377,10 @@ class Note extends Entity {tree(noteId, level) AS (SELECT ?, 0UNION- SELECT branches.parentNoteId, tree.level + 1 FROM branches+ SELECT branches.parentNoteId, tree.level + 1+ FROM branchesJOIN tree ON branches.noteId = tree.noteId- JOIN notes ON notes.noteId = branches.parentNoteId- WHERE notes.isDeleted = 0- AND branches.isDeleted = 0+ WHERE branches.isDeleted = 0),treeWithAttrs(noteId, level) AS (SELECT * FROM tree@@ -366,6 +399,11 @@ class Note extends Entity {// we order by noteId so that attributes from same note stay together. Actual noteId ordering doesn't matter.const filteredAttributes = attributes.filter((attr, index) => {+ // if this exact attribute already appears then don't include it (can happen via cloning)+ if (attributes.findIndex(it => it.attributeId === attr.attributeId) !== index) {+ return false;+ }+if (attr.isDefinition()) {const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type && el.name === attr.name);@@ -409,6 +447,15 @@ class Note extends Entity {return !!await this.getAttribute(type, name);}+ /**+ * @param {string} type - attribute type (label, relation, etc.)+ * @param {string} name - attribute name+ * @returns {Promise<boolean>} true if note has an attribute with given type and name (excluding inherited)+ */+ async hasOwnedAttribute(type, name) {+ return !!await this.getOwnedAttribute(type, name);+ }+/*** @param {string} type - attribute type (label, relation, etc.)* @param {string} name - attribute name@@ -423,7 +470,7 @@ class Note extends Entity {/*** @param {string} type - attribute type (label, relation, etc.)* @param {string} name - attribute name- * @returns {Promise<string>} attribute value of given type and name or null if no such attribute exists.+ * @returns {Promise<string|null>} 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);@@ -431,6 +478,17 @@ class Note extends Entity {return attr ? attr.value : null;}+ /**+ * @param {string} type - attribute type (label, relation, etc.)+ * @param {string} name - attribute name+ * @returns {Promise<string|null>} attribute value of given type and name or null if no such attribute exists.+ */+ async getOwnedAttributeValue(type, name) {+ const attr = await this.getOwnedAttribute(type, name);++ return attr ? attr.value : null;+ }+/*** Based on enabled, attribute is either set or removed.*@@ -458,7 +516,7 @@ class Note extends Entity {* @returns {Promise<void>}*/async setAttribute(type, name, value) {- const attributes = await this.getOwnedAttributes();+ const attributes = await this.loadOwnedAttributesToCache();let attr = attributes.find(attr => attr.type === type && attr.name === name);if (attr) {@@ -492,7 +550,7 @@ class Note extends Entity {* @returns {Promise<void>}*/async removeAttribute(type, name, value) {- const attributes = await this.getOwnedAttributes();+ const attributes = await this.loadOwnedAttributesToCache();for (const attribute of attributes) {if (attribute.type === type && (value === undefined || value === attribute.value)) {@@ -536,36 +594,72 @@ class Note extends Entity {*/async hasLabel(name) { return await this.hasAttribute(LABEL, name); }+ /**+ * @param {string} name - label name+ * @returns {Promise<boolean>} true if label exists (excluding inherited)+ */+ async hasOwnedLabel(name) { return await this.hasOwnedAttribute(LABEL, name); }+/*** @param {string} name - relation name* @returns {Promise<boolean>} true if relation exists (including inherited)*/async hasRelation(name) { return await this.hasAttribute(RELATION, name); }+ /**+ * @param {string} name - relation name+ * @returns {Promise<boolean>} true if relation exists (excluding inherited)+ */+ async hasOwnedRelation(name) { return await this.hasOwnedAttribute(RELATION, name); }+/*** @param {string} name - label name- * @returns {Promise<Attribute>} label if it exists, null otherwise+ * @returns {Promise<Attribute|null>} label if it exists, null otherwise*/async getLabel(name) { return await this.getAttribute(LABEL, name); }+ /**+ * @param {string} name - label name+ * @returns {Promise<Attribute|null>} label if it exists, null otherwise+ */+ async getOwnedLabel(name) { return await this.getOwnedAttribute(LABEL, name); }+/*** @param {string} name - relation name- * @returns {Promise<Attribute>} relation if it exists, null otherwise+ * @returns {Promise<Attribute|null>} relation if it exists, null otherwise*/async getRelation(name) { return await this.getAttribute(RELATION, name); }+ /**+ * @param {string} name - relation name+ * @returns {Promise<Attribute|null>} relation if it exists, null otherwise+ */+ async getOwnedRelation(name) { return await this.getOwnedAttribute(RELATION, name); }+/*** @param {string} name - label name- * @returns {Promise<string>} label value if label exists, null otherwise+ * @returns {Promise<string|null>} label value if label exists, null otherwise*/async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }+ /**+ * @param {string} name - label name+ * @returns {Promise<string|null>} label value if label exists, null otherwise+ */+ async getOwnedLabelValue(name) { return await this.getOwnedAttributeValue(LABEL, name); }+/*** @param {string} name - relation name- * @returns {Promise<string>} relation value if relation exists, null otherwise+ * @returns {Promise<string|null>} relation value if relation exists, null otherwise*/async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }+ /**+ * @param {string} name - relation name+ * @returns {Promise<string|null>} relation value if relation exists, null otherwise+ */+ async getOwnedRelationValue(name) { return await this.getOwnedAttributeValue(RELATION, name); }+/*** @param {string} name* @returns {Promise<Note>|null} target note of the relation or null (if target is empty or note was not found)@@ -576,6 +670,16 @@ class Note extends Entity {return relation ? await repository.getNote(relation.value) : null;}+ /**+ * @param {string} name+ * @returns {Promise<Note>|null} target note of the relation or null (if target is empty or note was not found)+ */+ async getOwnedRelationTarget(name) {+ const relation = await this.getOwnedRelation(name);++ return relation ? await repository.getNote(relation.value) : null;+ }+/*** Based on enabled, label is either set or removed.*diff --git a/docs/backend_api/global.html b/docs/backend_api/global.htmlindex 907f6a8ca0..7f36be7670 100644--- a/docs/backend_api/global.html+++ b/docs/backend_api/global.html@@ -596,6 +596,480 @@++<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>+++++++ <h5>Type:</h5>+ <ul>+ <li>++<span class="param-type">object</span>+++ </li>+ </ul>++++++ <h5 class="subsection-title">Properties:</h5>++++<table class="props">+ <thead>+ <tr>++ <th>Name</th>+++ <th>Type</th>+++ <th>Attributes</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="attributes">++++ </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="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">++ <optional><br>++++ </td>+++++ <td class="description last">attribute value</td>+ </tr>+++ </tbody>+</table>+++++<dl class="details">+++++++++++++++++++++++++++ <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#line233">line 233</a>+ </li></ul></dd>++++++++</dl>+++++++++<h4 class="name" id="CreateNoteExtraOptions">CreateNoteExtraOptions</h4>+++++++ <h5>Type:</h5>+ <ul>+ <li>++<span class="param-type">object</span>+++ </li>+ </ul>++++++ <h5 class="subsection-title">Properties:</h5>++++<table class="props">+ <thead>+ <tr>++ <th>Name</th>+++ <th>Type</th>+++ <th>Attributes</th>++++ <th>Default</th>+++ <th class="last">Description</th>+ </tr>+ </thead>++ <tbody>+++ <tr>++ <td class="name"><code>json</code></td>+++ <td class="type">+++<span class="param-type">boolean</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++ </td>++++ <td class="default">++ false++ </td>+++ <td class="description last">should the note be JSON</td>+ </tr>++++ <tr>++ <td class="name"><code>isProtected</code></td>+++ <td class="type">+++<span class="param-type">boolean</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++ </td>++++ <td class="default">++ false++ </td>+++ <td class="description last">should the note be protected</td>+ </tr>++++ <tr>++ <td class="name"><code>type</code></td>+++ <td class="type">+++<span class="param-type">string</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++ </td>++++ <td class="default">++ 'text'++ </td>+++ <td class="description last">note type</td>+ </tr>++++ <tr>++ <td class="name"><code>mime</code></td>+++ <td class="type">+++<span class="param-type">string</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++ </td>++++ <td class="default">++ 'text/html'++ </td>+++ <td class="description last">MIME type of the note</td>+ </tr>++++ <tr>++ <td class="name"><code>attributes</code></td>+++ <td class="type">+++<span class="param-type">Array.<<a href="global.html#CreateNoteAttribute">CreateNoteAttribute</a>></span>++++ </td>+++ <td class="attributes">++ <optional><br>++++ </td>++++ <td class="default">++ []++ </td>+++ <td class="description last">attributes to be created for this note</td>+ </tr>+++ </tbody>+</table>+++++<dl class="details">+++++++++++++++++++++++++++ <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#line240">line 240</a>+ </li></ul></dd>++++++++</dl>+++++++diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.htmlindex de1512b051..8c76aa1240 100644--- a/docs/backend_api/services_backend_script_api.js.html+++ b/docs/backend_api/services_backend_script_api.js.html@@ -258,6 +258,65 @@ function BackendScriptApi(currentNote, apiParams) {*/this.createNewNote = noteService.createNewNote;+ /**+ * @typedef {object} CreateNoteAttribute+ * @property {string} type - attribute type - label, relation etc.+ * @property {string} name - attribute name+ * @property {string} [value] - attribute value+ */++ /**+ * @typedef {object} CreateNoteExtraOptions+ * @property {boolean} [json=false] - should the note be JSON+ * @property {boolean} [isProtected=false] - should the note be protected+ * @property {string} [type='text'] - note type+ * @property {string} [mime='text/html'] - MIME type of the note+ * @property {CreateNoteAttribute[]} [attributes=[]] - attributes to be created for this note+ */++ /**+ * @method+ *+ * @param {string} parentNoteId - create new note under this parent+ * @param {string} title+ * @param {string} [content=""]+ * @param {CreateNoteExtraOptions} [extraOptions={}]+ * @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch+ */+ this.createNote = async (parentNoteId, title, content = "", extraOptions= {}) => {+ extraOptions.parentNoteId = parentNoteId;+ extraOptions.title = title;++ const parentNote = await repository.getNote(parentNoteId);++ // code note type can be inherited, otherwise text is default+ extraOptions.type = parentNote.type === 'code' ? 'code' : 'text';+ extraOptions.mime = parentNote.type === 'code' ? parentNote.mime : 'text/html';++ if (extraOptions.json) {+ extraOptions.content = JSON.stringify(content || {}, null, '\t');+ extraOptions.type = 'code';+ extraOptions.mime = 'application/json';+ }+ else {+ extraOptions.content = content;+ }++ const {note, branch} = await noteService.createNewNote(extraOptions);++ for (const attr of extraOptions.attributes || []) {+ await attributeService.createAttribute({+ noteId: note.noteId,+ type: attr.type,+ name: attr.name,+ value: attr.value,+ isInheritable: !!attr.isInheritable+ });+ }++ return {note, branch};+ };+/*** Log given message to trilium logs.*diff --git a/docs/frontend_api/NoteShort.html b/docs/frontend_api/NoteShort.htmlindex 6e3561286d..e4766ce540 100644--- a/docs/frontend_api/NoteShort.html+++ b/docs/frontend_api/NoteShort.html@@ -1220,7 +1220,7 @@<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#line220">line 220</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line227">line 227</a></li></ul></dd>@@ -1278,7 +1278,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"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>+ <h4 class="name" id="getAttributes"><span class="type-signature">(async) </span>getAttributes<span class="signature">(type<span class="signature-attributes">opt</span>, name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Promise.<Array.<<a href="Attribute.html">Attribute</a>>>}</span></h4>@@ -1318,6 +1318,39 @@<tbody>+ <tr>++ <td class="name"><code>type</code></td>+++ <td class="type">+++<span class="param-type">string</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++++ </td>+++++ <td class="description last">(optional) attribute type to filter</td>+ </tr>+++<tr><td class="name"><code>name</code></td>@@ -1346,7 +1379,7 @@- <td class="description last">attribute name to filter</td>+ <td class="description last">(optional) attribute name to filter</td></tr>@@ -1387,7 +1420,7 @@<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#line160">line 160</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line161">line 161</a></li></ul></dd>@@ -1415,6 +1448,10 @@<h5>Returns:</h5>+<div class="param-desc">+ all note's attributes, including inherited ones+</div>+<dl>@@ -1561,7 +1598,7 @@<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#line231">line 231</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line238">line 238</a></li></ul></dd>@@ -2124,7 +2161,7 @@<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#line253">line 253</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line260">line 260</a></li></ul></dd>@@ -2291,7 +2328,7 @@<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#line186">line 186</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line193">line 193</a></li></ul></dd>@@ -2458,7 +2495,7 @@<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#line178">line 178</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line185">line 185</a></li></ul></dd>@@ -2613,7 +2650,7 @@<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#line265">line 265</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line272">line 272</a></li></ul></dd>@@ -2972,7 +3009,7 @@<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#line259">line 259</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line266">line 266</a></li></ul></dd>@@ -3139,7 +3176,7 @@<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#line202">line 202</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line209">line 209</a></li></ul></dd>@@ -3306,7 +3343,7 @@<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#line194">line 194</a>+ <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>@@ -3461,7 +3498,7 @@<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#line277">line 277</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line284">line 284</a></li></ul></dd>@@ -3631,7 +3668,7 @@<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#line287">line 287</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line294">line 294</a></li></ul></dd>@@ -3782,7 +3819,7 @@<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#line271">line 271</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line278">line 278</a></li></ul></dd>@@ -3892,7 +3929,7 @@<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#line311">line 311</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line318">line 318</a></li></ul></dd>@@ -4066,7 +4103,7 @@<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>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line218">line 218</a></li></ul></dd>@@ -4323,7 +4360,7 @@<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#line241">line 241</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line248">line 248</a></li></ul></dd>@@ -4478,7 +4515,7 @@<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#line247">line 247</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line254">line 254</a></li></ul></dd>@@ -4536,7 +4573,7 @@- <h4 class="name" id="invalidateAttributeCache"><span class="type-signature"></span>invalidateAttributeCache<span class="signature">()</span><span class="type-signature"></span></h4>+ <h4 class="name" id="invalidate__attributeCache"><span class="type-signature"></span>invalidate__attributeCache<span class="signature">()</span><span class="type-signature"></span></h4>@@ -4589,7 +4626,7 @@ Cache is note instance scoped.<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#line302">line 302</a>+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line309">line 309</a></li></ul></dd>diff --git a/docs/frontend_api/entities_note_short.js.html b/docs/frontend_api/entities_note_short.js.htmlindex ed96033189..ebb24d8b2e 100644--- a/docs/frontend_api/entities_note_short.js.html+++ b/docs/frontend_api/entities_note_short.js.html@@ -182,20 +182,27 @@ class NoteShort {}/**- * @param {string} [name] - attribute name to filter- * @returns {Promise<Attribute[]>}+ * @param {string} [type] - (optional) attribute type to filter+ * @param {string} [name] - (optional) attribute name to filter+ * @returns {Promise<Attribute[]>} all note's attributes, including inherited ones*/- async getAttributes(name) {- if (!this.attributeCache) {- this.attributeCache = (await server.get('notes/' + this.noteId + '/attributes'))+ async getAttributes(type, name) {+ if (!this.__attributeCache) {+ this.__attributeCache = (await server.get('notes/' + this.noteId + '/attributes')).map(attrRow => new Attribute(this.treeCache, attrRow));}- if (name) {- return this.attributeCache.filter(attr => attr.name === name);+ if (type && name) {+ return this.__attributeCache.filter(attr => attr.type === type && attr.name === name);+ }+ else if (type) {+ return this.__attributeCache.filter(attr => attr.type === type);+ }+ else if (name) {+ return this.__attributeCache.filter(attr => attr.name === name);}else {- return this.attributeCache;+ return this.__attributeCache.slice();}}@@ -204,7 +211,7 @@ class NoteShort {* @returns {Promise<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);+ return await this.getAttributes(LABEL, name);}/**@@ -212,7 +219,7 @@ class NoteShort {* @returns {Promise<Attribute[]>} all note's label definitions, including inherited ones*/async getLabelDefinitions(name) {- return (await this.getAttributes(name)).filter(attr => attr.type === LABEL_DEFINITION);+ return await this.getAttributes(LABEL_DEFINITION, name);}/**@@ -220,7 +227,7 @@ class NoteShort {* @returns {Promise<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);+ return await this.getAttributes(RELATION, name);}/**@@ -228,7 +235,7 @@ class NoteShort {* @returns {Promise<Attribute[]>} all note's relation definitions including inherited ones*/async getRelationDefinitions(name) {- return (await this.getAttributes(name)).filter(attr => attr.type === RELATION_DEFINITION);+ return await this.getAttributes(RELATION_DEFINITION, name);}/**@@ -327,8 +334,8 @@ class NoteShort {* Clear note's attributes cache to force fresh reload for next attribute request.* Cache is note instance scoped.*/- invalidateAttributeCache() {- this.attributeCache = null;+ invalidate__attributeCache() {+ this.__attributeCache = null;}/**@@ -349,7 +356,7 @@ class NoteShort {const dto = Object.assign({}, this);delete dto.treeCache;delete dto.archived;- delete dto.attributeCache;+ delete dto.__attributeCache;return dto;}