Skip to content

Build your personal knowledge base with Trilium Notes

updated API docs

zadam4f92fbf8a5cc
diff --git a/docs/backend_api/ApiToken.html b/docs/backend_api/ApiToken.html
index 41b156f6e3..2faeafef38 100644
--- a/docs/backend_api/ApiToken.html
+++ b/docs/backend_api/ApiToken.html
@@ -293,7 +293,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/Attribute.html b/docs/backend_api/Attribute.html
index f07079d7a4..204e918708 100644
--- a/docs/backend_api/Attribute.html
+++ b/docs/backend_api/Attribute.html
@@ -106,7 +106,7 @@
- <td class="description last"></td>
+ <td class="description last">immutable</td>
</tr>
@@ -129,7 +129,7 @@
- <td class="description last"></td>
+ <td class="description last">immutable</td>
</tr>
@@ -152,7 +152,7 @@
- <td class="description last"></td>
+ <td class="description last">immutable</td>
</tr>
@@ -175,7 +175,7 @@
- <td class="description last"></td>
+ <td class="description last">immutable</td>
</tr>
@@ -244,7 +244,7 @@
- <td class="description last"></td>
+ <td class="description last">immutable</td>
</tr>
@@ -378,7 +378,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line30">line 30</a>
+ <a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line26">line 26</a>
</li></ul></dd>
@@ -445,7 +445,7 @@
- <h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -493,7 +493,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line47">line 47</a>
+ <a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line40">line 40</a>
</li></ul></dd>
@@ -529,7 +529,10 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -547,7 +550,7 @@
- <h4 class="name" id="getTargetNote"><span class="type-signature">(async) </span>getTargetNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getTargetNote"><span class="type-signature"></span>getTargetNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -595,7 +598,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line54">line 54</a>
+ <a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line47">line 47</a>
</li></ul></dd>
@@ -631,7 +634,10 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -697,7 +703,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line69">line 69</a>
+ <a href="entities_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line62">line 62</a>
</li></ul></dd>
@@ -767,7 +773,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.html
index 64c41cef33..62606e9935 100644
--- a/docs/backend_api/BackendScriptApi.html
+++ b/docs/backend_api/BackendScriptApi.html
@@ -471,7 +471,7 @@
- <h4 class="name" id="createDataNote"><span class="type-signature"></span>createDataNote<span class="signature">(parentNoteId, title, content)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
+ <h4 class="name" id="createDataNote"><span class="type-signature"></span>createDataNote<span class="signature">(parentNoteId, title, content)</span><span class="type-signature"> &rarr; {Object}</span></h4>
@@ -619,7 +619,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line204">line 204</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line205">line 205</a>
</li></ul></dd>
@@ -655,7 +655,7 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}></span>
+<span class="param-type">Object</span>
</dd>
@@ -673,7 +673,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="createNewNote"><span class="type-signature"></span>createNewNote<span class="signature">(params<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
+ <h4 class="name" id="createNewNote"><span class="type-signature"></span>createNewNote<span class="signature">(params<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
@@ -782,7 +782,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line231">line 231</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line232">line 232</a>
</li></ul></dd>
@@ -822,7 +822,7 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}></span>
+<span class="param-type">Object</span>
</dd>
@@ -840,7 +840,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="createNote"><span class="type-signature"></span>createNote<span class="signature">(parentNoteId, title, content<span class="signature-attributes">opt</span>, extraOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
+ <h4 class="name" id="createNote"><span class="type-signature"></span>createNote<span class="signature">(parentNoteId, title, content<span class="signature-attributes">opt</span>, extraOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Object}</span></h4>
@@ -1054,7 +1054,7 @@ JSON MIME type. See also createNewNote() for more options.
- <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>please use createNote() API method instead</li></ul></dd>
+ <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>please use createNewNote() API method instead</li></ul></dd>
@@ -1068,7 +1068,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line259">line 259</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line260">line 260</a>
</li></ul></dd>
@@ -1108,7 +1108,7 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}></span>
+<span class="param-type">Object</span>
</dd>
@@ -1126,7 +1126,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="createTextNote"><span class="type-signature"></span>createTextNote<span class="signature">(parentNoteId, title, content)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
+ <h4 class="name" id="createTextNote"><span class="type-signature"></span>createTextNote<span class="signature">(parentNoteId, title, content)</span><span class="type-signature"> &rarr; {Object}</span></h4>
@@ -1273,7 +1273,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line188">line 188</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line189">line 189</a>
</li></ul></dd>
@@ -1309,7 +1309,7 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}></span>
+<span class="param-type">Object</span>
</dd>
@@ -1327,7 +1327,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="ensureNoteIsAbsentFromParent"><span class="type-signature"></span>ensureNoteIsAbsentFromParent<span class="signature">(noteId, parentNoteId)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="ensureNoteIsAbsentFromParent"><span class="type-signature"></span>ensureNoteIsAbsentFromParent<span class="signature">(noteId, parentNoteId)</span><span class="type-signature"> &rarr; {void}</span></h4>
@@ -1451,7 +1451,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line159">line 159</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line160">line 160</a>
</li></ul></dd>
@@ -1487,7 +1487,7 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;void></span>
+<span class="param-type">void</span>
</dd>
@@ -1505,7 +1505,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="ensureNoteIsPresentInParent"><span class="type-signature"></span>ensureNoteIsPresentInParent<span class="signature">(noteId, parentNoteId, prefix)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="ensureNoteIsPresentInParent"><span class="type-signature"></span>ensureNoteIsPresentInParent<span class="signature">(noteId, parentNoteId, prefix)</span><span class="type-signature"> &rarr; {void}</span></h4>
@@ -1652,7 +1652,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line149">line 149</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line150">line 150</a>
</li></ul></dd>
@@ -1688,7 +1688,7 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;void></span>
+<span class="param-type">void</span>
</dd>
@@ -1754,7 +1754,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line398">line 398</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line397">line 397</a>
</li></ul></dd>
@@ -1815,7 +1815,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="getAttribute"><span class="type-signature"></span>getAttribute<span class="signature">(attributeId)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Attribute.html">Attribute</a>|null)>}</span></h4>
+ <h4 class="name" id="getAttribute"><span class="type-signature"></span>getAttribute<span class="signature">(attributeId)</span><span class="type-signature"> &rarr; {<a href="Attribute.html">Attribute</a>|null}</span></h4>
@@ -1948,7 +1948,10 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Attribute.html">Attribute</a>|null)></span>
+<span class="param-type"><a href="Attribute.html">Attribute</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -1966,7 +1969,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="getBranch"><span class="type-signature"></span>getBranch<span class="signature">(branchId)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Branch.html">Branch</a>|null)>}</span></h4>
+ <h4 class="name" id="getBranch"><span class="type-signature"></span>getBranch<span class="signature">(branchId)</span><span class="type-signature"> &rarr; {<a href="Branch.html">Branch</a>|null}</span></h4>
@@ -2099,7 +2102,10 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Branch.html">Branch</a>|null)></span>
+<span class="param-type"><a href="Branch.html">Branch</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -2117,7 +2123,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="getDateNote"><span class="type-signature"></span>getDateNote<span class="signature">(date)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getDateNote"><span class="type-signature"></span>getDateNote<span class="signature">(date)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -2218,7 +2224,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line315">line 315</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line318">line 318</a>
</li></ul></dd>
@@ -2254,7 +2260,10 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -2272,7 +2281,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="getEntities"><span class="type-signature"></span>getEntities<span class="signature">(SQL, array)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Entity.html">Entity</a>>>}</span></h4>
+ <h4 class="name" id="getEntities"><span class="type-signature"></span>getEntities<span class="signature">(SQL, array)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Entity.html">Entity</a>>}</span></h4>
@@ -2392,7 +2401,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line94">line 94</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line87">line 87</a>
</li></ul></dd>
@@ -2428,7 +2437,7 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Entity.html">Entity</a>>></span>
+<span class="param-type">Array.&lt;<a href="Entity.html">Entity</a>></span>
</dd>
@@ -2446,7 +2455,7 @@ JSON MIME type. See also createNewNote() for more options.
- <h4 class="name" id="getEntity"><span class="type-signature"></span>getEntity<span class="signature">(SQL, array)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Entity.html">Entity</a>|null)>}</span></h4>
+ <h4 class="name" id="getEntity"><span class="type-signature"></span>getEntity<span class="signature">(SQL, array)</span><span class="type-signature"> &rarr; {<a href="Entity.html">Entity</a>|null}</span></h4>
@@ -2570,7 +2579,7 @@ JSON MIME type. See also createNewNote() for more options.
<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#line86">line 86</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line79">line 79</a>
</li></ul></dd>
@@ -2606,158 +2615,10 @@ JSON MIME type. See also createNewNote() for more options.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Entity.html">Entity</a>|null)></span>
-
-
- </dd>
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <h4 class="name" id="getImage"><span class="type-signature"></span>getImage<span class="signature">(imageId)</span><span class="type-signature"> &rarr; {Promise.&lt;(Image|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>imageId</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="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line76">line 76</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h5>Returns:</h5>
-
-
-
+<span class="param-type"><a href="Entity.html">Entity</a></span>
+|
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;(Image|null)></span>
+<span class="param-type">null</span>
</dd>
@@ -2885,7 +2746,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="getMonthNote"><span class="type-signature"></span>getMonthNote<span class="signature">(date)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getMonthNote"><span class="type-signature"></span>getMonthNote<span class="signature">(date)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -2986,7 +2847,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line342">line 342</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line345">line 345</a>
</li></ul></dd>
@@ -3022,7 +2883,10 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3040,7 +2904,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">(noteId)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">(noteId)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -3173,7 +3037,10 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3191,7 +3058,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="getNotesWithLabel"><span class="type-signature"></span>getNotesWithLabel<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="getNotesWithLabel"><span class="type-signature"></span>getNotesWithLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Note.html">Note</a>>}</span></h4>
@@ -3335,7 +3202,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line128">line 128</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line129">line 129</a>
</li></ul></dd>
@@ -3371,7 +3238,7 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Array.&lt;<a href="Note.html">Note</a>></span>
</dd>
@@ -3389,7 +3256,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="getNoteWithLabel"><span class="type-signature"></span>getNoteWithLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getNoteWithLabel"><span class="type-signature"></span>getNoteWithLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -3533,7 +3400,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line138">line 138</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line139">line 139</a>
</li></ul></dd>
@@ -3569,7 +3436,10 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3587,7 +3457,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="getRootCalendarNote"><span class="type-signature"></span>getRootCalendarNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getRootCalendarNote"><span class="type-signature"></span>getRootCalendarNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -3639,7 +3509,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line306">line 306</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line309">line 309</a>
</li></ul></dd>
@@ -3675,7 +3545,10 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3693,7 +3566,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="getTodayNote"><span class="type-signature"></span>getTodayNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getTodayNote"><span class="type-signature"></span>getTodayNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -3745,7 +3618,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line323">line 323</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line326">line 326</a>
</li></ul></dd>
@@ -3781,7 +3654,10 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3799,7 +3675,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="getWeekNote"><span class="type-signature"></span>getWeekNote<span class="signature">(date, options)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getWeekNote"><span class="type-signature"></span>getWeekNote<span class="signature">(date, options)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -3923,7 +3799,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line333">line 333</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line336">line 336</a>
</li></ul></dd>
@@ -3959,7 +3835,10 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3977,7 +3856,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="getYearNote"><span class="type-signature"></span>getYearNote<span class="signature">(year)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getYearNote"><span class="type-signature"></span>getYearNote<span class="signature">(year)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -4078,7 +3957,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line351">line 351</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line354">line 354</a>
</li></ul></dd>
@@ -4114,7 +3993,10 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -4228,7 +4110,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line298">line 298</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line301">line 301</a>
</li></ul></dd>
@@ -4314,7 +4196,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line393">line 393</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line392">line 392</a>
</li></ul></dd>
@@ -4350,7 +4232,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="searchForNote"><span class="type-signature"></span>searchForNote<span class="signature">(searchString)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="searchForNote"><span class="type-signature"></span>searchForNote<span class="signature">(searchString)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -4359,7 +4241,7 @@ if some action needs to happen on only one specific instance.
<div class="description">
This is a powerful search method - you can search by attributes and their values, e.g.:
-"@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+"#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
</div>
@@ -4452,7 +4334,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line114">line 114</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line115">line 115</a>
</li></ul></dd>
@@ -4488,7 +4370,10 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -4506,7 +4391,7 @@ if some action needs to happen on only one specific instance.
- <h4 class="name" id="searchForNotes"><span class="type-signature"></span>searchForNotes<span class="signature">(searchString)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
+ <h4 class="name" id="searchForNotes"><span class="type-signature"></span>searchForNotes<span class="signature">(query, searchContext<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Note.html">Note</a>>}</span></h4>
@@ -4515,7 +4400,7 @@ if some action needs to happen on only one specific instance.
<div class="description">
This is a powerful search method - you can search by attributes and their values, e.g.:
-"@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+"#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
</div>
@@ -4539,6 +4424,8 @@ if some action needs to happen on only one specific instance.
<th>Type</th>
+ <th>Attributes</th>
+
@@ -4551,7 +4438,7 @@ if some action needs to happen on only one specific instance.
<tr>
- <td class="name"><code>searchString</code></td>
+ <td class="name"><code>query</code></td>
<td class="type">
@@ -4564,6 +4451,47 @@ if some action needs to happen on only one specific instance.
</td>
+ <td class="attributes">
+
+
+
+
+
+ </td>
+
+
+
+
+ <td class="description last"></td>
+ </tr>
+
+
+
+ <tr>
+
+ <td class="name"><code>searchContext</code></td>
+
+
+ <td class="type">
+
+
+<span class="param-type">SearchContext</span>
+
+
+
+ </td>
+
+
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
@@ -4608,7 +4536,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_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line104">line 104</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line98">line 98</a>
</li></ul></dd>
@@ -4644,7 +4572,7 @@ if some action needs to happen on only one specific instance.
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Array.&lt;<a href="Note.html">Note</a>></span>
</dd>
@@ -4817,7 +4745,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
<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#line372">line 372</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line374">line 374</a>
</li></ul></dd>
@@ -4950,7 +4878,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
<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#line358">line 358</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line360">line 360</a>
</li></ul></dd>
@@ -4975,16 +4903,6 @@ This method looks similar to toggleNoteInParent() but differs because we're look
-<h5>Returns:</h5>
-
-
-<div class="param-desc">
- Promise<void>
-</div>
-
-
-
-
@@ -4996,7 +4914,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
- <h4 class="name" id="toggleNoteInParent"><span class="type-signature"></span>toggleNoteInParent<span class="signature">(present, noteId, parentNoteId, prefix)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="toggleNoteInParent"><span class="type-signature"></span>toggleNoteInParent<span class="signature">(present, noteId, parentNoteId, prefix)</span><span class="type-signature"> &rarr; {void}</span></h4>
@@ -5166,7 +5084,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
<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#line171">line 171</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line172">line 172</a>
</li></ul></dd>
@@ -5202,7 +5120,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
</dt>
<dd>
-<span class="param-type">Promise.&lt;void></span>
+<span class="param-type">void</span>
</dd>
@@ -5220,7 +5138,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
- <h4 class="name" id="transactional"><span class="type-signature"></span>transactional<span class="signature">(func)</span><span class="type-signature"> &rarr; {Promise.&lt;?>}</span></h4>
+ <h4 class="name" id="transactional"><span class="type-signature"></span>transactional<span class="signature">(func)</span><span class="type-signature"> &rarr; {?}</span></h4>
@@ -5230,9 +5148,6 @@ This method looks similar to toggleNoteInParent() but differs because we're look
<div class="description">
This functions wraps code which is supposed to be running in transaction. If transaction already
exists, then we'll use that transaction.
-
-This method is required only when script has label manualTransactionHandling, all other scripts are
-transactional by default.
</div>
@@ -5325,7 +5240,7 @@ transactional by default.
<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#line385">line 385</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line384">line 384</a>
</li></ul></dd>
@@ -5365,7 +5280,7 @@ transactional by default.
</dt>
<dd>
-<span class="param-type">Promise.&lt;?></span>
+<span class="param-type">?</span>
</dd>
@@ -5399,7 +5314,7 @@ transactional by default.
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/Branch.html b/docs/backend_api/Branch.html
index e77403c78e..cb92ae68c5 100644
--- a/docs/backend_api/Branch.html
+++ b/docs/backend_api/Branch.html
@@ -107,7 +107,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
- <td class="description last">primary key</td>
+ <td class="description last">primary key, immutable</td>
</tr>
@@ -130,7 +130,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
- <td class="description last"></td>
+ <td class="description last">immutable</td>
</tr>
@@ -153,7 +153,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
- <td class="description last"></td>
+ <td class="description last">immutable</td>
</tr>
@@ -356,7 +356,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line25">line 25</a>
+ <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line24">line 24</a>
</li></ul></dd>
@@ -423,7 +423,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
- <h4 class="name" id="getNote"><span class="type-signature">(async) </span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getNote"><span class="type-signature"></span>getNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -471,7 +471,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line32">line 32</a>
+ <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line31">line 31</a>
</li></ul></dd>
@@ -507,7 +507,10 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -525,7 +528,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
- <h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Note.html">Note</a>|null)>}</span></h4>
+ <h4 class="name" id="getParentNote"><span class="type-signature"></span>getParentNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -573,7 +576,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line37">line 37</a>
+ <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line36">line 36</a>
</li></ul></dd>
@@ -609,7 +612,10 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -643,7 +649,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/Entity.html b/docs/backend_api/Entity.html
index e3697bba1e..10330a6af3 100644
--- a/docs/backend_api/Entity.html
+++ b/docs/backend_api/Entity.html
@@ -150,7 +150,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_entity.js.html">entities/entity.js</a>, <a href="entities_entity.js.html#line9">line 9</a>
+ <a href="entities_entity.js.html">entities/entity.js</a>, <a href="entities_entity.js.html#line10">line 10</a>
</li></ul></dd>
@@ -218,7 +218,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/Note.html b/docs/backend_api/Note.html
index e3e3c2a147..8a89ef597a 100644
--- a/docs/backend_api/Note.html
+++ b/docs/backend_api/Note.html
@@ -224,29 +224,6 @@
- <tr>
-
- <td class="name"><code>contentLength</code></td>
-
-
- <td class="type">
-
-
-<span class="param-type">int</span>
-
-
-
- </td>
-
-
-
-
-
- <td class="description last">length of content</td>
- </tr>
-
-
-
<tr>
<td class="name"><code>isProtected</code></td>
@@ -468,7 +445,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#line44">line 44</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line32">line 32</a>
</li></ul></dd>
@@ -535,7 +512,7 @@
- <h4 class="name" id="addAttribute"><span class="type-signature">(async) </span>addAttribute<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+ <h4 class="name" id="addAttribute"><span class="type-signature"></span>addAttribute<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Attribute.html">Attribute</a>}</span></h4>
@@ -583,7 +560,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#line548">line 548</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line531">line 531</a>
</li></ul></dd>
@@ -619,7 +596,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;<a href="Attribute.html">Attribute</a>></span>
+<span class="param-type"><a href="Attribute.html">Attribute</a></span>
</dd>
@@ -637,7 +614,7 @@
- <h4 class="name" id="getAllNotePaths"><span class="type-signature">(async) </span>getAllNotePaths<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;Array.&lt;string>>>}</span></h4>
+ <h4 class="name" id="getAllNotePaths"><span class="type-signature"></span>getAllNotePaths<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;Array.&lt;string>>}</span></h4>
@@ -685,7 +662,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#line876">line 876</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line855">line 855</a>
</li></ul></dd>
@@ -725,7 +702,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;Array.&lt;string>>></span>
+<span class="param-type">Array.&lt;Array.&lt;string>></span>
</dd>
@@ -743,7 +720,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="getAttribute"><span class="type-signature"></span>getAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {<a href="Attribute.html">Attribute</a>}</span></h4>
@@ -863,7 +840,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#line444">line 444</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line430">line 430</a>
</li></ul></dd>
@@ -903,7 +880,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;<a href="Attribute.html">Attribute</a>></span>
+<span class="param-type"><a href="Attribute.html">Attribute</a></span>
</dd>
@@ -921,7 +898,7 @@
- <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"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+ <h4 class="name" id="getAttributes"><span class="type-signature"></span>getAttributes<span class="signature">(type<span class="signature-attributes">opt</span>, name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -1063,7 +1040,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#line268">line 268</a>
</li></ul></dd>
@@ -1103,7 +1080,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -1121,7 +1098,7 @@
- <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|null)>}</span></h4>
+ <h4 class="name" id="getAttributeValue"><span class="type-signature"></span>getAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {string|null}</span></h4>
@@ -1241,7 +1218,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#line455">line 455</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line441">line 441</a>
</li></ul></dd>
@@ -1281,7 +1258,10 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;(string|null)></span>
+<span class="param-type">string</span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -1299,7 +1279,7 @@
- <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="getBranches"><span class="type-signature"></span>getBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Branch.html">Branch</a>>}</span></h4>
@@ -1347,7 +1327,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#line822">line 822</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line801">line 801</a>
</li></ul></dd>
@@ -1383,7 +1363,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
+<span class="param-type">Array.&lt;<a href="Branch.html">Branch</a>></span>
</dd>
@@ -1401,7 +1381,7 @@
- <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="getChildBranches"><span class="type-signature"></span>getChildBranches<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Branch.html">Branch</a>>}</span></h4>
@@ -1449,7 +1429,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#line850">line 850</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line829">line 829</a>
</li></ul></dd>
@@ -1489,7 +1469,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Branch.html">Branch</a>>></span>
+<span class="param-type">Array.&lt;<a href="Branch.html">Branch</a>></span>
</dd>
@@ -1507,7 +1487,7 @@
- <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>
+ <h4 class="name" id="getChildNotes"><span class="type-signature"></span>getChildNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Note.html">Note</a>>}</span></h4>
@@ -1555,7 +1535,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#line836">line 836</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line815">line 815</a>
</li></ul></dd>
@@ -1595,7 +1575,109 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Array.&lt;<a href="Note.html">Note</a>></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="getContent"><span class="type-signature"></span>getContent<span class="signature">()</span><span class="type-signature"> &rarr; {*}</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#line71">line 71</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type">*</span>
</dd>
@@ -1613,7 +1695,7 @@
- <h4 class="name" id="getContent"><span class="type-signature">(async) </span>getContent<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
+ <h4 class="name" id="getContentMetadata"><span class="type-signature"></span>getContentMetadata<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span></h4>
@@ -1661,7 +1743,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#line75">line 75</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line107">line 107</a>
</li></ul></dd>
@@ -1697,7 +1779,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;*></span>
+<span class="param-type">Object</span>
</dd>
@@ -1715,7 +1797,7 @@
- <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>
+ <h4 class="name" id="getDescendantNoteIds"><span class="type-signature"></span>getDescendantNoteIds<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;string>}</span></h4>
@@ -1763,7 +1845,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#line722">line 722</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line701">line 701</a>
</li></ul></dd>
@@ -1803,7 +1885,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;string>></span>
+<span class="param-type">Array.&lt;string></span>
</dd>
@@ -1821,7 +1903,7 @@
- <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>
+ <h4 class="name" id="getDescendantNotesWithAttribute"><span class="type-signature"></span>getDescendantNotesWithAttribute<span class="signature">(type, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Note.html">Note</a>>}</span></h4>
@@ -1996,7 +2078,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#line745">line 745</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line724">line 724</a>
</li></ul></dd>
@@ -2032,7 +2114,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Array.&lt;<a href="Note.html">Note</a>></span>
</dd>
@@ -2050,7 +2132,7 @@
- <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>
+ <h4 class="name" id="getDescendantNotesWithLabel"><span class="type-signature"></span>getDescendantNotesWithLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Note.html">Note</a>>}</span></h4>
@@ -2194,7 +2276,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#line783">line 783</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line762">line 762</a>
</li></ul></dd>
@@ -2230,7 +2312,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Array.&lt;<a href="Note.html">Note</a>></span>
</dd>
@@ -2248,7 +2330,7 @@
- <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>
+ <h4 class="name" id="getDescendantNotesWithRelation"><span class="type-signature"></span>getDescendantNotesWithRelation<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Note.html">Note</a>>}</span></h4>
@@ -2392,7 +2474,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#line792">line 792</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line771">line 771</a>
</li></ul></dd>
@@ -2428,7 +2510,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Array.&lt;<a href="Note.html">Note</a>></span>
</dd>
@@ -2446,7 +2528,7 @@
- <h4 class="name" id="getJsonContent"><span class="type-signature">(async) </span>getJsonContent<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
+ <h4 class="name" id="getJsonContent"><span class="type-signature"></span>getJsonContent<span class="signature">()</span><span class="type-signature"> &rarr; {*}</span></h4>
@@ -2494,7 +2576,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#line111">line 111</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line118">line 118</a>
</li></ul></dd>
@@ -2530,7 +2612,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;*></span>
+<span class="param-type">*</span>
</dd>
@@ -2548,7 +2630,7 @@
- <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>|null)>}</span></h4>
+ <h4 class="name" id="getLabel"><span class="type-signature"></span>getLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="Attribute.html">Attribute</a>|null}</span></h4>
@@ -2645,7 +2727,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#line599">line 599</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line584">line 584</a>
</li></ul></dd>
@@ -2685,7 +2767,10 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Attribute.html">Attribute</a>|null)></span>
+<span class="param-type"><a href="Attribute.html">Attribute</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -2703,7 +2788,7 @@
- <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>
+ <h4 class="name" id="getLabels"><span class="type-signature"></span>getLabels<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -2812,7 +2897,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#line301">line 301</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line291">line 291</a>
</li></ul></dd>
@@ -2841,7 +2926,7 @@
<div class="param-desc">
- all note's label definitions, including inherited ones
+ all note's labels (attributes with type label), including inherited ones
</div>
@@ -2852,7 +2937,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -2870,7 +2955,7 @@
- <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>
+ <h4 class="name" id="getLabelValue"><span class="type-signature"></span>getLabelValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {string|null}</span></h4>
@@ -2898,8 +2983,6 @@
<th>Type</th>
- <th>Attributes</th>
-
@@ -2925,20 +3008,10 @@
</td>
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
-
-
- </td>
-
- <td class="description last">label name to filter</td>
+ <td class="description last">label name</td>
</tr>
@@ -2979,7 +3052,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#line285">line 285</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line608">line 608</a>
</li></ul></dd>
@@ -3008,7 +3081,7 @@
<div class="param-desc">
- all note's labels (attributes with type label), including inherited ones
+ label value if label exists, null otherwise
</div>
@@ -3019,7 +3092,10 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">string</span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3037,13 +3113,16 @@
- <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|null)>}</span></h4>
+ <h4 class="name" id="getLinks"><span class="type-signature"></span>getLinks<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+<div class="description">
+ Get list of links coming out of this note.
+</div>
@@ -3052,54 +3131,6 @@
- <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>
-
@@ -3122,6 +3153,8 @@
+ <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>- not intended for general use</li></ul></dd>
+
@@ -3134,7 +3167,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#line623">line 623</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line788">line 788</a>
</li></ul></dd>
@@ -3162,10 +3195,6 @@
<h5>Returns:</h5>
-<div class="param-desc">
- label value if label exists, null otherwise
-</div>
-
<dl>
@@ -3174,7 +3203,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;(string|null)></span>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -3192,17 +3221,13 @@
- <h4 class="name" id="getLinks"><span class="type-signature">(async) </span>getLinks<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+ <h4 class="name" id="getOwnedAttribute"><span class="type-signature"></span>getOwnedAttribute<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Attribute.html">Attribute</a>}</span></h4>
-<div class="description">
- Get list of links coming out of this note.
-</div>
-
@@ -3232,8 +3257,6 @@
- <dt class="important tag-deprecated">Deprecated:</dt><dd><ul class="dummy"><li>- not intended for general use</li></ul></dd>
-
@@ -3246,7 +3269,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#line809">line 809</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line250">line 250</a>
</li></ul></dd>
@@ -3274,6 +3297,12 @@
<h5>Returns:</h5>
+<div class="param-desc">
+ attribute belonging to this specific note (excludes inherited attributes)
+
+This method can be significantly faster than the getAttribute()
+</div>
+
<dl>
@@ -3282,7 +3311,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type"><a href="Attribute.html">Attribute</a></span>
</dd>
@@ -3300,13 +3329,17 @@
- <h4 class="name" id="getOwnedAttribute"><span class="type-signature">(async) </span>getOwnedAttribute<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+ <h4 class="name" id="getOwnedAttributes"><span class="type-signature"></span>getOwnedAttributes<span class="signature">(type<span class="signature-attributes">opt</span>, name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<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>
@@ -3316,156 +3349,44 @@
+ <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>type</code></td>
+
-
+ <td class="type">
+
+
+<span class="param-type">string</span>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <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#line244">line 244</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h5>Returns:</h5>
-
-
-<div class="param-desc">
- attribute belonging to this specific note (excludes inherited attributes)
-
-This method can be significantly faster than the getAttribute()
-</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="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"> &rarr; {Promise.&lt;Array.&lt;<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>
<td class="attributes">
@@ -3555,7 +3476,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line220">line 220</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line226">line 226</a>
</li></ul></dd>
@@ -3595,7 +3516,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -3613,7 +3534,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="getOwnedAttributeValue"><span class="type-signature">(async) </span>getOwnedAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;(string|null)>}</span></h4>
+ <h4 class="name" id="getOwnedAttributeValue"><span class="type-signature"></span>getOwnedAttributeValue<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {string|null}</span></h4>
@@ -3733,7 +3654,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line452">line 452</a>
</li></ul></dd>
@@ -3773,7 +3694,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;(string|null)></span>
+<span class="param-type">string</span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3791,7 +3715,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="getOwnedLabel"><span class="type-signature">(async) </span>getOwnedLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Attribute.html">Attribute</a>|null)>}</span></h4>
+ <h4 class="name" id="getOwnedLabel"><span class="type-signature"></span>getOwnedLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="Attribute.html">Attribute</a>|null}</span></h4>
@@ -3888,7 +3812,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line590">line 590</a>
</li></ul></dd>
@@ -3928,7 +3852,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Attribute.html">Attribute</a>|null)></span>
+<span class="param-type"><a href="Attribute.html">Attribute</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -3946,7 +3873,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+ <h4 class="name" id="getOwnedLabels"><span class="type-signature"></span>getOwnedLabels<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -4055,7 +3982,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line293">line 293</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line299">line 299</a>
</li></ul></dd>
@@ -4095,7 +4022,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -4113,7 +4040,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="getOwnedLabelValue"><span class="type-signature">(async) </span>getOwnedLabelValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;(string|null)>}</span></h4>
+ <h4 class="name" id="getOwnedLabelValue"><span class="type-signature"></span>getOwnedLabelValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {string|null}</span></h4>
@@ -4210,7 +4137,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line629">line 629</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line614">line 614</a>
</li></ul></dd>
@@ -4250,7 +4177,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;(string|null)></span>
+<span class="param-type">string</span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -4268,7 +4198,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="getOwnedRelation"><span class="type-signature">(async) </span>getOwnedRelation<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;(<a href="Attribute.html">Attribute</a>|null)>}</span></h4>
+ <h4 class="name" id="getOwnedRelation"><span class="type-signature"></span>getOwnedRelation<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="Attribute.html">Attribute</a>|null}</span></h4>
@@ -4365,7 +4295,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line617">line 617</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line602">line 602</a>
</li></ul></dd>
@@ -4405,7 +4335,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Attribute.html">Attribute</a>|null)></span>
+<span class="param-type"><a href="Attribute.html">Attribute</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -4423,7 +4356,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+ <h4 class="name" id="getOwnedRelations"><span class="type-signature"></span>getOwnedRelations<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -4532,7 +4465,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line315">line 315</a>
</li></ul></dd>
@@ -4572,7 +4505,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -4590,7 +4523,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="getOwnedRelationTarget"><span class="type-signature">(async) </span>getOwnedRelationTarget<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Note.html">Note</a>>|null}</span></h4>
+ <h4 class="name" id="getOwnedRelationTarget"><span class="type-signature"></span>getOwnedRelationTarget<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -4687,7 +4620,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line657">line 657</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line642">line 642</a>
</li></ul></dd>
@@ -4727,7 +4660,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;<a href="Note.html">Note</a>></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
|
<span class="param-type">null</span>
@@ -4748,7 +4681,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="getOwnedRelationValue"><span class="type-signature">(async) </span>getOwnedRelationValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;(string|null)>}</span></h4>
+ <h4 class="name" id="getOwnedRelationValue"><span class="type-signature"></span>getOwnedRelationValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {string|null}</span></h4>
@@ -4845,7 +4778,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line641">line 641</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line626">line 626</a>
</li></ul></dd>
@@ -4885,7 +4818,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;(string|null)></span>
+<span class="param-type">string</span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -4903,7 +4839,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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="Note.html">Note</a>>>}</span></h4>
+ <h4 class="name" id="getParentNotes"><span class="type-signature"></span>getParentNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Note.html">Note</a>>}</span></h4>
@@ -4951,7 +4887,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line862">line 862</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line841">line 841</a>
</li></ul></dd>
@@ -4991,7 +4927,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">Array.&lt;<a href="Note.html">Note</a>></span>
</dd>
@@ -5009,7 +4945,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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>|null)>}</span></h4>
+ <h4 class="name" id="getRelation"><span class="type-signature"></span>getRelation<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="Attribute.html">Attribute</a>|null}</span></h4>
@@ -5106,7 +5042,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line611">line 611</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line596">line 596</a>
</li></ul></dd>
@@ -5146,7 +5082,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;(<a href="Attribute.html">Attribute</a>|null)></span>
+<span class="param-type"><a href="Attribute.html">Attribute</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -5164,7 +5103,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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>
+ <h4 class="name" id="getRelations"><span class="type-signature"></span>getRelations<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -5273,7 +5212,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line340">line 340</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line307">line 307</a>
</li></ul></dd>
@@ -5302,7 +5241,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<div class="param-desc">
- all note's relation definitions including inherited ones
+ all note's relations (attributes with type relation), including inherited ones
</div>
@@ -5313,7 +5252,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -5331,7 +5270,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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>
+ <h4 class="name" id="getRelationTarget"><span class="type-signature"></span>getRelationTarget<span class="signature">(name)</span><span class="type-signature"> &rarr; {<a href="Note.html">Note</a>|null}</span></h4>
@@ -5359,8 +5298,6 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<th>Type</th>
- <th>Attributes</th>
-
@@ -5386,20 +5323,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</td>
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
-
-
- </td>
-
- <td class="description last">relation name to filter</td>
+ <td class="description last"></td>
</tr>
@@ -5440,7 +5367,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line309">line 309</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line632">line 632</a>
</li></ul></dd>
@@ -5469,7 +5396,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<div class="param-desc">
- all note's relations (attributes with type relation), including inherited ones
+ target note of the relation or null (if target is empty or note was not found)
</div>
@@ -5480,7 +5407,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type"><a href="Note.html">Note</a></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -5498,7 +5428,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="getRelationTarget"><span class="type-signature">(async) </span>getRelationTarget<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Note.html">Note</a>>|null}</span></h4>
+ <h4 class="name" id="getRelationTargets"><span class="type-signature"></span>getRelationTargets<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Note.html">Note</a>>}</span></h4>
@@ -5526,6 +5456,8 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<th>Type</th>
+ <th>Attributes</th>
+
@@ -5551,10 +5483,20 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</td>
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+
+ </td>
+
- <td class="description last"></td>
+ <td class="description last">relation name to filter</td>
</tr>
@@ -5595,7 +5537,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line647">line 647</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line323">line 323</a>
</li></ul></dd>
@@ -5623,10 +5565,6 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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>
@@ -5635,10 +5573,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;<a href="Note.html">Note</a>></span>
-|
-
-<span class="param-type">null</span>
+<span class="param-type">Array.&lt;<a href="Note.html">Note</a>></span>
</dd>
@@ -5656,7 +5591,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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"> &rarr; {Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>>}</span></h4>
+ <h4 class="name" id="getRelationValue"><span class="type-signature"></span>getRelationValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {string|null}</span></h4>
@@ -5684,8 +5619,6 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<th>Type</th>
- <th>Attributes</th>
-
@@ -5711,20 +5644,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</td>
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
-
-
- </td>
-
- <td class="description last">relation name to filter</td>
+ <td class="description last">relation name</td>
</tr>
@@ -5765,7 +5688,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line325">line 325</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line620">line 620</a>
</li></ul></dd>
@@ -5793,6 +5716,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<h5>Returns:</h5>
+<div class="param-desc">
+ relation value if relation exists, null otherwise
+</div>
+
<dl>
@@ -5801,7 +5728,10 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Note.html">Note</a>>></span>
+<span class="param-type">string</span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -5819,13 +5749,16 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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|null)>}</span></h4>
+ <h4 class="name" id="getRevisions"><span class="type-signature"></span>getRevisions<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="NoteRevision.html">NoteRevision</a>>}</span></h4>
+<div class="description">
+ Returns note revisions of this note.
+</div>
@@ -5834,190 +5767,32 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h5>Parameters:</h5>
-
-<table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
- <th>Type</th>
-
-
- <th class="last">Description</th>
- </tr>
- </thead>
+<dl class="details">
- <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#line635">line 635</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|null)></span>
-
-
- </dd>
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <h4 class="name" id="getRevisions"><span class="type-signature">(async) </span>getRevisions<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="NoteRevision.html">NoteRevision</a>>>}</span></h4>
-
-
-
-
-
-
-<div class="description">
- Returns note revisions of this note.
-</div>
-
-
-
-
-
-
-
-
-
-
-
-
-
-<dl class="details">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -6026,7 +5801,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line799">line 799</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line778">line 778</a>
</li></ul></dd>
@@ -6062,7 +5837,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="NoteRevision.html">NoteRevision</a>>></span>
+<span class="param-type">Array.&lt;<a href="NoteRevision.html">NoteRevision</a>></span>
</dd>
@@ -6128,7 +5903,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line191">line 191</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line197">line 197</a>
</li></ul></dd>
@@ -6186,7 +5961,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="getTargetRelations"><span class="type-signature">(async) </span>getTargetRelations<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
+ <h4 class="name" id="getTargetRelations"><span class="type-signature"></span>getTargetRelations<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -6234,7 +6009,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line253">line 253</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line259">line 259</a>
</li></ul></dd>
@@ -6274,7 +6049,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -6292,7 +6067,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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>
+ <h4 class="name" id="hasAttribute"><span class="type-signature"></span>hasAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -6412,7 +6187,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line426">line 426</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line412">line 412</a>
</li></ul></dd>
@@ -6452,7 +6227,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;boolean></span>
+<span class="param-type">boolean</span>
</dd>
@@ -6470,7 +6245,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="hasChildren"><span class="type-signature">(async) </span>hasChildren<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+ <h4 class="name" id="hasChildren"><span class="type-signature"></span>hasChildren<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -6518,7 +6293,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line829">line 829</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line808">line 808</a>
</li></ul></dd>
@@ -6576,7 +6351,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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>
+ <h4 class="name" id="hasLabel"><span class="type-signature"></span>hasLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -6673,7 +6448,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line575">line 575</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line560">line 560</a>
</li></ul></dd>
@@ -6713,7 +6488,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;boolean></span>
+<span class="param-type">boolean</span>
</dd>
@@ -6731,7 +6506,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="hasOwnedAttribute"><span class="type-signature">(async) </span>hasOwnedAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
+ <h4 class="name" id="hasOwnedAttribute"><span class="type-signature"></span>hasOwnedAttribute<span class="signature">(type, name)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -6851,7 +6626,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line435">line 435</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line421">line 421</a>
</li></ul></dd>
@@ -6891,7 +6666,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;boolean></span>
+<span class="param-type">boolean</span>
</dd>
@@ -6909,7 +6684,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="hasOwnedLabel"><span class="type-signature">(async) </span>hasOwnedLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
+ <h4 class="name" id="hasOwnedLabel"><span class="type-signature"></span>hasOwnedLabel<span class="signature">(name)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -7006,7 +6781,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line581">line 581</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line566">line 566</a>
</li></ul></dd>
@@ -7046,7 +6821,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;boolean></span>
+<span class="param-type">boolean</span>
</dd>
@@ -7064,7 +6839,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <h4 class="name" id="hasOwnedRelation"><span class="type-signature">(async) </span>hasOwnedRelation<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
+ <h4 class="name" id="hasOwnedRelation"><span class="type-signature"></span>hasOwnedRelation<span class="signature">(name)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -7161,7 +6936,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line593">line 593</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line578">line 578</a>
</li></ul></dd>
@@ -7201,7 +6976,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;boolean></span>
+<span class="param-type">boolean</span>
</dd>
@@ -7219,7 +6994,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
- <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>
+ <h4 class="name" id="hasRelation"><span class="type-signature"></span>hasRelation<span class="signature">(name)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -7316,7 +7091,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
<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#line572">line 572</a>
</li></ul></dd>
@@ -7356,7 +7131,7 @@ Use when inheritance is not needed and/or in batch/performance sensitive operati
</dt>
<dd>
-<span class="param-type">Promise.&lt;boolean></span>
+<span class="param-type">boolean</span>
</dd>
@@ -7427,7 +7202,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#line348">line 348</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line338">line 338</a>
</li></ul></dd>
@@ -7463,7 +7238,7 @@ Cache is note instance scoped.
- <h4 class="name" id="isDescendantOfNote"><span class="type-signature">(async) </span>isDescendantOfNote<span class="signature">(ancestorNoteId)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span></h4>
+ <h4 class="name" id="isDescendantOfNote"><span class="type-signature"></span>isDescendantOfNote<span class="signature">(ancestorNoteId)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -7555,7 +7330,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#line897">line 897</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line886">line 886</a>
</li></ul></dd>
@@ -7595,7 +7370,7 @@ Cache is note instance scoped.
</dt>
<dd>
-<span class="param-type">Promise.&lt;boolean></span>
+<span class="param-type">boolean</span>
</dd>
@@ -7661,7 +7436,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#line181">line 181</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line187">line 187</a>
</li></ul></dd>
@@ -7767,7 +7542,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#line173">line 173</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line179">line 179</a>
</li></ul></dd>
@@ -7873,7 +7648,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#line168">line 168</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line174">line 174</a>
</li></ul></dd>
@@ -7979,7 +7754,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#line163">line 163</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line169">line 169</a>
</li></ul></dd>
@@ -8085,7 +7860,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#line186">line 186</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line192">line 192</a>
</li></ul></dd>
@@ -8143,109 +7918,7 @@ Cache is note instance scoped.
- <h4 class="name" id="loadAttributesToCache"><span class="type-signature">(async) </span>loadAttributesToCache<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</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#line354">line 354</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <h4 class="name" id="removeAttribute"><span class="type-signature">(async) </span>removeAttribute<span class="signature">(type, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="removeAttribute"><span class="type-signature"></span>removeAttribute<span class="signature">(type, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@@ -8420,7 +8093,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#line532">line 532</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line515">line 515</a>
</li></ul></dd>
@@ -8445,39 +8118,21 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
- </dd>
-</dl>
+
+
+
+ <h4 class="name" id="removeLabel"><span class="type-signature"></span>removeLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
-
-
-
-
-
-
-
-
-
- <h4 class="name" id="removeLabel"><span class="type-signature">(async) </span>removeLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
-
-
-
+
@@ -8618,7 +8273,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#line708">line 708</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line688">line 688</a>
</li></ul></dd>
@@ -8643,24 +8298,6 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
@@ -8672,7 +8309,7 @@ Cache is note instance scoped.
- <h4 class="name" id="removeRelation"><span class="type-signature">(async) </span>removeRelation<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="removeRelation"><span class="type-signature"></span>removeRelation<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@@ -8816,7 +8453,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#line717">line 717</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line696">line 696</a>
</li></ul></dd>
@@ -8841,24 +8478,6 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
@@ -8870,7 +8489,7 @@ Cache is note instance scoped.
- <h4 class="name" id="setAttribute"><span class="type-signature">(async) </span>setAttribute<span class="signature">(type, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="setAttribute"><span class="type-signature"></span>setAttribute<span class="signature">(type, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@@ -9045,211 +8664,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#line498">line 498</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <h4 class="name" id="setContent"><span class="type-signature">(async) </span>setContent<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</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#line122">line 122</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise</span>
-
-
- </dd>
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <h4 class="name" id="setJsonContent"><span class="type-signature">(async) </span>setJsonContent<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</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#line158">line 158</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line482">line 482</a>
</li></ul></dd>
@@ -9274,24 +8689,6 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise</span>
-
-
- </dd>
-</dl>
-
-
@@ -9303,7 +8700,7 @@ Cache is note instance scoped.
- <h4 class="name" id="setLabel"><span class="type-signature">(async) </span>setLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="setLabel"><span class="type-signature"></span>setLabel<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@@ -9447,7 +8844,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#line690">line 690</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line672">line 672</a>
</li></ul></dd>
@@ -9472,24 +8869,6 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
@@ -9501,7 +8880,7 @@ Cache is note instance scoped.
- <h4 class="name" id="setRelation"><span class="type-signature">(async) </span>setRelation<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="setRelation"><span class="type-signature"></span>setRelation<span class="signature">(name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@@ -9645,7 +9024,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#line699">line 699</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line680">line 680</a>
</li></ul></dd>
@@ -9670,24 +9049,6 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
@@ -9699,7 +9060,7 @@ Cache is note instance scoped.
- <h4 class="name" id="toggleAttribute"><span class="type-signature">(async) </span>toggleAttribute<span class="signature">(type, enabled, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="toggleAttribute"><span class="type-signature"></span>toggleAttribute<span class="signature">(type, enabled, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@@ -9905,7 +9266,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#line481">line 481</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line466">line 466</a>
</li></ul></dd>
@@ -9930,24 +9291,6 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
@@ -9959,7 +9302,7 @@ Cache is note instance scoped.
- <h4 class="name" id="toggleLabel"><span class="type-signature">(async) </span>toggleLabel<span class="signature">(enabled, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="toggleLabel"><span class="type-signature"></span>toggleLabel<span class="signature">(enabled, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@@ -10134,7 +9477,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#line671">line 671</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line655">line 655</a>
</li></ul></dd>
@@ -10159,24 +9502,6 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
@@ -10188,7 +9513,7 @@ Cache is note instance scoped.
- <h4 class="name" id="toggleRelation"><span class="type-signature">(async) </span>toggleRelation<span class="signature">(enabled, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
+ <h4 class="name" id="toggleRelation"><span class="type-signature"></span>toggleRelation<span class="signature">(enabled, name, value<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
@@ -10363,7 +9688,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#line681">line 681</a>
+ <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line664">line 664</a>
</li></ul></dd>
@@ -10388,24 +9713,6 @@ Cache is note instance scoped.
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise.&lt;void></span>
-
-
- </dd>
-</dl>
-
-
@@ -10433,7 +9740,7 @@ Cache is note instance scoped.
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/NoteRevision.html b/docs/backend_api/NoteRevision.html
index e75e06cdeb..2194ae2fa5 100644
--- a/docs/backend_api/NoteRevision.html
+++ b/docs/backend_api/NoteRevision.html
@@ -198,29 +198,6 @@
- <td class="description last"></td>
- </tr>
-
-
-
- <tr>
-
- <td class="name"><code>contentLength</code></td>
-
-
- <td class="type">
-
-
-<span class="param-type">int</span>
-
-
-
- </td>
-
-
-
-
-
<td class="description last"></td>
</tr>
@@ -421,7 +398,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line35">line 35</a>
+ <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line28">line 28</a>
</li></ul></dd>
@@ -488,7 +465,7 @@
- <h4 class="name" id="getContent"><span class="type-signature">(async) </span>getContent<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4>
+ <h4 class="name" id="getContent"><span class="type-signature"></span>getContent<span class="signature">()</span><span class="type-signature"> &rarr; {*}</span></h4>
@@ -536,7 +513,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line69">line 69</a>
+ <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line68">line 68</a>
</li></ul></dd>
@@ -572,7 +549,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;*></span>
+<span class="param-type">*</span>
</dd>
@@ -638,7 +615,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line55">line 55</a>
+ <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line54">line 54</a>
</li></ul></dd>
@@ -691,108 +668,6 @@
-
-
-
-
-
- <h4 class="name" id="setContent"><span class="type-signature">(async) </span>setContent<span class="signature">()</span><span class="type-signature"> &rarr; {Promise}</span></h4>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<dl class="details">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <dt class="tag-source">Source:</dt>
- <dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line105">line 105</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<h5>Returns:</h5>
-
-
-
-
-<dl>
- <dt>
- Type
- </dt>
- <dd>
-
-<span class="param-type">Promise</span>
-
-
- </dd>
-</dl>
-
-
-
-
-
-
-
-
@@ -814,7 +689,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/Option.html b/docs/backend_api/Option.html
index c314ec75bb..b65e9eb5e1 100644
--- a/docs/backend_api/Option.html
+++ b/docs/backend_api/Option.html
@@ -237,7 +237,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_option.js.html">entities/option.js</a>, <a href="entities_option.js.html#line22">line 22</a>
+ <a href="entities_option.js.html">entities/option.js</a>, <a href="entities_option.js.html#line17">line 17</a>
</li></ul></dd>
@@ -316,7 +316,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/RecentNote.html b/docs/backend_api/RecentNote.html
index 5691dac957..b4d4730566 100644
--- a/docs/backend_api/RecentNote.html
+++ b/docs/backend_api/RecentNote.html
@@ -293,7 +293,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/entities_api_token.js.html b/docs/backend_api/entities_api_token.js.html
index 989b211a9b..0d4db291c2 100644
--- a/docs/backend_api/entities_api_token.js.html
+++ b/docs/backend_api/entities_api_token.js.html
@@ -75,7 +75,7 @@ module.exports = ApiToken;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/entities_attribute.js.html b/docs/backend_api/entities_attribute.js.html
index 031da57b19..abf4502c99 100644
--- a/docs/backend_api/entities_attribute.js.html
+++ b/docs/backend_api/entities_attribute.js.html
@@ -28,21 +28,22 @@
<article>
<pre class="prettyprint source linenums"><code>"use strict";
+
const Entity = require('./entity');
-const repository = require('../services/repository');
const dateUtils = require('../services/date_utils');
const sql = require('../services/sql');
+const promotedAttributeDefinitionParser = require("../services/promoted_attribute_definition_parser");
/**
* Attribute is key value pair owned by a note.
*
- * @property {string} attributeId
- * @property {string} noteId
- * @property {string} type
- * @property {string} name
+ * @property {string} attributeId - immutable
+ * @property {string} noteId - immutable
+ * @property {string} type - immutable
+ * @property {string} name - immutable
* @property {string} value
* @property {int} position
- * @property {boolean} isInheritable
+ * @property {boolean} isInheritable - immutable
* @property {boolean} isDeleted
* @property {string|null} deleteId - ID identifying delete transaction
* @property {string} utcDateCreated
@@ -59,27 +60,19 @@ class Attribute extends Entity {
super(row);
this.isInheritable = !!this.isInheritable;
-
- if (this.isDefinition()) {
- try {
- this.value = JSON.parse(this.value);
- }
- catch (e) {
- }
- }
}
/**
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
- async getNote() {
- return await repository.getNote(this.noteId);
+ getNote() {
+ return this.repository.getNote(this.noteId);
}
/**
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
- async getTargetNote() {
+ getTargetNote() {
if (this.type !== 'relation') {
throw new Error(`Attribute ${this.attributeId} is not relation`);
}
@@ -88,17 +81,31 @@ class Attribute extends Entity {
return null;
}
- return await repository.getNote(this.value);
+ return this.repository.getNote(this.value);
}
/**
* @return {boolean}
*/
isDefinition() {
- return this.type === 'label-definition' || this.type === 'relation-definition';
+ return this.type === 'label' &amp;&amp; (this.name.startsWith('label:') || this.name.startsWith('relation:'));
+ }
+
+ getDefinition() {
+ return promotedAttributeDefinitionParser.parse(this.value);
+ }
+
+ getDefinedName() {
+ if (this.type === 'label' &amp;&amp; this.name.startsWith('label:')) {
+ return this.name.substr(6);
+ } else if (this.type === 'label' &amp;&amp; this.name.startsWith('relation:')) {
+ return this.name.substr(9);
+ } else {
+ return this.name;
+ }
}
- async beforeSaving() {
+ beforeSaving() {
if (!this.value) {
if (this.type === 'relation') {
throw new Error(`Cannot save relation ${this.name} since it does not target any note.`);
@@ -109,7 +116,7 @@ class Attribute extends Entity {
}
if (this.position === undefined) {
- this.position = 1 + await sql.getValue(`SELECT COALESCE(MAX(position), 0) FROM attributes WHERE noteId = ?`, [this.noteId]);
+ this.position = 1 + sql.getValue(`SELECT COALESCE(MAX(position), 0) FROM attributes WHERE noteId = ?`, [this.noteId]);
}
if (!this.isInheritable) {
@@ -131,20 +138,14 @@ class Attribute extends Entity {
}
}
- // cannot be static!
- updatePojo(pojo) {
- delete pojo.isOwned;
- delete pojo.__note;
- }
-
- createClone(type, name, value) {
+ createClone(type, name, value, isInheritable) {
return new Attribute({
noteId: this.noteId,
type: type,
name: name,
value: value,
position: this.position,
- isInheritable: this.isInheritable,
+ isInheritable: isInheritable,
isDeleted: false,
utcDateCreated: this.utcDateCreated,
utcDateModified: this.utcDateModified
@@ -152,7 +153,8 @@ class Attribute extends Entity {
}
}
-module.exports = Attribute;</code></pre>
+module.exports = Attribute;
+</code></pre>
</article>
</section>
@@ -168,7 +170,7 @@ module.exports = Attribute;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/entities_branch.js.html b/docs/backend_api/entities_branch.js.html
index 0974e918bf..2dca97bcbb 100644
--- a/docs/backend_api/entities_branch.js.html
+++ b/docs/backend_api/entities_branch.js.html
@@ -30,16 +30,15 @@
const Entity = require('./entity');
const dateUtils = require('../services/date_utils');
-const repository = require('../services/repository');
const sql = require('../services/sql');
/**
* Branch represents note's placement in the tree - it's essentially pair of noteId and parentNoteId.
* Each note can have multiple (at least one) branches, meaning it can be placed into multiple places in the tree.
*
- * @property {string} branchId - primary key
- * @property {string} noteId
- * @property {string} parentNoteId
+ * @property {string} branchId - primary key, immutable
+ * @property {string} noteId - immutable
+ * @property {string} parentNoteId - immutable
* @property {int} notePosition
* @property {string} prefix
* @property {boolean} isExpanded
@@ -56,19 +55,19 @@ class Branch extends Entity {
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "deleteId", "prefix"]; }
- /** @returns {Promise&lt;Note|null>} */
- async getNote() {
- return await repository.getNote(this.noteId);
+ /** @returns {Note|null} */
+ getNote() {
+ return this.repository.getNote(this.noteId);
}
- /** @returns {Promise&lt;Note|null>} */
- async getParentNote() {
- return await repository.getNote(this.parentNoteId);
+ /** @returns {Note|null} */
+ getParentNote() {
+ return this.repository.getNote(this.parentNoteId);
}
- async beforeSaving() {
+ beforeSaving() {
if (this.notePosition === undefined) {
- const maxNotePos = await sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
+ const maxNotePos = sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
}
@@ -105,7 +104,8 @@ class Branch extends Entity {
}
}
-module.exports = Branch;</code></pre>
+module.exports = Branch;
+</code></pre>
</article>
</section>
@@ -121,7 +121,7 @@ module.exports = Branch;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/entities_entity.js.html b/docs/backend_api/entities_entity.js.html
index a51e29a008..d398acf49d 100644
--- a/docs/backend_api/entities_entity.js.html
+++ b/docs/backend_api/entities_entity.js.html
@@ -29,6 +29,7 @@
<pre class="prettyprint source linenums"><code>"use strict";
const utils = require('../services/utils');
+let repo = null;
class Entity {
/**
@@ -53,14 +54,7 @@ class Entity {
const origHash = this.hash;
this.hash = this.generateHash();
-
- if (this.forcedChange) {
- this.isChanged = true;
- delete this.forcedChange;
- }
- else {
- this.isChanged = origHash !== this.hash;
- }
+ this.isChanged = origHash !== this.hash;
}
generateIdIfNecessary() {
@@ -79,14 +73,23 @@ class Entity {
return utils.hash(contentToHash).substr(0, 10);
}
- async save() {
- await require('../services/repository').updateEntity(this);
+ get repository() {
+ if (!repo) {
+ repo = require('../services/repository');
+ }
+
+ return repo;
+ }
+
+ save() {
+ this.repository.updateEntity(this);
return this;
}
}
-module.exports = Entity;</code></pre>
+module.exports = Entity;
+</code></pre>
</article>
</section>
@@ -102,7 +105,7 @@ module.exports = Entity;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/entities_note.js.html b/docs/backend_api/entities_note.js.html
index eb01e6e382..bfd2d1246b 100644
--- a/docs/backend_api/entities_note.js.html
+++ b/docs/backend_api/entities_note.js.html
@@ -31,16 +31,13 @@
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 utils = require('../services/utils');
const dateUtils = require('../services/date_utils');
-const syncTableService = require('../services/sync_table');
+const entityChangesService = require('../services/entity_changes.js');
const LABEL = 'label';
-const LABEL_DEFINITION = 'label-definition';
const RELATION = 'relation';
-const RELATION_DEFINITION = 'relation-definition';
/**
* This represents a Note which is a central object in the Trilium Notes project.
@@ -49,7 +46,6 @@ const RELATION_DEFINITION = 'relation-definition';
* @property {string} type - one of "text", "code", "file" or "render"
* @property {string} mime - MIME type, e.g. "text/html"
* @property {string} title - note title
- * @property {int} contentLength - length of content
* @property {boolean} isProtected - true if note is protected
* @property {boolean} isDeleted - true if note is deleted
* @property {string|null} deleteId - ID identifying delete transaction
@@ -95,14 +91,14 @@ class Note extends Entity {
* part of Note entity with it's own sync. Reasons behind this hybrid design has been:
*
* - content can be quite large and it's not necessary to load it / fill memory for any note access even if we don't need a content, especially for bulk operations like search
- * - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and sync rows)
+ * - changes in the note metadata or title should not trigger note content sync (so we keep separate utcDateModified and entity changes records)
* - but to the user note content and title changes are one and the same - single dateModified (so all changes must go through Note and content is not a separate entity)
*/
- /** @returns {Promise&lt;*>} */
- async getContent(silentNotFoundError = false) {
+ /** @returns {*} */
+ getContent(silentNotFoundError = false) {
if (this.content === undefined) {
- const res = await sql.getRow(`SELECT content, hash FROM note_contents WHERE noteId = ?`, [this.noteId]);
+ const res = sql.getRow(`SELECT content, hash FROM note_contents WHERE noteId = ?`, [this.noteId]);
if (!res) {
if (silentNotFoundError) {
@@ -135,9 +131,20 @@ class Note extends Entity {
}
}
- /** @returns {Promise&lt;*>} */
- async getJsonContent() {
- const content = await this.getContent();
+ /** @returns {{contentLength, dateModified, utcDateModified}} */
+ getContentMetadata() {
+ return sql.getRow(`
+ SELECT
+ LENGTH(content) AS contentLength,
+ dateModified,
+ utcDateModified
+ FROM note_contents
+ WHERE noteId = ?`, [this.noteId]);
+ }
+
+ /** @returns {*} */
+ getJsonContent() {
+ const content = this.getContent();
if (!content || !content.trim()) {
return null;
@@ -146,24 +153,24 @@ class Note extends Entity {
return JSON.parse(content);
}
- /** @returns {Promise} */
- async setContent(content) {
+ setContent(content) {
if (content === null || content === undefined) {
throw new Error(`Cannot set null content to note ${this.noteId}`);
}
- content = Buffer.isBuffer(content) ? content : Buffer.from(content);
-
- // force updating note itself so that dateModified is represented correctly even for the content
- this.forcedChange = true;
- this.contentLength = content.byteLength;
- await this.save();
+ if (this.isStringNote()) {
+ content = content.toString();
+ }
+ else {
+ content = Buffer.isBuffer(content) ? content : Buffer.from(content);
+ }
this.content = content;
const pojo = {
noteId: this.noteId,
content: content,
+ dateModified: dateUtils.localNowDateTime(),
utcDateModified: dateUtils.utcNowDateTime(),
hash: utils.hash(this.noteId + "|" + content.toString())
};
@@ -177,14 +184,13 @@ class Note extends Entity {
}
}
- await sql.upsert("note_contents", "noteId", pojo);
+ sql.upsert("note_contents", "noteId", pojo);
- await syncTableService.addNoteContentSync(this.noteId);
+ entityChangesService.addNoteContentEntityChange(this.noteId);
}
- /** @returns {Promise} */
- async setJsonContent(content) {
- await this.setContent(JSON.stringify(content, null, '\t'));
+ setJsonContent(content) {
+ this.setContent(JSON.stringify(content, null, '\t'));
}
/** @returns {boolean} true if this note is the root of the note tree. Root note has "root" noteId */
@@ -232,8 +238,8 @@ class Note extends Entity {
return null;
}
- async loadOwnedAttributesToCache() {
- this.__ownedAttributeCache = await repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
+ loadOwnedAttributesToCache() {
+ this.__ownedAttributeCache = this.repository.getEntities(`SELECT * FROM attributes WHERE isDeleted = 0 AND noteId = ?`, [this.noteId]);
return this.__ownedAttributeCache;
}
@@ -243,11 +249,11 @@ class Note extends Entity {
*
* @param {string} [type] - (optional) attribute type to filter
* @param {string} [name] - (optional) attribute name to filter
- * @returns {Promise&lt;Attribute[]>} note's "owned" attributes - excluding inherited ones
+ * @returns {Attribute[]} note's "owned" attributes - excluding inherited ones
*/
- async getOwnedAttributes(type, name) {
+ getOwnedAttributes(type, name) {
if (!this.__ownedAttributeCache) {
- await this.loadOwnedAttributesToCache();
+ this.loadOwnedAttributesToCache();
}
if (type &amp;&amp; name) {
@@ -265,31 +271,31 @@ class Note extends Entity {
}
/**
- * @returns {Promise&lt;Attribute>} attribute belonging to this specific note (excludes inherited attributes)
+ * @returns {Attribute} attribute belonging to this specific note (excludes inherited attributes)
*
* This method can be significantly faster than the getAttribute()
*/
- async getOwnedAttribute(type, name) {
- const attrs = await this.getOwnedAttributes(type, name);
+ getOwnedAttribute(type, name) {
+ const attrs = this.getOwnedAttributes(type, name);
return attrs.length > 0 ? attrs[0] : null;
}
/**
- * @returns {Promise&lt;Attribute[]>} relations targetting this specific note
+ * @returns {Attribute[]} relations targetting this specific note
*/
- async getTargetRelations() {
- return await repository.getEntities("SELECT * FROM attributes WHERE type = 'relation' AND isDeleted = 0 AND value = ?", [this.noteId]);
+ getTargetRelations() {
+ return this.repository.getEntities("SELECT * FROM attributes WHERE type = 'relation' AND isDeleted = 0 AND value = ?", [this.noteId]);
}
/**
* @param {string} [type] - (optional) attribute type to filter
* @param {string} [name] - (optional) attribute name to filter
- * @returns {Promise&lt;Attribute[]>} all note's attributes, including inherited ones
+ * @returns {Attribute[]} all note's attributes, including inherited ones
*/
- async getAttributes(type, name) {
+ getAttributes(type, name) {
if (!this.__attributeCache) {
- await this.loadAttributesToCache();
+ this.loadAttributesToCache();
}
if (type &amp;&amp; name) {
@@ -308,67 +314,51 @@ class Note extends Entity {
/**
* @param {string} [name] - label name to filter
- * @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), including inherited ones
+ * @returns {Attribute[]} all note's labels (attributes with type label), including inherited ones
*/
- async getLabels(name) {
- return await this.getAttributes(LABEL, name);
+ getLabels(name) {
+ return this.getAttributes(LABEL, name);
}
/**
* @param {string} [name] - label name to filter
- * @returns {Promise&lt;Attribute[]>} all note's labels (attributes with type label), excluding inherited ones
+ * @returns {Attribute[]} all note's labels (attributes with type label), excluding inherited ones
*/
- async getOwnedLabels(name) {
- return await this.getOwnedAttributes(LABEL, name);
- }
-
- /**
- * @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(LABEL_DEFINITION, name);
+ getOwnedLabels(name) {
+ return this.getOwnedAttributes(LABEL, name);
}
/**
* @param {string} [name] - relation name to filter
- * @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones
+ * @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
*/
- async getRelations(name) {
- return await this.getAttributes(RELATION, name);
+ getRelations(name) {
+ return this.getAttributes(RELATION, name);
}
/**
* @param {string} [name] - relation name to filter
- * @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), excluding inherited ones
+ * @returns {Attribute[]} all note's relations (attributes with type relation), excluding inherited ones
*/
- async getOwnedRelations(name) {
- return await this.getOwnedAttributes(RELATION, name);
+ getOwnedRelations(name) {
+ return this.getOwnedAttributes(RELATION, name);
}
/**
* @param {string} [name] - relation name to filter
- * @returns {Promise&lt;Note[]>}
+ * @returns {Note[]}
*/
- async getRelationTargets(name) {
- const relations = await this.getRelations(name);
+ getRelationTargets(name) {
+ const relations = this.getRelations(name);
const targets = [];
for (const relation of relations) {
- targets.push(await relation.getTargetNote());
+ targets.push(relation.getTargetNote());
}
return targets;
}
- /**
- * @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(RELATION_DEFINITION, name);
- }
-
/**
* Clear note's attributes cache to force fresh reload for next attribute request.
* Cache is note instance scoped.
@@ -378,9 +368,8 @@ class Note extends Entity {
this.__ownedAttributeCache = null;
}
- /** @returns {Promise&lt;void>} */
- async loadAttributesToCache() {
- const attributes = await repository.getEntities(`
+ loadAttributesToCache() {
+ const attributes = this.repository.getEntities(`
WITH RECURSIVE
tree(noteId, level) AS (
SELECT ?, 0
@@ -412,6 +401,7 @@ class Note extends Entity {
return false;
}
+ // FIXME: this code is quite questionable, one problem is that other caches (TreeCache, NoteCache) have nothing like that
if (attr.isDefinition()) {
const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type &amp;&amp; el.name === attr.name);
@@ -419,15 +409,15 @@ class Note extends Entity {
return firstDefinitionIndex === index;
}
else {
- const definitionAttr = attributes.find(el => el.type === attr.type + '-definition' &amp;&amp; el.name === attr.name);
+ const definitionAttr = attributes.find(el => el.type === 'label' &amp;&amp; el.name === attr.type + ':' + attr.name);
if (!definitionAttr) {
return true;
}
- const definition = definitionAttr.value;
+ const definition = definitionAttr.getDefinition();
- if (definition.multiplicityType === 'multivalue') {
+ if (definition.multiplicity === 'multi') {
return true;
}
else {
@@ -439,38 +429,34 @@ class Note extends Entity {
}
});
- for (const attr of filteredAttributes) {
- attr.isOwned = attr.noteId === this.noteId;
- }
-
this.__attributeCache = filteredAttributes;
}
/**
* @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)
+ * @returns {boolean} true if note has an attribute with given type and name (including inherited)
*/
- async hasAttribute(type, name) {
- return !!await this.getAttribute(type, name);
+ hasAttribute(type, name) {
+ return !!this.getAttribute(type, name);
}
/**
* @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 (excluding inherited)
+ * @returns {boolean} true if note has an attribute with given type and name (excluding inherited)
*/
- async hasOwnedAttribute(type, name) {
- return !!await this.getOwnedAttribute(type, name);
+ hasOwnedAttribute(type, name) {
+ return !!this.getOwnedAttribute(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.
+ * @returns {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();
+ getAttribute(type, name) {
+ const attributes = this.getAttributes();
return attributes.find(attr => attr.type === type &amp;&amp; attr.name === name);
}
@@ -478,10 +464,10 @@ class Note extends Entity {
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
- * @returns {Promise&lt;string|null>} attribute value of given type and name or null if no such attribute exists.
+ * @returns {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);
+ getAttributeValue(type, name) {
+ const attr = this.getAttribute(type, name);
return attr ? attr.value : null;
}
@@ -489,10 +475,10 @@ class Note extends Entity {
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
- * @returns {Promise&lt;string|null>} attribute value of given type and name or null if no such attribute exists.
+ * @returns {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);
+ getOwnedAttributeValue(type, name) {
+ const attr = this.getOwnedAttribute(type, name);
return attr ? attr.value : null;
}
@@ -504,14 +490,13 @@ class Note extends Entity {
* @param {boolean} enabled - toggle On or Off
* @param {string} name - attribute name
* @param {string} [value] - attribute value (optional)
- * @returns {Promise&lt;void>}
*/
- async toggleAttribute(type, enabled, name, value) {
+ toggleAttribute(type, enabled, name, value) {
if (enabled) {
- await this.setAttribute(type, name, value);
+ this.setAttribute(type, name, value);
}
else {
- await this.removeAttribute(type, name, value);
+ this.removeAttribute(type, name, value);
}
}
@@ -521,16 +506,15 @@ class Note extends Entity {
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @param {string} [value] - attribute value (optional)
- * @returns {Promise&lt;void>}
*/
- async setAttribute(type, name, value) {
- const attributes = await this.loadOwnedAttributesToCache();
+ setAttribute(type, name, value) {
+ const attributes = this.loadOwnedAttributesToCache();
let attr = attributes.find(attr => attr.type === type &amp;&amp; attr.name === name);
if (attr) {
if (attr.value !== value) {
attr.value = value;
- await attr.save();
+ attr.save();
this.invalidateAttributeCache();
}
@@ -543,7 +527,7 @@ class Note extends Entity {
value: value !== undefined ? value : ""
});
- await attr.save();
+ attr.save();
this.invalidateAttributeCache();
}
@@ -555,15 +539,14 @@ class Note extends Entity {
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @param {string} [value] - attribute value (optional)
- * @returns {Promise&lt;void>}
*/
- async removeAttribute(type, name, value) {
- const attributes = await this.loadOwnedAttributesToCache();
+ removeAttribute(type, name, value) {
+ const attributes = this.loadOwnedAttributesToCache();
for (const attribute of attributes) {
if (attribute.type === type &amp;&amp; attribute.name === name &amp;&amp; (value === undefined || value === attribute.value)) {
attribute.isDeleted = true;
- await attribute.save();
+ attribute.save();
this.invalidateAttributeCache();
}
@@ -571,121 +554,123 @@ class Note extends Entity {
}
/**
- * @return {Promise&lt;Attribute>}
+ * @return {Attribute}
*/
- async addAttribute(type, name, value = "") {
+ addAttribute(type, name, value = "", isInheritable = false, position = 1000) {
const attr = new Attribute({
noteId: this.noteId,
type: type,
name: name,
- value: value
+ value: value,
+ isInheritable: isInheritable,
+ position: position
});
- await attr.save();
+ attr.save();
this.invalidateAttributeCache();
return attr;
}
- async addLabel(name, value = "") {
- return await this.addAttribute(LABEL, name, value);
+ addLabel(name, value = "", isInheritable = false) {
+ return this.addAttribute(LABEL, name, value, isInheritable);
}
- async addRelation(name, targetNoteId) {
- return await this.addAttribute(RELATION, name, targetNoteId);
+ addRelation(name, targetNoteId, isInheritable = false) {
+ return this.addAttribute(RELATION, name, targetNoteId, isInheritable);
}
/**
* @param {string} name - label name
- * @returns {Promise&lt;boolean>} true if label exists (including inherited)
+ * @returns {boolean} true if label exists (including inherited)
*/
- async hasLabel(name) { return await this.hasAttribute(LABEL, name); }
+ hasLabel(name) { return this.hasAttribute(LABEL, name); }
/**
* @param {string} name - label name
- * @returns {Promise&lt;boolean>} true if label exists (excluding inherited)
+ * @returns {boolean} true if label exists (excluding inherited)
*/
- async hasOwnedLabel(name) { return await this.hasOwnedAttribute(LABEL, name); }
+ hasOwnedLabel(name) { return this.hasOwnedAttribute(LABEL, name); }
/**
* @param {string} name - relation name
- * @returns {Promise&lt;boolean>} true if relation exists (including inherited)
+ * @returns {boolean} true if relation exists (including inherited)
*/
- async hasRelation(name) { return await this.hasAttribute(RELATION, name); }
+ hasRelation(name) { return this.hasAttribute(RELATION, name); }
/**
* @param {string} name - relation name
- * @returns {Promise&lt;boolean>} true if relation exists (excluding inherited)
+ * @returns {boolean} true if relation exists (excluding inherited)
*/
- async hasOwnedRelation(name) { return await this.hasOwnedAttribute(RELATION, name); }
+ hasOwnedRelation(name) { return this.hasOwnedAttribute(RELATION, name); }
/**
* @param {string} name - label name
- * @returns {Promise&lt;Attribute|null>} label if it exists, null otherwise
+ * @returns {Attribute|null} label if it exists, null otherwise
*/
- async getLabel(name) { return await this.getAttribute(LABEL, name); }
+ getLabel(name) { return this.getAttribute(LABEL, name); }
/**
* @param {string} name - label name
- * @returns {Promise&lt;Attribute|null>} label if it exists, null otherwise
+ * @returns {Attribute|null} label if it exists, null otherwise
*/
- async getOwnedLabel(name) { return await this.getOwnedAttribute(LABEL, name); }
+ getOwnedLabel(name) { return this.getOwnedAttribute(LABEL, name); }
/**
* @param {string} name - relation name
- * @returns {Promise&lt;Attribute|null>} relation if it exists, null otherwise
+ * @returns {Attribute|null} relation if it exists, null otherwise
*/
- async getRelation(name) { return await this.getAttribute(RELATION, name); }
+ getRelation(name) { return this.getAttribute(RELATION, name); }
/**
* @param {string} name - relation name
- * @returns {Promise&lt;Attribute|null>} relation if it exists, null otherwise
+ * @returns {Attribute|null} relation if it exists, null otherwise
*/
- async getOwnedRelation(name) { return await this.getOwnedAttribute(RELATION, name); }
+ getOwnedRelation(name) { return this.getOwnedAttribute(RELATION, name); }
/**
* @param {string} name - label name
- * @returns {Promise&lt;string|null>} label value if label exists, null otherwise
+ * @returns {string|null} label value if label exists, null otherwise
*/
- async getLabelValue(name) { return await this.getAttributeValue(LABEL, name); }
+ getLabelValue(name) { return this.getAttributeValue(LABEL, name); }
/**
* @param {string} name - label name
- * @returns {Promise&lt;string|null>} label value if label exists, null otherwise
+ * @returns {string|null} label value if label exists, null otherwise
*/
- async getOwnedLabelValue(name) { return await this.getOwnedAttributeValue(LABEL, name); }
+ getOwnedLabelValue(name) { return this.getOwnedAttributeValue(LABEL, name); }
/**
* @param {string} name - relation name
- * @returns {Promise&lt;string|null>} relation value if relation exists, null otherwise
+ * @returns {string|null} relation value if relation exists, null otherwise
*/
- async getRelationValue(name) { return await this.getAttributeValue(RELATION, name); }
+ getRelationValue(name) { return this.getAttributeValue(RELATION, name); }
/**
* @param {string} name - relation name
- * @returns {Promise&lt;string|null>} relation value if relation exists, null otherwise
+ * @returns {string|null} relation value if relation exists, null otherwise
*/
- async getOwnedRelationValue(name) { return await this.getOwnedAttributeValue(RELATION, name); }
+ getOwnedRelationValue(name) { return this.getOwnedAttributeValue(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)
+ * @returns {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);
+ getRelationTarget(name) {
+ const relation = this.getRelation(name);
- return relation ? await repository.getNote(relation.value) : null;
+ return relation ? this.repository.getNote(relation.value) : null;
}
/**
* @param {string} name
- * @returns {Promise&lt;Note>|null} target note of the relation or null (if target is empty or note was not found)
+ * @returns {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);
+ getOwnedRelationTarget(name) {
+ const relation = this.getOwnedRelation(name);
- return relation ? await repository.getNote(relation.value) : null;
+ return relation ? this.repository.getNote(relation.value) : null;
}
/**
@@ -694,9 +679,8 @@ class Note extends Entity {
* @param {boolean} enabled - toggle On or Off
* @param {string} name - label name
* @param {string} [value] - label value (optional)
- * @returns {Promise&lt;void>}
*/
- async toggleLabel(enabled, name, value) { return await this.toggleAttribute(LABEL, enabled, name, value); }
+ toggleLabel(enabled, name, value) { return this.toggleAttribute(LABEL, enabled, name, value); }
/**
* Based on enabled, relation is either set or removed.
@@ -704,51 +688,46 @@ class Note extends Entity {
* @param {boolean} enabled - toggle On or Off
* @param {string} name - relation name
* @param {string} [value] - relation value (noteId)
- * @returns {Promise&lt;void>}
*/
- async toggleRelation(enabled, name, value) { return await this.toggleAttribute(RELATION, enabled, name, value); }
+ toggleRelation(enabled, name, value) { return this.toggleAttribute(RELATION, enabled, name, value); }
/**
* Update's given label's value or creates it if it doesn't exist
*
* @param {string} name - label name
* @param {string} [value] - label value
- * @returns {Promise&lt;void>}
*/
- async setLabel(name, value) { return await this.setAttribute(LABEL, name, value); }
+ setLabel(name, value) { return this.setAttribute(LABEL, name, value); }
/**
* Update's given relation's value or creates it if it doesn't exist
*
* @param {string} name - relation name
* @param {string} [value] - relation value (noteId)
- * @returns {Promise&lt;void>}
*/
- async setRelation(name, value) { return await this.setAttribute(RELATION, name, value); }
+ setRelation(name, value) { return this.setAttribute(RELATION, name, value); }
/**
* Remove label name-value pair, if it exists.
*
* @param {string} name - label name
* @param {string} [value] - label value
- * @returns {Promise&lt;void>}
*/
- async removeLabel(name, value) { return await this.removeAttribute(LABEL, name, value); }
+ removeLabel(name, value) { return this.removeAttribute(LABEL, name, value); }
/**
* Remove relation name-value pair, if it exists.
*
* @param {string} name - relation name
* @param {string} [value] - relation value (noteId)
- * @returns {Promise&lt;void>}
*/
- async removeRelation(name, value) { return await this.removeAttribute(RELATION, name, value); }
+ removeRelation(name, value) { return this.removeAttribute(RELATION, name, value); }
/**
- * @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
+ * @return {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 getDescendantNoteIds() {
- return await sql.getColumn(`
+ getDescendantNoteIds() {
+ return sql.getColumn(`
WITH RECURSIVE
tree(noteId) AS (
SELECT ?
@@ -768,9 +747,9 @@ class Note extends Entity {
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
* @param {string} [value] - attribute value
- * @returns {Promise&lt;Note[]>}
+ * @returns {Note[]}
*/
- async getDescendantNotesWithAttribute(type, name, value) {
+ getDescendantNotesWithAttribute(type, name, value) {
const params = [this.noteId, name];
let valueCondition = "";
@@ -779,7 +758,7 @@ class Note extends Entity {
valueCondition = " AND attributes.value = ?";
}
- const notes = await repository.getEntities(`
+ const notes = this.repository.getEntities(`
WITH RECURSIVE
tree(noteId) AS (
SELECT ?
@@ -806,36 +785,36 @@ class Note extends Entity {
*
* @param {string} name - label name
* @param {string} [value] - label value
- * @returns {Promise&lt;Note[]>}
+ * @returns {Note[]}
*/
- async getDescendantNotesWithLabel(name, value) { return await this.getDescendantNotesWithAttribute(LABEL, name, value); }
+ getDescendantNotesWithLabel(name, value) { return this.getDescendantNotesWithAttribute(LABEL, name, value); }
/**
* 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[]>}
+ * @returns {Note[]}
*/
- async getDescendantNotesWithRelation(name, value) { return await this.getDescendantNotesWithAttribute(RELATION, name, value); }
+ getDescendantNotesWithRelation(name, value) { return this.getDescendantNotesWithAttribute(RELATION, name, value); }
/**
* Returns note revisions of this note.
*
- * @returns {Promise&lt;NoteRevision[]>}
+ * @returns {NoteRevision[]}
*/
- async getRevisions() {
- return await repository.getEntities("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId]);
+ getRevisions() {
+ return this.repository.getEntities("SELECT * FROM note_revisions WHERE noteId = ?", [this.noteId]);
}
/**
* Get list of links coming out of this note.
*
* @deprecated - not intended for general use
- * @returns {Promise&lt;Attribute[]>}
+ * @returns {Attribute[]}
*/
- async getLinks() {
- return await repository.getEntities(`
+ getLinks() {
+ return this.repository.getEntities(`
SELECT *
FROM attributes
WHERE noteId = ? AND
@@ -845,24 +824,24 @@ class Note extends Entity {
}
/**
- * @returns {Promise&lt;Branch[]>}
+ * @returns {Branch[]}
*/
- async getBranches() {
- return await repository.getEntities("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
+ getBranches() {
+ return this.repository.getEntities("SELECT * FROM branches WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
}
/**
* @returns {boolean} - true if note has children
*/
- async hasChildren() {
- return (await this.getChildNotes()).length > 0;
+ hasChildren() {
+ return (this.getChildNotes()).length > 0;
}
/**
- * @returns {Promise&lt;Note[]>} child notes of this note
+ * @returns {Note[]} child notes of this note
*/
- async getChildNotes() {
- return await repository.getEntities(`
+ getChildNotes() {
+ return this.repository.getEntities(`
SELECT notes.*
FROM branches
JOIN notes USING(noteId)
@@ -873,10 +852,10 @@ class Note extends Entity {
}
/**
- * @returns {Promise&lt;Branch[]>} child branches of this note
+ * @returns {Branch[]} child branches of this note
*/
- async getChildBranches() {
- return await repository.getEntities(`
+ getChildBranches() {
+ return this.repository.getEntities(`
SELECT branches.*
FROM branches
WHERE branches.isDeleted = 0
@@ -885,10 +864,10 @@ class Note extends Entity {
}
/**
- * @returns {Promise&lt;Note[]>} parent notes of this note (note can have multiple parents because of cloning)
+ * @returns {Note[]} parent notes of this note (note can have multiple parents because of cloning)
*/
- async getParentNotes() {
- return await repository.getEntities(`
+ getParentNotes() {
+ return this.repository.getEntities(`
SELECT parent_notes.*
FROM
branches AS child_tree
@@ -899,17 +878,17 @@ class Note extends Entity {
}
/**
- * @return {Promise&lt;string[][]>} - array of notePaths (each represented by array of noteIds constituting the particular note path)
+ * @return {string[][]} - array of notePaths (each represented by array of noteIds constituting the particular note path)
*/
- async getAllNotePaths() {
+ getAllNotePaths() {
if (this.noteId === 'root') {
return [['root']];
}
const notePaths = [];
- for (const parentNote of await this.getParentNotes()) {
- for (const parentPath of await parentNote.getAllNotePaths()) {
+ for (const parentNote of this.getParentNotes()) {
+ for (const parentPath of parentNote.getAllNotePaths()) {
parentPath.push(this.noteId);
notePaths.push(parentPath);
}
@@ -918,12 +897,22 @@ class Note extends Entity {
return notePaths;
}
+ getRelationDefinitions() {
+ return this.getLabels()
+ .filter(l => l.name.startsWith("relation:"));
+ }
+
+ getLabelDefinitions() {
+ return this.getLabels()
+ .filter(l => l.name.startsWith("relation:"));
+ }
+
/**
* @param ancestorNoteId
- * @return {Promise&lt;boolean>} - true if ancestorNoteId occurs in at least one of the note's paths
+ * @return {boolean} - true if ancestorNoteId occurs in at least one of the note's paths
*/
- async isDescendantOfNote(ancestorNoteId) {
- const notePaths = await this.getAllNotePaths();
+ isDescendantOfNote(ancestorNoteId) {
+ const notePaths = this.getAllNotePaths();
return notePaths.some(path => path.includes(ancestorNoteId));
}
@@ -941,10 +930,6 @@ class Note extends Entity {
this.utcDateCreated = dateUtils.utcNowDateTime();
}
- if (this.contentLength === undefined) {
- this.contentLength = -1;
- }
-
super.beforeSaving();
if (this.isChanged) {
@@ -974,7 +959,8 @@ class Note extends Entity {
}
}
-module.exports = Note;</code></pre>
+module.exports = Note;
+</code></pre>
</article>
</section>
@@ -990,7 +976,7 @@ module.exports = Note;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/entities_note_revision.js.html b/docs/backend_api/entities_note_revision.js.html
index 3fddcc676d..e1f1a4214b 100644
--- a/docs/backend_api/entities_note_revision.js.html
+++ b/docs/backend_api/entities_note_revision.js.html
@@ -30,11 +30,10 @@
const Entity = require('./entity');
const protectedSessionService = require('../services/protected_session');
-const repository = require('../services/repository');
const utils = require('../services/utils');
const sql = require('../services/sql');
const dateUtils = require('../services/date_utils');
-const syncTableService = require('../services/sync_table');
+const entityChangesService = require('../services/entity_changes.js');
/**
* NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.
@@ -44,7 +43,6 @@ const syncTableService = require('../services/sync_table');
* @property {string} type
* @property {string} mime
* @property {string} title
- * @property {int} contentLength
* @property {boolean} isErased
* @property {boolean} isProtected
* @property {string} dateLastEdited
@@ -58,11 +56,12 @@ const syncTableService = require('../services/sync_table');
class NoteRevision extends Entity {
static get entityName() { return "note_revisions"; }
static get primaryKeyName() { return "noteRevisionId"; }
- static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "contentLength", "isErased", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
+ static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "isErased", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; }
constructor(row) {
super(row);
+ this.isErased = !!this.isErased;
this.isProtected = !!this.isProtected;
if (this.isProtected) {
@@ -75,8 +74,8 @@ class NoteRevision extends Entity {
}
}
- async getNote() {
- return await repository.getNote(this.noteId);
+ getNote() {
+ return this.repository.getNote(this.noteId);
}
/** @returns {boolean} true if the note has string content (not binary) */
@@ -93,10 +92,10 @@ class NoteRevision extends Entity {
* This is the same approach as is used for Note's content.
*/
- /** @returns {Promise&lt;*>} */
- async getContent(silentNotFoundError = false) {
+ /** @returns {*} */
+ getContent(silentNotFoundError = false) {
if (this.content === undefined) {
- const res = await sql.getRow(`SELECT content, hash FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
+ const res = sql.getRow(`SELECT content, hash FROM note_revision_contents WHERE noteRevisionId = ?`, [this.noteRevisionId]);
if (!res) {
if (silentNotFoundError) {
@@ -129,13 +128,7 @@ class NoteRevision extends Entity {
}
}
- /** @returns {Promise} */
- async setContent(content) {
- // force updating note itself so that utcDateModified is represented correctly even for the content
- this.forcedChange = true;
- this.contentLength = content === null ? 0 : content.length;
- await this.save();
-
+ setContent(content) {
this.content = content;
const pojo = {
@@ -154,9 +147,9 @@ class NoteRevision extends Entity {
}
}
- await sql.upsert("note_revision_contents", "noteRevisionId", pojo);
+ sql.upsert("note_revision_contents", "noteRevisionId", pojo);
- await syncTableService.addNoteRevisionContentSync(this.noteRevisionId);
+ entityChangesService.addNoteRevisionContentEntityChange(this.noteRevisionId);
}
beforeSaving() {
@@ -183,7 +176,8 @@ class NoteRevision extends Entity {
}
}
-module.exports = NoteRevision;</code></pre>
+module.exports = NoteRevision;
+</code></pre>
</article>
</section>
@@ -199,7 +193,7 @@ module.exports = NoteRevision;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/entities_option.js.html b/docs/backend_api/entities_option.js.html
index b8f1dbd936..255779f2ff 100644
--- a/docs/backend_api/entities_option.js.html
+++ b/docs/backend_api/entities_option.js.html
@@ -82,7 +82,7 @@ module.exports = Option;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/entities_recent_note.js.html b/docs/backend_api/entities_recent_note.js.html
index 510c9a6663..a24776e2d3 100644
--- a/docs/backend_api/entities_recent_note.js.html
+++ b/docs/backend_api/entities_recent_note.js.html
@@ -75,7 +75,7 @@ module.exports = RecentNote;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/global.html b/docs/backend_api/global.html
index a060ec36e4..a5e851b1e6 100644
--- a/docs/backend_api/global.html
+++ b/docs/backend_api/global.html
@@ -391,7 +391,7 @@
<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#line212">line 212</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line213">line 213</a>
</li></ul></dd>
@@ -579,7 +579,7 @@
<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#line173">line 173</a>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line174">line 174</a>
</li></ul></dd>
@@ -767,7 +767,7 @@
<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>
+ <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>
</li></ul></dd>
@@ -1053,7 +1053,7 @@
<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>
+ <a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line241">line 241</a>
</li></ul></dd>
@@ -1089,7 +1089,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/index.html b/docs/backend_api/index.html
index df34aab266..4051b8b8fc 100644
--- a/docs/backend_api/index.html
+++ b/docs/backend_api/index.html
@@ -56,7 +56,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/backend_api/services_backend_script_api.js.html b/docs/backend_api/services_backend_script_api.js.html
index caa3973a98..0fef959461 100644
--- a/docs/backend_api/services_backend_script_api.js.html
+++ b/docs/backend_api/services_backend_script_api.js.html
@@ -38,9 +38,9 @@ const repository = require('./repository');
const axios = require('axios');
const dayjs = require('dayjs');
const cloningService = require('./cloning');
-const ws = require('./ws.js');
const appInfo = require('./app_info');
-const searchService = require('./search');
+const searchService = require('./search/services/search');
+const SearchContext = require("./search/search_context.js");
/**
* This is the main backend API interface for scripts. It's published in the local "api" object.
@@ -78,38 +78,31 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
* @param {string} noteId
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
this.getNote = repository.getNote;
/**
* @method
* @param {string} branchId
- * @returns {Promise&lt;Branch|null>}
+ * @returns {Branch|null}
*/
this.getBranch = repository.getBranch;
/**
* @method
* @param {string} attributeId
- * @returns {Promise&lt;Attribute|null>}
+ * @returns {Attribute|null}
*/
this.getAttribute = repository.getAttribute;
- /**
- * @method
- * @param {string} imageId
- * @returns {Promise&lt;Image|null>}
- */
- this.getImage = repository.getImage;
-
/**
* Retrieves first entity from the SQL's result set.
*
* @method
* @param {string} SQL query
* @param {Array.&lt;?>} array of params
- * @returns {Promise&lt;Entity|null>}
+ * @returns {Entity|null}
*/
this.getEntity = repository.getEntity;
@@ -117,30 +110,38 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} SQL query
* @param {Array.&lt;?>} array of params
- * @returns {Promise&lt;Entity[]>}
+ * @returns {Entity[]}
*/
this.getEntities = repository.getEntities;
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
- * "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+ * "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
*
* @method
- * @param {string} searchString
- * @returns {Promise&lt;Note[]>}
+ * @param {string} query
+ * @param {SearchContext} [searchContext]
+ * @returns {Note[]}
*/
- this.searchForNotes = searchService.searchForNotes;
+ this.searchForNotes = (query, searchContext) => {
+ searchContext = searchContext || new SearchContext();
+
+ const noteIds = searchService.findNotesWithQuery(query, searchContext)
+ .map(sr => sr.noteId);
+
+ return repository.getNotes(noteIds);
+ };
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
- * "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+ * "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
*
* @method
* @param {string} searchString
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
- this.searchForNote = async searchString => {
- const notes = await searchService.searchForNotes(searchString);
+ this.searchForNote = searchString => {
+ const notes = searchService.searchNoteEntities(searchString);
return notes.length > 0 ? notes[0] : null;
};
@@ -151,7 +152,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} name - attribute name
* @param {string} [value] - attribute value
- * @returns {Promise&lt;Note[]>}
+ * @returns {Note[]}
*/
this.getNotesWithLabel = attributeService.getNotesWithLabel;
@@ -161,7 +162,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} name - attribute name
* @param {string} [value] - attribute value
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
this.getNoteWithLabel = attributeService.getNoteWithLabel;
@@ -172,7 +173,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} noteId
* @param {string} parentNoteId
* @param {string} prefix - if branch will be create between note and parent note, set this prefix
- * @returns {Promise&lt;void>}
+ * @returns {void}
*/
this.ensureNoteIsPresentInParent = cloningService.ensureNoteIsPresentInParent;
@@ -182,7 +183,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} noteId
* @param {string} parentNoteId
- * @returns {Promise&lt;void>}
+ * @returns {void}
*/
this.ensureNoteIsAbsentFromParent = cloningService.ensureNoteIsAbsentFromParent;
@@ -194,7 +195,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} noteId
* @param {string} parentNoteId
* @param {string} prefix - if branch will be create between note and parent note, set this prefix
- * @returns {Promise&lt;void>}
+ * @returns {void}
*/
this.toggleNoteInParent = cloningService.toggleNoteInParent;
@@ -211,9 +212,9 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} parentNoteId
* @param {string} title
* @param {string} content
- * @return {Promise&lt;{note: Note, branch: Branch}>}
+ * @return {{note: Note, branch: Branch}}
*/
- this.createTextNote = async (parentNoteId, title, content = '') => await noteService.createNewNote({
+ this.createTextNote = (parentNoteId, title, content = '') => noteService.createNewNote({
parentNoteId,
title,
content,
@@ -227,9 +228,9 @@ function BackendScriptApi(currentNote, apiParams) {
* @param {string} parentNoteId
* @param {string} title
* @param {object} content
- * @return {Promise&lt;{note: Note, branch: Branch}>}
+ * @return {{note: Note, branch: Branch}}
*/
- this.createDataNote = async (parentNoteId, title, content = {}) => await noteService.createNewNote({
+ this.createDataNote = (parentNoteId, title, content = {}) => noteService.createNewNote({
parentNoteId,
title,
content: JSON.stringify(content, null, '\t'),
@@ -254,7 +255,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
*
* @param {CreateNewNoteParams} [params]
- * @returns {Promise&lt;{note: Note, branch: Branch}>} object contains newly created entities note and branch
+ * @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
*/
this.createNewNote = noteService.createNewNote;
@@ -276,19 +277,19 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
- * @deprecated please use createNote() API method instead
+ * @deprecated please use createNewNote() API method instead
*
* @param {string} parentNoteId - create new note under this parent
* @param {string} title
* @param {string} [content=""]
* @param {CreateNoteExtraOptions} [extraOptions={}]
- * @returns {Promise&lt;{note: Note, branch: Branch}>} object contains newly created entities note and branch
+ * @returns {{note: Note, branch: Branch}} object contains newly created entities note and branch
*/
- this.createNote = async (parentNoteId, title, content = "", extraOptions= {}) => {
+ this.createNote = (parentNoteId, title, content = "", extraOptions= {}) => {
extraOptions.parentNoteId = parentNoteId;
extraOptions.title = title;
- const parentNote = await repository.getNote(parentNoteId);
+ const parentNote = repository.getNote(parentNoteId);
// code note type can be inherited, otherwise text is default
extraOptions.type = parentNote.type === 'code' ? 'code' : 'text';
@@ -303,19 +304,21 @@ function BackendScriptApi(currentNote, apiParams) {
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};
+ return sql.transactional(() => {
+ const {note, branch} = noteService.createNewNote(extraOptions);
+
+ for (const attr of extraOptions.attributes || []) {
+ attributeService.createAttribute({
+ noteId: note.noteId,
+ type: attr.type,
+ name: attr.name,
+ value: attr.value,
+ isInheritable: !!attr.isInheritable
+ });
+ }
+
+ return {note, branch};
+ });
};
/**
@@ -329,7 +332,7 @@ function BackendScriptApi(currentNote, apiParams) {
* Returns root note of the calendar.
*
* @method
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
this.getRootCalendarNote = dateNoteService.getRootCalendarNote;
@@ -338,7 +341,7 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM-DD format
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
this.getDateNote = dateNoteService.getDateNote;
@@ -346,7 +349,7 @@ function BackendScriptApi(currentNote, apiParams) {
* Returns today's day note. If such note doesn't exist, it is created.
*
* @method
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
this.getTodayNote = dateNoteService.getTodayNote;
@@ -356,7 +359,7 @@ function BackendScriptApi(currentNote, apiParams) {
* @method
* @param {string} date in YYYY-MM-DD format
* @param {object} options - "startOfTheWeek" - either "monday" (default) or "sunday"
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
this.getWeekNote = dateNoteService.getWeekNote;
@@ -365,7 +368,7 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} date in YYYY-MM format
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
this.getMonthNote = dateNoteService.getMonthNote;
@@ -374,14 +377,13 @@ function BackendScriptApi(currentNote, apiParams) {
*
* @method
* @param {string} year in YYYY format
- * @returns {Promise&lt;Note|null>}
+ * @returns {Note|null}
*/
this.getYearNote = dateNoteService.getYearNote;
/**
* @method
* @param {string} parentNoteId - this note's child notes will be sorted
- * @returns Promise&lt;void>
*/
this.sortNotesAlphabetically = treeService.sortNotesAlphabetically;
@@ -403,12 +405,9 @@ function BackendScriptApi(currentNote, apiParams) {
* This functions wraps code which is supposed to be running in transaction. If transaction already
* exists, then we'll use that transaction.
*
- * This method is required only when script has label manualTransactionHandling, all other scripts are
- * transactional by default.
- *
* @method
* @param {function} func
- * @returns {Promise&lt;?>} result of func callback
+ * @returns {?} result of func callback
*/
this.transactional = sql.transactional;
@@ -443,7 +442,7 @@ module.exports = BackendScriptApi;
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/Branch.html b/docs/frontend_api/Branch.html
index f8a5d85737..a30e20eed2 100644
--- a/docs/frontend_api/Branch.html
+++ b/docs/frontend_api/Branch.html
@@ -93,7 +93,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line3">line 3</a>
+ <a href="entities_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line2">line 2</a>
</li></ul></dd>
@@ -661,7 +661,7 @@
- <h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="NoteShort.html">NoteShort</a>}</span></h4>
+ <h4 class="name" id="getNoteFromCache"><span class="type-signature"></span>getNoteFromCache<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="NoteShort.html">NoteShort</a>}</span></h4>
@@ -763,7 +763,7 @@
- <h4 class="name" id="isTopLevel"><span class="type-signature"></span>isTopLevel<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+ <h4 class="name" id="getParentNote"><span class="type-signature">(async) </span>getParentNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="NoteShort.html">NoteShort</a>}</span></h4>
@@ -836,6 +836,108 @@
+<h5>Returns:</h5>
+
+
+
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+
+<span class="param-type"><a href="NoteShort.html">NoteShort</a></span>
+
+
+ </dd>
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="isTopLevel"><span class="type-signature"></span>isTopLevel<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_branch.js.html">entities/branch.js</a>, <a href="entities_branch.js.html#line42">line 42</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<h5>Returns:</h5>
@@ -885,7 +987,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html
index 4be2672707..4cc2502855 100644
--- a/docs/frontend_api/FrontendScriptApi.html
+++ b/docs/frontend_api/FrontendScriptApi.html
@@ -1556,7 +1556,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#line289">line 289</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line287">line 287</a>
</li></ul></dd>
@@ -1712,7 +1712,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#line394">line 394</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line392">line 392</a>
</li></ul></dd>
@@ -1892,7 +1892,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#line281">line 281</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line279">line 279</a>
</li></ul></dd>
@@ -2025,7 +2025,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#line243">line 243</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line241">line 241</a>
</li></ul></dd>
@@ -2131,7 +2131,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#line295">line 295</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line293">line 293</a>
</li></ul></dd>
@@ -2237,7 +2237,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#line309">line 309</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line307">line 307</a>
</li></ul></dd>
@@ -2391,7 +2391,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#line303">line 303</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line301">line 301</a>
</li></ul></dd>
@@ -2528,7 +2528,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#line360">line 360</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line358">line 358</a>
</li></ul></dd>
@@ -2635,7 +2635,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#line236">line 236</a>
+ <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>
@@ -2790,7 +2790,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#line369">line 369</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line367">line 367</a>
</li></ul></dd>
@@ -2946,7 +2946,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#line208">line 208</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line206">line 206</a>
</li></ul></dd>
@@ -3147,7 +3147,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#line220">line 220</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line218">line 218</a>
</li></ul></dd>
@@ -3253,7 +3253,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#line351">line 351</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line349">line 349</a>
</li></ul></dd>
@@ -3408,7 +3408,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#line378">line 378</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line376">line 376</a>
</li></ul></dd>
@@ -3559,7 +3559,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#line250">line 250</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line248">line 248</a>
</li></ul></dd>
@@ -3667,7 +3667,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#line321">line 321</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line319">line 319</a>
</li></ul></dd>
@@ -3823,7 +3823,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#line332">line 332</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line330">line 330</a>
</li></ul></dd>
@@ -3979,7 +3979,139 @@ 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#line341">line 341</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line339">line 339</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <h4 class="name" id="refreshIncludedNote"><span class="type-signature"></span>refreshIncludedNote<span class="signature">(includedNoteId)</span><span class="type-signature"></span></h4>
+
+
+
+
+
+
+<div class="description">
+ This will refresh all currently opened notes which have included note specified in the parameter
+</div>
+
+
+
+
+
+
+
+
+
+ <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>includedNoteId</code></td>
+
+
+ <td class="type">
+
+ </td>
+
+
+
+
+
+ <td class="description last">noteId of the included 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_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line410">line 410</a>
</li></ul></dd>
@@ -4065,7 +4197,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#line272">line 272</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line270">line 270</a>
</li></ul></dd>
@@ -4202,7 +4334,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#line228">line 228</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line226">line 226</a>
</li></ul></dd>
@@ -4516,7 +4648,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<div class="description">
This is a powerful search method - you can search by attributes and their values, e.g.:
-"@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+"#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
</div>
@@ -4609,7 +4741,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#line196">line 196</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line194">line 194</a>
</li></ul></dd>
@@ -4672,7 +4804,7 @@ Internally this serializes the anonymous function into string and sends it to ba
<div class="description">
This is a powerful search method - you can search by attributes and their values, e.g.:
-"@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+"#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
</div>
@@ -4920,7 +5052,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#line387">line 387</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line385">line 385</a>
</li></ul></dd>
@@ -5071,7 +5203,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#line315">line 315</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line313">line 313</a>
</li></ul></dd>
@@ -5208,7 +5340,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#line266">line 266</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line264">line 264</a>
</li></ul></dd>
@@ -5345,7 +5477,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#line258">line 258</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line256">line 256</a>
</li></ul></dd>
@@ -5437,7 +5569,7 @@ Typical use case is when new note has been created, we should wait until it is s
<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#line405">line 405</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line403">line 403</a>
</li></ul></dd>
@@ -5489,7 +5621,7 @@ Typical use case is when new note has been created, we should wait until it is s
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/NoteComplement.html b/docs/frontend_api/NoteComplement.html
index ae6edadd3b..9475f6efa8 100644
--- a/docs/frontend_api/NoteComplement.html
+++ b/docs/frontend_api/NoteComplement.html
@@ -93,7 +93,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line5">line 5</a>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line4">line 4</a>
</li></ul></dd>
@@ -143,6 +143,122 @@
+<h4 class="name" id="combinedDateModified"><span class="type-signature"></span>combinedDateModified<span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line32">line 32</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="combinedUtcDateModified"><span class="type-signature"></span>combinedUtcDateModified<span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line35">line 35</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
<h4 class="name" id="content"><span class="type-signature"></span>content<span class="type-signature"></span></h4>
@@ -183,7 +299,65 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line10">line 10</a>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line12">line 12</a>
+ </li></ul></dd>
+
+
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+<h4 class="name" id="contentLength"><span class="type-signature"></span>contentLength<span class="type-signature"></span></h4>
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <dt class="tag-source">Source:</dt>
+ <dd class="tag-source"><ul class="dummy"><li>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line15">line 15</a>
</li></ul></dd>
@@ -241,7 +415,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line13">line 13</a>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line18">line 18</a>
</li></ul></dd>
@@ -299,7 +473,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line16">line 16</a>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line21">line 21</a>
</li></ul></dd>
@@ -415,7 +589,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line19">line 19</a>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line24">line 24</a>
</li></ul></dd>
@@ -473,7 +647,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
- <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line22">line 22</a>
+ <a href="entities_note_complement.js.html">entities/note_complement.js</a>, <a href="entities_note_complement.js.html#line27">line 27</a>
</li></ul></dd>
@@ -513,7 +687,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/NoteShort.html b/docs/frontend_api/NoteShort.html
index df31231edf..6ff10cc881 100644
--- a/docs/frontend_api/NoteShort.html
+++ b/docs/frontend_api/NoteShort.html
@@ -30,7 +30,9 @@
<h2><span class="attribs"><span class="type-signature"></span></span>NoteShort<span class="signature">(treeCache, row)</span><span class="type-signature"></span></h2>
- <div class="class-description">This note's representation is used in note tree and is kept in TreeCache.</div>
+ <div class="class-description">FIXME: since there's no "full note" anymore we can rename this to Note
+
+This note's representation is used in note tree and is kept in TreeCache.</div>
</header>
@@ -165,7 +167,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#line17">line 17</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line13">line 13</a>
</li></ul></dd>
@@ -265,7 +267,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#line21">line 21</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>
@@ -333,7 +335,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#line29">line 29</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line30">line 30</a>
</li></ul></dd>
@@ -401,65 +403,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#line35">line 35</a>
- </li></ul></dd>
-
-
-
-
-
-
-
-</dl>
-
-
-
-
-
-
-
-
-<h4 class="name" id="contentLength"><span class="type-signature"></span>contentLength<span class="type-signature"></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#line46">line 46</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>
@@ -517,7 +461,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#line54">line 54</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line53">line 53</a>
</li></ul></dd>
@@ -575,7 +519,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#line48">line 48</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line47">line 47</a>
</li></ul></dd>
@@ -633,7 +577,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#line52">line 52</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line51">line 51</a>
</li></ul></dd>
@@ -691,7 +635,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#line42">line 42</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line43">line 43</a>
</li></ul></dd>
@@ -759,7 +703,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#line27">line 27</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line28">line 28</a>
</li></ul></dd>
@@ -827,7 +771,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#line32">line 32</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line33">line 33</a>
</li></ul></dd>
@@ -895,7 +839,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#line24">line 24</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line25">line 25</a>
</li></ul></dd>
@@ -953,7 +897,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#line44">line 44</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line45">line 45</a>
</li></ul></dd>
@@ -1011,7 +955,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#line50">line 50</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line49">line 49</a>
</li></ul></dd>
@@ -1159,7 +1103,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#line298">line 298</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line307">line 307</a>
</li></ul></dd>
@@ -1359,7 +1303,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#line169">line 169</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line176">line 176</a>
</li></ul></dd>
@@ -1537,7 +1481,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#line320">line 320</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line329">line 329</a>
</li></ul></dd>
@@ -1643,7 +1587,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#line112">line 112</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line119">line 119</a>
</li></ul></dd>
@@ -1745,7 +1689,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#line107">line 107</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line114">line 114</a>
</li></ul></dd>
@@ -1847,7 +1791,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#line124">line 124</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line131">line 131</a>
</li></ul></dd>
@@ -1949,7 +1893,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#line142">line 142</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line149">line 149</a>
</li></ul></dd>
@@ -2051,7 +1995,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#line147">line 147</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line154">line 154</a>
</li></ul></dd>
@@ -2202,7 +2146,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#line360">line 360</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line369">line 369</a>
</li></ul></dd>
@@ -2260,7 +2204,7 @@
- <h4 class="name" id="getLabelDefinitions"><span class="type-signature"></span>getLabelDefinitions<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+ <h4 class="name" id="getLabels"><span class="type-signature"></span>getLabels<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -2369,7 +2313,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#line236">line 236</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line253">line 253</a>
</li></ul></dd>
@@ -2398,7 +2342,7 @@
<div class="param-desc">
- all note's label definitions, including inherited ones
+ all note's labels (attributes with type label), including inherited ones
</div>
@@ -2427,7 +2371,7 @@
- <h4 class="name" id="getLabels"><span class="type-signature"></span>getLabels<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+ <h4 class="name" id="getLabelValue"><span class="type-signature"></span>getLabelValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {string}</span></h4>
@@ -2455,8 +2399,6 @@
<th>Type</th>
- <th>Attributes</th>
-
@@ -2482,20 +2424,10 @@
</td>
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
-
-
- </td>
-
- <td class="description last">label name to filter</td>
+ <td class="description last">label name</td>
</tr>
@@ -2536,7 +2468,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#line228">line 228</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line393">line 393</a>
</li></ul></dd>
@@ -2565,7 +2497,7 @@
<div class="param-desc">
- all note's labels (attributes with type label), including inherited ones
+ label value if label exists, null otherwise
</div>
@@ -2576,7 +2508,7 @@
</dt>
<dd>
-<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
+<span class="param-type">string</span>
</dd>
@@ -2594,68 +2526,23 @@
- <h4 class="name" id="getLabelValue"><span class="type-signature"></span>getLabelValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {string}</span></h4>
-
-
+ <h4 class="name" id="getNoteComplement"><span class="type-signature">(async) </span>getNoteComplement<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="NoteComplement.html">NoteComplement</a>>}</span></h4>
-
-
-
-
-
-
-
-
-
-
- <h5>Parameters:</h5>
-<table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
-
- <th>Type</th>
-
-
-
- <th class="last">Description</th>
- </tr>
- </thead>
+<div class="description">
+ Return note complement which is most importantly note's content
+</div>
- <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>
@@ -2691,7 +2578,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#line384">line 384</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line495">line 495</a>
</li></ul></dd>
@@ -2719,10 +2606,6 @@
<h5>Returns:</h5>
-<div class="param-desc">
- label value if label exists, null otherwise
-</div>
-
<dl>
@@ -2731,7 +2614,7 @@
</dt>
<dd>
-<span class="param-type">string</span>
+<span class="param-type">Promise.&lt;<a href="NoteComplement.html">NoteComplement</a>></span>
</dd>
@@ -2869,7 +2752,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#line296">line 296</a>
</li></ul></dd>
@@ -3069,7 +2952,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#line156">line 156</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line163">line 163</a>
</li></ul></dd>
@@ -3247,7 +3130,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#line309">line 309</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>
@@ -3402,7 +3285,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#line354">line 354</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line363">line 363</a>
</li></ul></dd>
@@ -3569,7 +3452,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#line245">line 245</a>
</li></ul></dd>
@@ -3724,7 +3607,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#line378">line 378</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line387">line 387</a>
</li></ul></dd>
@@ -3879,7 +3762,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#line366">line 366</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line375">line 375</a>
</li></ul></dd>
@@ -4046,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#line244">line 244</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line261">line 261</a>
</li></ul></dd>
@@ -4201,7 +4084,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#line390">line 390</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line399">line 399</a>
</li></ul></dd>
@@ -4307,7 +4190,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#line132">line 132</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line139">line 139</a>
</li></ul></dd>
@@ -4409,7 +4292,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#line137">line 137</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>
@@ -4560,7 +4443,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#line372">line 372</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line381">line 381</a>
</li></ul></dd>
@@ -4618,7 +4501,7 @@
- <h4 class="name" id="getRelationDefinitions"><span class="type-signature"></span>getRelationDefinitions<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+ <h4 class="name" id="getRelations"><span class="type-signature"></span>getRelations<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -4727,7 +4610,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#line260">line 260</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line269">line 269</a>
</li></ul></dd>
@@ -4756,7 +4639,7 @@
<div class="param-desc">
- all note's relation definitions including inherited ones
+ all note's relations (attributes with type relation), including inherited ones
</div>
@@ -4785,7 +4668,7 @@
- <h4 class="name" id="getRelations"><span class="type-signature"></span>getRelations<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+ <h4 class="name" id="getRelationTarget"><span class="type-signature">(async) </span>getRelationTarget<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="NoteShort.html">NoteShort</a>>|null}</span></h4>
@@ -4813,8 +4696,6 @@
<th>Type</th>
- <th>Attributes</th>
-
@@ -4840,20 +4721,10 @@
</td>
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
-
-
- </td>
-
- <td class="description last">relation name to filter</td>
+ <td class="description last"></td>
</tr>
@@ -4894,7 +4765,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#line252">line 252</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line411">line 411</a>
</li></ul></dd>
@@ -4923,7 +4794,7 @@
<div class="param-desc">
- all note's relations (attributes with type relation), including inherited ones
+ target note of the relation or null (if target is empty or note was not found)
</div>
@@ -4934,7 +4805,10 @@
</dt>
<dd>
-<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
+<span class="param-type">Promise.&lt;<a href="NoteShort.html">NoteShort</a>></span>
+|
+
+<span class="param-type">null</span>
</dd>
@@ -4952,7 +4826,7 @@
- <h4 class="name" id="getRelationTarget"><span class="type-signature">(async) </span>getRelationTarget<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="NoteShort.html">NoteShort</a>>|null}</span></h4>
+ <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"> &rarr; {Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>>}</span></h4>
@@ -4980,6 +4854,8 @@
<th>Type</th>
+ <th>Attributes</th>
+
@@ -5005,10 +4881,20 @@
</td>
+ <td class="attributes">
+
+ &lt;optional><br>
+
+
+
+
+ </td>
- <td class="description last"></td>
+
+
+ <td class="description last">relation name to filter</td>
</tr>
@@ -5049,7 +4935,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#line402">line 402</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line421">line 421</a>
</li></ul></dd>
@@ -5077,10 +4963,6 @@
<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>
@@ -5089,10 +4971,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;<a href="NoteShort.html">NoteShort</a>></span>
-|
-
-<span class="param-type">null</span>
+<span class="param-type">Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>></span>
</dd>
@@ -5110,7 +4989,7 @@
- <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"> &rarr; {Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>>}</span></h4>
+ <h4 class="name" id="getRelationValue"><span class="type-signature"></span>getRelationValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {string}</span></h4>
@@ -5138,8 +5017,6 @@
<th>Type</th>
- <th>Attributes</th>
-
@@ -5165,20 +5042,10 @@
</td>
- <td class="attributes">
-
- &lt;optional><br>
-
-
-
-
- </td>
-
-
- <td class="description last">relation name to filter</td>
+ <td class="description last">relation name</td>
</tr>
@@ -5219,7 +5086,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#line412">line 412</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line405">line 405</a>
</li></ul></dd>
@@ -5247,6 +5114,10 @@
<h5>Returns:</h5>
+<div class="param-desc">
+ relation value if relation exists, null otherwise
+</div>
+
<dl>
@@ -5255,7 +5126,7 @@
</dt>
<dd>
-<span class="param-type">Promise.&lt;Array.&lt;<a href="NoteShort.html">NoteShort</a>>></span>
+<span class="param-type">string</span>
</dd>
@@ -5273,68 +5144,129 @@
- <h4 class="name" id="getRelationValue"><span class="type-signature"></span>getRelationValue<span class="signature">(name)</span><span class="type-signature"> &rarr; {string}</span></h4>
+ <h4 class="name" id="getTargetRelations"><span class="type-signature"></span>getTargetRelations<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+<div class="description">
+ Get relations which target this note
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- <h5>Parameters:</h5>
-<table class="params">
- <thead>
- <tr>
-
- <th>Name</th>
-
+
+ <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#line474">line 474</a>
+ </li></ul></dd>
+
- <th>Type</th>
+
+
+
+
+
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+<dl>
+ <dt>
+ Type
+ </dt>
+ <dd>
+<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</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="description last">relation name</td>
- </tr>
+
+ <h4 class="name" id="getTargetRelationSourceNotes"><span class="type-signature">(async) </span>getTargetRelationSourceNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="NoteShort.html">NoteShort</a>>}</span></h4>
+
- </tbody>
-</table>
+
+
+
+<div class="description">
+ Get relations which target this note
+</div>
+
+
+
+
+
+
+
@@ -5370,7 +5302,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#line396">line 396</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line484">line 484</a>
</li></ul></dd>
@@ -5398,10 +5330,6 @@
<h5>Returns:</h5>
-<div class="param-desc">
- relation value if relation exists, null otherwise
-</div>
-
<dl>
@@ -5410,7 +5338,7 @@
</dt>
<dd>
-<span class="param-type">string</span>
+<span class="param-type">Array.&lt;<a href="NoteShort.html">NoteShort</a>></span>
</dd>
@@ -5428,17 +5356,13 @@
- <h4 class="name" id="getTargetRelations"><span class="type-signature"></span>getTargetRelations<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
+ <h4 class="name" id="getTemplateNotes"><span class="type-signature"></span>getTemplateNotes<span class="signature">()</span><span class="type-signature"> &rarr; {Array.&lt;<a href="NoteShort.html">NoteShort</a>>}</span></h4>
-<div class="description">
- Get relations which target this note
-</div>
-
@@ -5480,7 +5404,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#line436">line 436</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line435">line 435</a>
</li></ul></dd>
@@ -5516,7 +5440,7 @@
</dt>
<dd>
-<span class="param-type">Array.&lt;<a href="Attribute.html">Attribute</a>></span>
+<span class="param-type">Array.&lt;<a href="NoteShort.html">NoteShort</a>></span>
</dd>
@@ -5654,7 +5578,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#line269">line 269</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>
@@ -5760,7 +5684,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#line119">line 119</a>
+ <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>
@@ -5911,7 +5835,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#line336">line 336</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line345">line 345</a>
</li></ul></dd>
@@ -6089,7 +6013,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#line278">line 278</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line287">line 287</a>
</li></ul></dd>
@@ -6244,7 +6168,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#line330">line 330</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line339">line 339</a>
</li></ul></dd>
@@ -6399,7 +6323,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#line342">line 342</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line351">line 351</a>
</li></ul></dd>
@@ -6554,7 +6478,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#line348">line 348</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line357">line 357</a>
</li></ul></dd>
@@ -6665,7 +6589,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#line427">line 427</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line465">line 465</a>
</li></ul></dd>
@@ -6749,7 +6673,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#line82">line 82</a>
+ <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line89">line 89</a>
</li></ul></dd>
@@ -6819,7 +6743,7 @@ Cache is note instance scoped.
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/entities_attribute.js.html b/docs/frontend_api/entities_attribute.js.html
index a74c256fb4..a3f06a7d31 100644
--- a/docs/frontend_api/entities_attribute.js.html
+++ b/docs/frontend_api/entities_attribute.js.html
@@ -26,7 +26,9 @@
<section>
<article>
- <pre class="prettyprint source linenums"><code>class Attribute {
+ <pre class="prettyprint source linenums"><code>import promotedAttributeDefinitionParser from '../services/promoted_attribute_definition_parser.js';
+
+class Attribute {
constructor(treeCache, row) {
this.treeCache = treeCache;
@@ -47,29 +49,75 @@
/** @param {int} position */
this.position = row.position;
/** @param {boolean} isInheritable */
- this.isInheritable = row.isInheritable;
+ this.isInheritable = !!row.isInheritable;
}
/** @returns {NoteShort} */
- async getNote() {
- return await this.treeCache.getNote(this.noteId);
+ getNote() {
+ return this.treeCache.notes[this.noteId];
}
- get jsonValue() {
- try {
- return JSON.parse(this.value);
- }
- catch (e) {
- return null;
- }
+ get targetNoteId() { // alias
+ return this.type === 'relation' ? this.value : undefined;
+ }
+
+ get isAutoLink() {
+ return this.type === 'relation' &amp;&amp; ['internalLink', 'imageLink', 'relationMapLink', 'includeNoteLink'].includes(this.name);
}
get toString() {
return `Attribute(attributeId=${this.attributeId}, type=${this.type}, name=${this.name}, value=${this.value})`;
}
+
+ /**
+ * @return {boolean} - returns true if this attribute has the potential to influence the note in the argument.
+ * That can happen in multiple ways:
+ * 1. attribute is owned by the note
+ * 2. attribute is owned by the template of the note
+ * 3. attribute is owned by some note's ancestor and is inheritable
+ */
+ isAffecting(affectedNote) {
+ if (!affectedNote) {
+ return false;
+ }
+
+ const attrNote = this.getNote();
+
+ if (!attrNote) {
+ // the note (owner of the attribute) is not even loaded into the cache so it should not affect anything else
+ return false;
+ }
+
+ const owningNotes = [affectedNote, ...affectedNote.getTemplateNotes()];
+
+ for (const owningNote of owningNotes) {
+ if (owningNote.noteId === attrNote.noteId) {
+ return true;
+ }
+ }
+
+ if (this.isInheritable) {
+ for (const owningNote of owningNotes) {
+ if (owningNote.hasAncestor(attrNote)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ isDefinition() {
+ return this.type === 'label' &amp;&amp; (this.name.startsWith('label:') || this.name.startsWith('relation:'));
+ }
+
+ getDefinition() {
+ return promotedAttributeDefinitionParser.parse(this.value);
+ }
}
-export default Attribute;</code></pre>
+export default Attribute;
+</code></pre>
</article>
</section>
@@ -85,7 +133,7 @@ export default Attribute;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/entities_branch.js.html b/docs/frontend_api/entities_branch.js.html
index f492aabbb5..fa67959555 100644
--- a/docs/frontend_api/entities_branch.js.html
+++ b/docs/frontend_api/entities_branch.js.html
@@ -56,6 +56,11 @@ class Branch {
return this.treeCache.getNote(this.noteId);
}
+ /** @returns {NoteShort} */
+ getNoteFromCache() {
+ return this.treeCache.getNoteFromCache(this.noteId);
+ }
+
/** @returns {NoteShort} */
async getParentNote() {
return this.treeCache.getNote(this.parentNoteId);
@@ -87,7 +92,7 @@ export default Branch;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/entities_note_complement.js.html b/docs/frontend_api/entities_note_complement.js.html
index 75b9636e8b..c2253b930e 100644
--- a/docs/frontend_api/entities_note_complement.js.html
+++ b/docs/frontend_api/entities_note_complement.js.html
@@ -34,9 +34,14 @@ class NoteComplement {
/** @param {string} */
this.noteId = row.noteId;
- /** @param {string} */
+ /**
+ * @param {string} - can either contain the whole content (in e.g. string notes), only part (large text notes) or nothing at all (binary notes, images)
+ */
this.content = row.content;
+ /** @param {int} */
+ this.contentLength = row.contentLength;
+
/** @param {string} */
this.dateCreated = row.dateCreated;
@@ -48,10 +53,19 @@ class NoteComplement {
/** @param {string} */
this.utcDateModified = row.utcDateModified;
+
+ // "combined" date modified give larger out of note's and note_content's dateModified
+
+ /** @param {string} */
+ this.combinedDateModified = row.combinedDateModified;
+
+ /** @param {string} */
+ this.combinedUtcDateModified = row.combinedUtcDateModified;
}
}
-export default NoteComplement;</code></pre>
+export default NoteComplement;
+</code></pre>
</article>
</section>
@@ -67,7 +81,7 @@ export default NoteComplement;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/entities_note_short.js.html b/docs/frontend_api/entities_note_short.js.html
index 4f56dd9ceb..71979c12e9 100644
--- a/docs/frontend_api/entities_note_short.js.html
+++ b/docs/frontend_api/entities_note_short.js.html
@@ -28,13 +28,14 @@
<article>
<pre class="prettyprint source linenums"><code>import server from '../services/server.js';
import Attribute from './attribute.js';
+import noteAttributeCache from "../services/note_attribute_cache.js";
const LABEL = 'label';
-const LABEL_DEFINITION = 'label-definition';
const RELATION = 'relation';
-const RELATION_DEFINITION = 'relation-definition';
/**
+ * FIXME: since there's no "full note" anymore we can rename this to Note
+ *
* This note's representation is used in note tree and is kept in TreeCache.
*/
class NoteShort {
@@ -70,8 +71,6 @@ class NoteShort {
this.noteId = row.noteId;
/** @param {string} */
this.title = row.title;
- /** @param {int} */
- this.contentLength = row.contentLength;
/** @param {boolean} */
this.isProtected = !!row.isProtected;
/** @param {string} one of 'text', 'code', 'file' or 'render' */
@@ -83,6 +82,10 @@ class NoteShort {
}
addParent(parentNoteId, branchId) {
+ if (parentNoteId === 'none') {
+ return;
+ }
+
if (!this.parents.includes(parentNoteId)) {
this.parents.push(parentNoteId);
}
@@ -97,6 +100,10 @@ class NoteShort {
this.childToBranch[childNoteId] = branchId;
+ this.sortChildren();
+ }
+
+ sortChildren() {
const branchIdPos = {};
for (const branchId of Object.values(this.childToBranch)) {
@@ -184,9 +191,9 @@ class NoteShort {
getOwnedAttributes(type, name) {
const attrs = this.attributes
.map(attributeId => this.treeCache.attributes[attributeId])
- .filter(attr => !!attr);
+ .filter(Boolean); // filter out nulls;
- return this.__filterAttrs(attrs, type, name)
+ return this.__filterAttrs(attrs, type, name);
}
/**
@@ -195,48 +202,66 @@ class NoteShort {
* @returns {Attribute[]} all note's attributes, including inherited ones
*/
getAttributes(type, name) {
- const ownedAttributes = this.getOwnedAttributes();
+ return this.__filterAttrs(this.__getCachedAttributes([]), type, name);
+ }
- const attrArrs = [
- ownedAttributes
- ];
+ __getCachedAttributes(path) {
+ // notes/clones cannot form tree cycles, it is possible to create attribute inheritance cycle via templates
+ // when template instance is a parent of template itself
+ if (path.includes(this.noteId)) {
+ return [];
+ }
- for (const templateAttr of ownedAttributes.filter(oa => oa.type === 'relation' &amp;&amp; oa.name === 'template')) {
- const templateNote = this.treeCache.getNoteFromCache(templateAttr.value);
+ if (!(this.noteId in noteAttributeCache.attributes)) {
+ const newPath = [...path, this.noteId];
+ const attrArrs = [ this.getOwnedAttributes() ];
- if (templateNote) {
- attrArrs.push(templateNote.getAttributes());
+ if (this.noteId !== 'root') {
+ for (const parentNote of this.getParentNotes()) {
+ // these virtual parent-child relationships are also loaded into frontend tree cache
+ if (parentNote.type !== 'search') {
+ attrArrs.push(parentNote.__getInheritableAttributes(newPath));
+ }
+ }
}
- }
- if (this.noteId !== 'root') {
- for (const parentNote of this.getParentNotes()) {
- // these virtual parent-child relationships are also loaded into frontend tree cache
- if (parentNote.type !== 'search') {
- attrArrs.push(parentNote.getInheritableAttributes());
+ for (const templateAttr of attrArrs.flat().filter(attr => attr.type === 'relation' &amp;&amp; attr.name === 'template')) {
+ const templateNote = this.treeCache.notes[templateAttr.value];
+
+ if (templateNote &amp;&amp; templateNote.noteId !== this.noteId) {
+ attrArrs.push(templateNote.__getCachedAttributes(newPath));
}
}
- }
- const attributes = attrArrs.flat();
+ noteAttributeCache.attributes[this.noteId] = [];
+ const addedAttributeIds = new Set();
+
+ for (const attr of attrArrs.flat()) {
+ if (!addedAttributeIds.has(attr.attributeId)) {
+ addedAttributeIds.add(attr.attributeId);
- return this.__filterAttrs(attributes, type, name);
+ noteAttributeCache.attributes[this.noteId].push(attr);
+ }
+ }
+ }
+
+ return noteAttributeCache.attributes[this.noteId];
}
__filterAttrs(attributes, type, name) {
- if (type &amp;&amp; name) {
+ if (!type &amp;&amp; !name) {
+ return attributes;
+ } else if (type &amp;&amp; name) {
return attributes.filter(attr => attr.type === type &amp;&amp; attr.name === name);
} else if (type) {
return attributes.filter(attr => attr.type === type);
} else if (name) {
return attributes.filter(attr => attr.name === name);
- } else {
- return attributes;
}
}
- getInheritableAttributes() {
- const attrs = this.getAttributes();
+ __getInheritableAttributes(path) {
+ const attrs = this.__getCachedAttributes(path);
return attrs.filter(attr => attr.isInheritable);
}
@@ -257,14 +282,6 @@ class NoteShort {
return this.getAttributes(LABEL, name);
}
- /**
- * @param {string} [name] - label name to filter
- * @returns {Attribute[]} all note's label definitions, including inherited ones
- */
- getLabelDefinitions(name) {
- return this.getAttributes(LABEL_DEFINITION, name);
- }
-
/**
* @param {string} [name] - relation name to filter
* @returns {Attribute[]} all note's relations (attributes with type relation), including inherited ones
@@ -281,14 +298,6 @@ class NoteShort {
return this.getAttributes(RELATION, name);
}
- /**
- * @param {string} [name] - relation name to filter
- * @returns {Attribute[]} all note's relation definitions including inherited ones
- */
- getRelationDefinitions(name) {
- return this.getAttributes(RELATION_DEFINITION, name);
- }
-
/**
* @param {string} type - attribute type (label, relation, etc.)
* @param {string} name - attribute name
@@ -448,6 +457,35 @@ class NoteShort {
return targets;
}
+ /**
+ * @returns {NoteShort[]}
+ */
+ getTemplateNotes() {
+ const relations = this.getRelations('template');
+
+ return relations.map(rel => this.treeCache.notes[rel.value]);
+ }
+
+ hasAncestor(ancestorNote) {
+ if (this.noteId === ancestorNote.noteId) {
+ return true;
+ }
+
+ for (const templateNote of this.getTemplateNotes()) {
+ if (templateNote.hasAncestor(ancestorNote)) {
+ return true;
+ }
+ }
+
+ for (const parentNote of this.getParentNotes()) {
+ if (parentNote.hasAncestor(ancestorNote)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
/**
* Clear note's attributes cache to force fresh reload for next attribute request.
* Cache is note instance scoped.
@@ -466,6 +504,26 @@ class NoteShort {
.map(attributeId => this.treeCache.attributes[attributeId]);
}
+ /**
+ * Get relations which target this note
+ *
+ * @returns {NoteShort[]}
+ */
+ async getTargetRelationSourceNotes() {
+ const targetRelations = this.getTargetRelations();
+
+ return await this.treeCache.getNotes(targetRelations.map(tr => tr.noteId));
+ }
+
+ /**
+ * Return note complement which is most importantly note's content
+ *
+ * @return {Promise&lt;NoteComplement>}
+ */
+ async getNoteComplement() {
+ return await this.treeCache.getNoteComplement(this.noteId);
+ }
+
get toString() {
return `Note(noteId=${this.noteId}, title=${this.title})`;
}
@@ -483,7 +541,8 @@ class NoteShort {
}
}
-export default NoteShort;</code></pre>
+export default NoteShort;
+</code></pre>
</article>
</section>
@@ -499,7 +558,7 @@ export default NoteShort;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/global.html b/docs/frontend_api/global.html
index 6525a2d093..1be03111a8 100644
--- a/docs/frontend_api/global.html
+++ b/docs/frontend_api/global.html
@@ -608,7 +608,7 @@ separately but should behave uniformly for the user.
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/index.html b/docs/frontend_api/index.html
index 978ebed4f6..d727504428 100644
--- a/docs/frontend_api/index.html
+++ b/docs/frontend_api/index.html
@@ -56,7 +56,7 @@
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html
index 0d32d82ba2..4e20f4e31b 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -95,7 +95,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* @return {Promise&lt;void>}
*/
this.activateNewNote = async notePath => {
- await ws.waitForMaxKnownSyncId();
+ await ws.waitForMaxKnownEntityChangeId();
await appContext.tabManager.getActiveTabContext().setNote(notePath);
appContext.triggerEvent('focusAndSelectTitle');
@@ -115,7 +115,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
* @param {ToolbarButtonOptions} opts
*/
this.addButtonToToolbar = opts => {
- const buttonId = "toolbar-button-" + opts.title.replace(/[^a-zA-Z0-9]/g, "-");
+ const buttonId = "toolbar-button-" + opts.title.replace(/\s/g, "-");
const button = $('&lt;button>')
.addClass("btn btn-sm")
@@ -180,7 +180,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
if (ret.success) {
// wait until all the changes done in the script has been synced to frontend before continuing
- await ws.waitForSyncId(ret.maxSyncId);
+ await ws.waitForEntityChangeId(ret.maxEntityChangeId);
return ret.executionResult;
}
@@ -197,25 +197,23 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
- * "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+ * "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
*
* @method
* @param {string} searchString
* @returns {Promise&lt;NoteShort[]>}
*/
this.searchForNotes = async searchString => {
- const noteIds = await this.runOnServer(async searchString => {
- const notes = await api.searchForNotes(searchString);
-
- return notes.map(note => note.noteId);
- }, [searchString]);
+ const noteIds = await this.runOnBackend(
+ searchString => api.searchForNotes(searchString).map(note => note.noteId),
+ [searchString]);
return await treeCache.getNotes(noteIds);
};
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
- * "@dateModified =* MONTH AND @log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
+ * "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
*
* @method
* @param {string} searchString
@@ -430,10 +428,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*
* @method
*/
- this.waitUntilSynced = ws.waitForMaxKnownSyncId;
+ this.waitUntilSynced = ws.waitForMaxKnownEntityChangeId;
+
+ /**
+ * This will refresh all currently opened notes which have included note specified in the parameter
+ *
+ * @param includedNoteId - noteId of the included note
+ */
+ this.refreshIncludedNote = includedNoteId => appContext.triggerEvent('refreshIncludedNote', {noteId: includedNoteId});
}
-export default FrontendScriptApi;</code></pre>
+export default FrontendScriptApi;
+</code></pre>
</article>
</section>
@@ -449,7 +455,7 @@ export default FrontendScriptApi;</code></pre>
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/docs/frontend_api/widgets_collapsible_widget.js.html b/docs/frontend_api/widgets_collapsible_widget.js.html
index e5ec10b7b4..eb09e089eb 100644
--- a/docs/frontend_api/widgets_collapsible_widget.js.html
+++ b/docs/frontend_api/widgets_collapsible_widget.js.html
@@ -57,12 +57,14 @@ export default class CollapsibleWidget extends TabAwareWidget {
doRender() {
this.$widget = $(WIDGET_TPL);
+ this.contentSized();
this.$widget.find('[data-target]').attr('data-target', "#" + this.componentId);
this.$bodyWrapper = this.$widget.find('.body-wrapper');
this.$bodyWrapper.attr('id', this.componentId); // for toggle to work we need id
- this.widgetName = this.constructor.name;
+ // not using constructor name because of webpack mangling class names ...
+ this.widgetName = this.widgetTitle.replace(/[^[a-zA-Z0-9]/g, "_");
if (!options.is(this.widgetName + 'Collapsed')) {
this.$bodyWrapper.collapse("show");
@@ -97,8 +99,6 @@ export default class CollapsibleWidget extends TabAwareWidget {
this.initialized = this.doRenderBody();
this.decorateWidget();
-
- return this.$widget;
}
saveCollapsed(collapse) {
@@ -126,7 +126,8 @@ export default class CollapsibleWidget extends TabAwareWidget {
isExpanded() {
return this.$bodyWrapper.hasClass("show");
}
-}</code></pre>
+}
+</code></pre>
</article>
</section>
@@ -142,7 +143,7 @@ export default class CollapsibleWidget extends TabAwareWidget {
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.4</a>
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a>
</footer>
<script> prettyPrint(); </script>
diff --git a/src/services/backend_script_api.js b/src/services/backend_script_api.js
index f649fdaac3..27f20fe6d0 100644
--- a/src/services/backend_script_api.js
+++ b/src/services/backend_script_api.js
@@ -249,7 +249,7 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
- * @deprecated please use createNewNote() API method instead
+ * @deprecated please use createTextNote() with similar API for simpler use cases or createNewNote() for more complex needs
*
* @param {string} parentNoteId - create new note under this parent
* @param {string} title