Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
script api docs
zadama9dae7823faf
diff --git a/docs/backend_api/AbstractBeccaEntity.html b/docs/backend_api/AbstractBeccaEntity.htmlindex e13c799bc9..328d08f0c2 100644--- a/docs/backend_api/AbstractBeccaEntity.html+++ b/docs/backend_api/AbstractBeccaEntity.html@@ -991,7 +991,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/BAttribute.html b/docs/backend_api/BAttribute.htmlindex 8f6af88c62..29eb98f903 100644--- a/docs/backend_api/BAttribute.html+++ b/docs/backend_api/BAttribute.html@@ -1904,7 +1904,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/BBranch.html b/docs/backend_api/BBranch.htmlindex ae6e4e0141..f75738ee7f 100644--- a/docs/backend_api/BBranch.html+++ b/docs/backend_api/BBranch.html@@ -1916,7 +1916,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/BEtapiToken.html b/docs/backend_api/BEtapiToken.htmlindex 1fab948698..2c6eb82187 100644--- a/docs/backend_api/BEtapiToken.html+++ b/docs/backend_api/BEtapiToken.html@@ -1461,7 +1461,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/BNote.html b/docs/backend_api/BNote.htmlindex d38f35c0fe..b1d3e2b608 100644--- a/docs/backend_api/BNote.html+++ b/docs/backend_api/BNote.html@@ -1318,7 +1318,7 @@ See addLabel, addRelation for more specific methods.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1250">line 1250</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1334">line 1334</a></li></ul></dd>@@ -1654,7 +1654,7 @@ See addLabel, addRelation for more specific methods.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1271">line 1271</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1355">line 1355</a></li></ul></dd>@@ -1900,7 +1900,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1284">line 1284</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1368">line 1368</a></li></ul></dd>@@ -2135,7 +2135,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1369">line 1369</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1453">line 1453</a></li></ul></dd>@@ -2335,7 +2335,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1383">line 1383</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1467">line 1467</a></li></ul></dd>@@ -2556,6 +2556,10 @@ returned.+<div class="description">+ Gives all possible note paths leading to this note. Paths containing search note are ignored (could form cycles)+</div>+@@ -2597,7 +2601,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1141">line 1141</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1172">line 1172</a></li></ul></dd>@@ -2703,7 +2707,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1056">line 1056</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1085">line 1085</a></li></ul></dd>@@ -2877,7 +2881,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line619">line 619</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line633">line 633</a></li></ul></dd>@@ -3055,7 +3059,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line630">line 630</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line644">line 644</a></li></ul></dd>@@ -3316,6 +3320,364 @@ returned.+ <h4 class="name" id="getBestNotePath"><span class="type-signature"></span>getBestNotePath<span class="signature">(hoistedNoteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array.<string>}</span></h4>+++++++<div class="description">+ Returns note path considered to be the "best"+</div>++++++++++ <h5>Parameters:</h5>+++<table class="params">+ <thead>+ <tr>++ <th>Name</th>+++ <th>Type</th>+++ <th>Attributes</th>++++ <th>Default</th>+++ <th class="last">Description</th>+ </tr>+ </thead>++ <tbody>+++ <tr>++ <td class="name"><code>hoistedNoteId</code></td>+++ <td class="type">+++<span class="param-type">string</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++++ </td>++++ <td class="default">++ 'root'++ </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="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1228">line 1228</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++<div class="param-desc">+ array of noteIds constituting the particular note path+</div>++++<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">Array.<string></span>+++ </dd>+</dl>++++++++++++++ <h4 class="name" id="getBestNotePathString"><span class="type-signature"></span>getBestNotePathString<span class="signature">(hoistedNoteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {string}</span></h4>+++++++<div class="description">+ Returns note path considered to be the "best"+</div>++++++++++ <h5>Parameters:</h5>+++<table class="params">+ <thead>+ <tr>++ <th>Name</th>+++ <th>Type</th>+++ <th>Attributes</th>++++ <th>Default</th>+++ <th class="last">Description</th>+ </tr>+ </thead>++ <tbody>+++ <tr>++ <td class="name"><code>hoistedNoteId</code></td>+++ <td class="type">+++<span class="param-type">string</span>++++ </td>+++ <td class="attributes">++ <optional><br>++++++ </td>++++ <td class="default">++ 'root'++ </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="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1238">line 1238</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++<div class="param-desc">+ serialized note path (e.g. 'root/a1h315/js725h')+</div>++++<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">string</span>+++ </dd>+</dl>+++++++++++++<h4 class="name" id="getBranches"><span class="type-signature"></span>getBranches<span class="signature">()</span><span class="type-signature"> → {Array.<<a href="BBranch.html">BBranch</a>>}</span></h4>@@ -3878,7 +4240,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1003">line 1003</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1032">line 1032</a></li></ul></dd>@@ -3968,7 +4330,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line786">line 786</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line815">line 815</a></li></ul></dd>@@ -4074,7 +4436,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1102">line 1102</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1131">line 1131</a></li></ul></dd>@@ -4332,7 +4694,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line560">line 560</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line574">line 574</a></li></ul></dd>@@ -4490,7 +4852,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line584">line 584</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line598">line 598</a></li></ul></dd>@@ -4660,7 +5022,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line659">line 659</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line673">line 673</a></li></ul></dd>@@ -4827,7 +5189,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line651">line 651</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line665">line 665</a></li></ul></dd>@@ -4933,7 +5295,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1133">line 1133</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1162">line 1162</a></li></ul></dd>@@ -5035,7 +5397,7 @@ returned.<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line726">line 726</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line740">line 740</a></li></ul></dd>@@ -5215,7 +5577,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line641">line 641</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line655">line 655</a></li></ul></dd>@@ -5480,7 +5842,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line701">line 701</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line715">line 715</a></li></ul></dd>@@ -5635,7 +5997,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line566">line 566</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line580">line 580</a></li></ul></dd>@@ -5793,7 +6155,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line590">line 590</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line604">line 604</a></li></ul></dd>@@ -5963,7 +6325,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line675">line 675</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line689">line 689</a></li></ul></dd>@@ -6130,7 +6492,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line667">line 667</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line681">line 681</a></li></ul></dd>@@ -6285,7 +6647,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line578">line 578</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line592">line 592</a></li></ul></dd>@@ -6443,7 +6805,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line602">line 602</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line616">line 616</a></li></ul></dd>@@ -6613,7 +6975,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line691">line 691</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line705">line 705</a></li></ul></dd>@@ -7061,7 +7423,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line572">line 572</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line586">line 586</a></li></ul></dd>@@ -7219,7 +7581,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line596">line 596</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line610">line 610</a></li></ul></dd>@@ -7340,20 +7702,126 @@ This method can be significantly faster than the getAttribute()<optional><br>-++++ </td>+++++ <td class="description last">relation name to filter</td>+ </tr>+++ </tbody>+</table>+++++++<dl class="details">+++++++++++++++++++++++++++ <dt class="tag-source">Source:</dt>+ <dd class="tag-source"><ul class="dummy"><li>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line697">line 697</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++<div class="param-desc">+ all note's relations (attributes with type relation), including inherited ones+</div>++++<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">Array.<<a href="BAttribute.html">BAttribute</a>></span>+++ </dd>+</dl>++++++++++++++ <h4 class="name" id="getScriptEnv"><span class="type-signature"></span>getScriptEnv<span class="signature">()</span><span class="type-signature"> → {string|null}</span></h4>++++++++-- </td>--- <td class="description last">relation name to filter</td>- </tr>-- </tbody>-</table>@@ -7389,7 +7857,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line683">line 683</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line365">line 365</a></li></ul></dd>@@ -7418,7 +7886,7 @@ This method can be significantly faster than the getAttribute()<div class="param-desc">- all note's relations (attributes with type relation), including inherited ones+ JS script environment - either "frontend" or "backend"</div>@@ -7429,7 +7897,10 @@ This method can be significantly faster than the getAttribute()</dt><dd>-<span class="param-type">Array.<<a href="BAttribute.html">BAttribute</a>></span>+<span class="param-type">string</span>+|++<span class="param-type">null</span></dd>@@ -7447,7 +7918,7 @@ This method can be significantly faster than the getAttribute()- <h4 class="name" id="getScriptEnv"><span class="type-signature"></span>getScriptEnv<span class="signature">()</span><span class="type-signature"> → {string|null}</span></h4>+ <h4 class="name" id="getSearchResultNotes"><span class="type-signature"></span>getSearchResultNotes<span class="signature">()</span><span class="type-signature"> → {Array.<<a href="BNote.html">BNote</a>>}</span></h4>@@ -7495,7 +7966,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line365">line 365</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line943">line 943</a></li></ul></dd>@@ -7523,10 +7994,6 @@ This method can be significantly faster than the getAttribute()<h5>Returns:</h5>-<div class="param-desc">- JS script environment - either "frontend" or "backend"-</div>-<dl>@@ -7535,10 +8002,7 @@ This method can be significantly faster than the getAttribute()</dt><dd>-<span class="param-type">string</span>-|--<span class="param-type">null</span>+<span class="param-type">Array.<<a href="BNote.html">BNote</a>></span></dd>@@ -7556,19 +8020,88 @@ This method can be significantly faster than the getAttribute()- <h4 class="name" id="getSearchResultNotes"><span class="type-signature"></span>getSearchResultNotes<span class="signature">()</span><span class="type-signature"> → {Array.<<a href="BNote.html">BNote</a>>}</span></h4>+ <h4 class="name" id="getSortedNotePathRecords"><span class="type-signature"></span>getSortedNotePathRecords<span class="signature">(hoistedNoteId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> → {Array.<{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array.<string>, isHidden: boolean}>}</span></h4>+++++++++++++++ <h5>Parameters:</h5>+<table class="params">+ <thead>+ <tr>++ <th>Name</th>+++ <th>Type</th>+++ <th>Attributes</th>++++ <th>Default</th>+++ <th class="last">Description</th>+ </tr>+ </thead>++ <tbody>+ <tr>++ <td class="name"><code>hoistedNoteId</code></td>+++ <td class="type">+++<span class="param-type">string</span>++ </td>++ <td class="attributes">++ <optional><br>++++ </td>+++ <td class="default">++ 'root'++ </td>++ <td class="description last"></td>+ </tr>++ </tbody>+</table>@@ -7604,7 +8137,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line914">line 914</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1197">line 1197</a></li></ul></dd>@@ -7640,7 +8173,7 @@ This method can be significantly faster than the getAttribute()</dt><dd>-<span class="param-type">Array.<<a href="BNote.html">BNote</a>></span>+<span class="param-type">Array.<{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array.<string>, isHidden: boolean}></span></dd>@@ -7812,7 +8345,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line937">line 937</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line966">line 966</a></li></ul></dd>@@ -7914,7 +8447,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line996">line 996</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1025">line 1025</a></li></ul></dd>@@ -8020,7 +8553,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line882">line 882</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line911">line 911</a></li></ul></dd>@@ -8211,7 +8744,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1082">line 1082</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1111">line 1111</a></li></ul></dd>@@ -8962,7 +9495,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line610">line 610</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line624">line 624</a></li></ul></dd>@@ -9160,7 +9693,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line540">line 540</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line554">line 554</a></li></ul></dd>@@ -9358,7 +9891,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line554">line 554</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line568">line 568</a></li></ul></dd>@@ -9556,7 +10089,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line547">line 547</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line561">line 561</a></li></ul></dd>@@ -9706,7 +10239,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1185">line 1185</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1269">line 1269</a></li></ul></dd>@@ -9812,7 +10345,7 @@ This method can be significantly faster than the getAttribute()<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1161">line 1161</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1247">line 1247</a></li></ul></dd>@@ -10282,6 +10815,161 @@ This method can be significantly faster than the getAttribute()+ <h4 class="name" id="isLabelTruthy"><span class="type-signature"></span>isLabelTruthy<span class="signature">(name)</span><span class="type-signature"> → {boolean}</span></h4>+++++++++++++++ <h5>Parameters:</h5>+++<table class="params">+ <thead>+ <tr>++ <th>Name</th>+++ <th>Type</th>++++++ <th class="last">Description</th>+ </tr>+ </thead>++ <tbody>+++ <tr>++ <td class="name"><code>name</code></td>+++ <td class="type">+++<span class="param-type">string</span>++++ </td>++++++ <td class="description last">label name</td>+ </tr>+++ </tbody>+</table>+++++++<dl class="details">+++++++++++++++++++++++++++ <dt class="tag-source">Source:</dt>+ <dd class="tag-source"><ul class="dummy"><li>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line539">line 539</a>+ </li></ul></dd>++++++++</dl>++++++++++++++++<h5>Returns:</h5>+++<div class="param-desc">+ true if label exists (including inherited) and does not have "false" value.+</div>++++<dl>+ <dt>+ Type+ </dt>+ <dd>++<span class="param-type">boolean</span>+++ </dd>+</dl>+++++++++++++<h4 class="name" id="isRoot"><span class="type-signature"></span>isRoot<span class="signature">()</span><span class="type-signature"> → {boolean}</span></h4>@@ -10828,7 +11516,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1229">line 1229</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1313">line 1313</a></li></ul></dd>@@ -11008,7 +11696,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1345">line 1345</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1429">line 1429</a></li></ul></dd>@@ -11188,7 +11876,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1353">line 1353</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1437">line 1437</a></li></ul></dd>@@ -11383,7 +12071,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1435">line 1435</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1519">line 1519</a></li></ul></dd>@@ -11615,7 +12303,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1198">line 1198</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1282">line 1282</a></li></ul></dd>@@ -11795,7 +12483,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1329">line 1329</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1413">line 1413</a></li></ul></dd>@@ -11955,7 +12643,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1337">line 1337</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1421">line 1421</a></li></ul></dd>@@ -12197,7 +12885,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1296">line 1296</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1380">line 1380</a></li></ul></dd>@@ -12408,7 +13096,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1312">line 1312</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1396">line 1396</a></li></ul></dd>@@ -12619,7 +13307,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1321">line 1321</a>+ <a href="becca_entities_bnote.js.html">becca/entities/bnote.js</a>, <a href="becca_entities_bnote.js.html#line1405">line 1405</a></li></ul></dd>@@ -12671,7 +13359,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/BNoteRevision.html b/docs/backend_api/BNoteRevision.htmlindex 0951fa14d2..3a9ccf0d3e 100644--- a/docs/backend_api/BNoteRevision.html+++ b/docs/backend_api/BNoteRevision.html@@ -2174,7 +2174,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/BOption.html b/docs/backend_api/BOption.htmlindex b5990cb927..849051190c 100644--- a/docs/backend_api/BOption.html+++ b/docs/backend_api/BOption.html@@ -267,7 +267,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line24">line 24</a>+ <a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line29">line 29</a></li></ul></dd>@@ -335,7 +335,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line20">line 20</a>+ <a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line25">line 25</a></li></ul></dd>@@ -403,7 +403,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line26">line 26</a>+ <a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line31">line 31</a></li></ul></dd>@@ -471,7 +471,7 @@<dt class="tag-source">Source:</dt><dd class="tag-source"><ul class="dummy"><li>- <a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line22">line 22</a>+ <a href="becca_entities_boption.js.html">becca/entities/boption.js</a>, <a href="becca_entities_boption.js.html#line27">line 27</a></li></ul></dd>@@ -1319,7 +1319,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/BRecentNote.html b/docs/backend_api/BRecentNote.htmlindex b36b38298e..cdda77c51b 100644--- a/docs/backend_api/BRecentNote.html+++ b/docs/backend_api/BRecentNote.html@@ -1251,7 +1251,7 @@ This is a low level method, for notes and branches use `note.deleteNote()` and '<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/BackendScriptApi.html b/docs/backend_api/BackendScriptApi.htmlindex 12800f1610..ba6ffbc2b3 100644--- a/docs/backend_api/BackendScriptApi.html+++ b/docs/backend_api/BackendScriptApi.html@@ -3254,7 +3254,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"> → {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"> → {Object}</span></h4>@@ -3262,7 +3262,7 @@ JSON MIME type. See also createNewNote() for more options.<div class="description">- If there's no branch between note and parent note, create one. Otherwise, do nothing.+ If there's no branch between note and parent note, create one. Otherwise, do nothing. Returns the new or existing branch.</div>@@ -3437,7 +3437,7 @@ JSON MIME type. See also createNewNote() for more options.</dt><dd>-<span class="param-type">void</span>+<span class="param-type">Object</span></dd>@@ -7889,7 +7889,7 @@ exists, then we'll use that transaction.<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/becca_entities_abstract_becca_entity.js.html b/docs/backend_api/becca_entities_abstract_becca_entity.js.htmlindex 4036de3f66..b64387b2d2 100644--- a/docs/backend_api/becca_entities_abstract_becca_entity.js.html+++ b/docs/backend_api/becca_entities_abstract_becca_entity.js.html@@ -212,7 +212,7 @@ module.exports = AbstractBeccaEntity;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/becca_entities_battribute.js.html b/docs/backend_api/becca_entities_battribute.js.htmlindex 83fff96e55..d9715c60b0 100644--- a/docs/backend_api/becca_entities_battribute.js.html+++ b/docs/backend_api/becca_entities_battribute.js.html@@ -124,7 +124,7 @@ class BAttribute extends AbstractBeccaEntity {}if (this.type === 'relation' && !(this.value in this.becca.notes)) {- throw new Error(`Cannot save relation '${this.name}' of note '${this.noteId}' since it target not existing note '${this.value}'.`);+ throw new Error(`Cannot save relation '${this.name}' of note '${this.noteId}' since it targets not existing note '${this.value}'.`);}}@@ -276,7 +276,7 @@ module.exports = BAttribute;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/becca_entities_bbranch.js.html b/docs/backend_api/becca_entities_bbranch.js.htmlindex b4fa7f5674..b2261711d5 100644--- a/docs/backend_api/becca_entities_bbranch.js.html+++ b/docs/backend_api/becca_entities_bbranch.js.html@@ -319,7 +319,7 @@ module.exports = BBranch;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/becca_entities_betapi_token.js.html b/docs/backend_api/becca_entities_betapi_token.js.htmlindex 92ab19328e..3298435224 100644--- a/docs/backend_api/becca_entities_betapi_token.js.html+++ b/docs/backend_api/becca_entities_betapi_token.js.html@@ -120,7 +120,7 @@ module.exports = BEtapiToken;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/becca_entities_bnote.js.html b/docs/backend_api/becca_entities_bnote.js.htmlindex 97889071a5..0c729d838e 100644--- a/docs/backend_api/becca_entities_bnote.js.html+++ b/docs/backend_api/becca_entities_bnote.js.html@@ -125,7 +125,7 @@ class BNote extends AbstractBeccaEntity {* @private */this.parents = [];/** @type {BNote[]}- * @private*/+ * @private */this.children = [];/** @type {BAttribute[]}* @private */@@ -135,11 +135,11 @@ class BNote extends AbstractBeccaEntity {* @private */this.__attributeCache = null;/** @type {BAttribute[]|null}- * @private*/+ * @private */this.inheritableAttributeCache = null;/** @type {BAttribute[]}- * @private*/+ * @private */this.targetRelations = [];this.becca.addNote(this.noteId, this);@@ -560,6 +560,20 @@ class BNote extends AbstractBeccaEntity {*/hasLabel(name, value) { return this.hasAttribute(LABEL, name, value); }+ /**+ * @param {string} name - label name+ * @returns {boolean} true if label exists (including inherited) and does not have "false" value.+ */+ isLabelTruthy(name) {+ const label = this.getLabel(name);++ if (!label) {+ return false;+ }++ return label && label.value !== 'false';+ }+/*** @param {string} name - label name* @param {string} [value] - label value@@ -761,6 +775,21 @@ class BNote extends AbstractBeccaEntity {return this.hasAttribute('label', 'archived');}+ areAllNotePathsArchived() {+ // there's a slight difference between note being itself archived and all its note paths being archived+ // - note is archived when it itself has an archived label or inherits it+ // - note does not have or inherit archived label, but each note paths contains a note with (non-inheritable)+ // archived label++ const bestNotePathRecord = this.getSortedNotePathRecords()[0];++ if (!bestNotePathRecord) {+ throw new Error(`No note path available for note '${this.noteId}'`);+ }++ return bestNotePathRecord.isArchived;+ }+hasInheritableArchivedLabel() {for (const attr of this.getAttributes()) {if (attr.name === 'archived' && attr.type === LABEL && attr.isInheritable) {@@ -1164,6 +1193,8 @@ class BNote extends AbstractBeccaEntity {}/**+ * Gives all possible note paths leading to this note. Paths containing search note are ignored (could form cycles)+ ** @returns {string[][]} - array of notePaths (each represented by array of noteIds constituting the particular note path)*/getAllNotePaths() {@@ -1171,18 +1202,73 @@ class BNote extends AbstractBeccaEntity {return [['root']];}- const notePaths = [];+ const parentNotes = this.getParentNotes();+ let notePaths = [];- for (const parentNote of this.getParentNotes()) {- for (const parentPath of parentNote.getAllNotePaths()) {- parentPath.push(this.noteId);- notePaths.push(parentPath);- }+ if (parentNotes.length === 1) { // optimization for most common case+ notePaths = parentNotes[0].getAllNotePaths();+ } else {+ notePaths = parentNotes.flatMap(parentNote => parentNote.getAllNotePaths());+ }++ for (const notePath of notePaths) {+ notePath.push(this.noteId);}return notePaths;}+ /**+ * @param {string} [hoistedNoteId='root']+ * @return {Array<{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array<string>, isHidden: boolean}>}+ */+ getSortedNotePathRecords(hoistedNoteId = 'root') {+ const isHoistedRoot = hoistedNoteId === 'root';++ const notePaths = this.getAllNotePaths().map(path => ({+ notePath: path,+ isInHoistedSubTree: isHoistedRoot || path.includes(hoistedNoteId),+ isArchived: path.some(noteId => this.becca.notes[noteId].isArchived),+ isHidden: path.includes('_hidden')+ }));++ notePaths.sort((a, b) => {+ if (a.isInHoistedSubTree !== b.isInHoistedSubTree) {+ return a.isInHoistedSubTree ? -1 : 1;+ } else if (a.isArchived !== b.isArchived) {+ return a.isArchived ? 1 : -1;+ } else if (a.isHidden !== b.isHidden) {+ return a.isHidden ? 1 : -1;+ } else {+ return a.notePath.length - b.notePath.length;+ }+ });++ return notePaths;+ }++ /**+ * Returns note path considered to be the "best"+ *+ * @param {string} [hoistedNoteId='root']+ * @return {string[]} array of noteIds constituting the particular note path+ */+ getBestNotePath(hoistedNoteId = 'root') {+ return this.getSortedNotePathRecords(hoistedNoteId)[0]?.notePath;+ }++ /**+ * Returns note path considered to be the "best"+ *+ * @param {string} [hoistedNoteId='root']+ * @return {string} serialized note path (e.g. 'root/a1h315/js725h')+ */+ getBestNotePathString(hoistedNoteId = 'root') {+ const notePath = this.getBestNotePath(hoistedNoteId);++ return notePath?.join("/");+ }+/*** @return boolean - true if there's no non-hidden path, note is not cloned to the visible tree*/@@ -1196,9 +1282,7 @@ class BNote extends AbstractBeccaEntity {return false;} else if (parentNote.noteId === '_hidden') {continue;- }-- if (!parentNote.isHiddenCompletely()) {+ } else if (!parentNote.isHiddenCompletely()) {return false;}}@@ -1392,7 +1476,7 @@ class BNote extends AbstractBeccaEntity {/*** @param parentNoteId- * @returns {{success: boolean, message: string}}+ * @returns {{success: boolean, message: string, branchId: string, notePath: string}}*/cloneTo(parentNoteId) {const cloningService = require("../../services/cloning");@@ -1550,7 +1634,7 @@ module.exports = BNote;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/becca_entities_bnote_revision.js.html b/docs/backend_api/becca_entities_bnote_revision.js.htmlindex c140f1d107..ea663e51f8 100644--- a/docs/backend_api/becca_entities_bnote_revision.js.html+++ b/docs/backend_api/becca_entities_bnote_revision.js.html@@ -194,12 +194,14 @@ class BNoteRevision extends AbstractBeccaEntity {utcDateLastEdited: this.utcDateLastEdited,utcDateCreated: this.utcDateCreated,utcDateModified: this.utcDateModified,+ content: this.content, // used when retrieving full note revision to frontendcontentLength: this.contentLength};}getPojoToSave() {const pojo = this.getPojo();+ delete pojo.content; // not getting persisteddelete pojo.contentLength; // not getting persistedif (pojo.isProtected) {@@ -233,7 +235,7 @@ module.exports = BNoteRevision;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/becca_entities_boption.js.html b/docs/backend_api/becca_entities_boption.js.htmlindex ab2c22f519..0f2856fdcb 100644--- a/docs/backend_api/becca_entities_boption.js.html+++ b/docs/backend_api/becca_entities_boption.js.html@@ -44,6 +44,11 @@ class BOption extends AbstractBeccaEntity {constructor(row) {super();+ this.updateFromRow(row);+ this.becca.options[this.name] = this;+ }++ updateFromRow(row) {/** @type {string} */this.name = row.name;/** @type {string} */@@ -52,8 +57,6 @@ class BOption extends AbstractBeccaEntity {this.isSynced = !!row.isSynced;/** @type {string} */this.utcDateModified = row.utcDateModified;-- this.becca.options[this.name] = this;}beforeSaving() {@@ -89,7 +92,7 @@ module.exports = BOption;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/becca_entities_brecent_note.js.html b/docs/backend_api/becca_entities_brecent_note.js.htmlindex 2e2f5ccb1a..02f6858fb0 100644--- a/docs/backend_api/becca_entities_brecent_note.js.html+++ b/docs/backend_api/becca_entities_brecent_note.js.html@@ -77,7 +77,7 @@ module.exports = BRecentNote;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/index.html b/docs/backend_api/index.htmlindex 55d778a7e6..f9f7919b5f 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 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/module-sql.html b/docs/backend_api/module-sql.htmlindex 6517bc0d48..2605d65303 100644--- a/docs/backend_api/module-sql.html+++ b/docs/backend_api/module-sql.html@@ -1300,7 +1300,7 @@<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</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.htmlindex 44f40bed62..bffce4bcd6 100644--- a/docs/backend_api/services_backend_script_api.js.html+++ b/docs/backend_api/services_backend_script_api.js.html@@ -165,13 +165,13 @@ function BackendScriptApi(currentNote, apiParams) {this.getNoteWithLabel = attributeService.getNoteWithLabel;/**- * If there's no branch between note and parent note, create one. Otherwise, do nothing.+ * If there's no branch between note and parent note, create one. Otherwise, do nothing. Returns the new or existing branch.** @method* @param {string} noteId* @param {string} parentNoteId* @param {string} prefix - if branch will be created between note and parent note, set this prefix- * @returns {void}+ * @returns {{branch: BBranch|null}}*/this.ensureNoteIsPresentInParent = cloningService.ensureNoteIsPresentInParent;@@ -499,11 +499,11 @@ function BackendScriptApi(currentNote, apiParams) {if (opts.type === 'script' && !opts.scriptNoteId) { throw new Error("scriptNoteId is mandatory for launchers of type 'script'"); }if (opts.type === 'customWidget' && !opts.widgetNoteId) { throw new Error("widgetNoteId is mandatory for launchers of type 'customWidget'"); }- const parentNoteId = !!opts.isVisible ? '_lbVisibleLaunchers' : '_lbAvailableLaunchers';+ const parentNoteId = opts.isVisible ? '_lbVisibleLaunchers' : '_lbAvailableLaunchers';const noteId = 'al_' + opts.id;const launcherNote =- becca.getNote(opts.id) ||+ becca.getNote(noteId) ||specialNotesService.createLauncher({noteId: noteId,parentNoteId: parentNoteId,@@ -542,7 +542,7 @@ function BackendScriptApi(currentNote, apiParams) {if (opts.icon) {launcherNote.setLabel('iconClass', `bx ${opts.icon}`);} else {- launcherNote.removeLabel('keyboardShortcut');+ launcherNote.removeLabel('iconClass');}return {note: launcherNote};@@ -584,7 +584,7 @@ module.exports = BackendScriptApi;<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/docs/backend_api/services_sql.js.html b/docs/backend_api/services_sql.js.htmlindex ec2ac56e69..783bf8301f 100644--- a/docs/backend_api/services_sql.js.html+++ b/docs/backend_api/services_sql.js.html@@ -245,7 +245,7 @@ function wrap(query, func) {// in these cases error should be simply ignored.console.log(e.message);- return null+ return null;}throw e;@@ -309,7 +309,7 @@ function fillParamList(paramIds, truncate = true) {}// doing it manually to avoid this showing up on the sloq query list- const s = stmt(`INSERT INTO param_list VALUES ${paramIds.map(paramId => `(?)`).join(',')}`, paramIds);+ const s = stmt(`INSERT INTO param_list VALUES ${paramIds.map(paramId => `(?)`).join(',')}`);s.run(paramIds);}@@ -413,7 +413,7 @@ module.exports = {<br class="clear"><footer>- Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.1</a>+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a></footer><script> prettyPrint(); </script>diff --git a/package-lock.json b/package-lock.jsonindex 6055a636ee..682c4f5a06 100644--- a/package-lock.json+++ b/package-lock.json@@ -5,7 +5,6 @@"requires": true,"packages": {"": {- "name": "trilium","version": "0.60.1-beta","hasInstallScript": true,"license": "AGPL-3.0-only",diff --git a/src/becca/entities/bnote.js b/src/becca/entities/bnote.jsindex b8e58c740f..0be9a3ab4b 100644--- a/src/becca/entities/bnote.js+++ b/src/becca/entities/bnote.js@@ -1192,7 +1192,7 @@ class BNote extends AbstractBeccaEntity {/*** @param {string} [hoistedNoteId='root']- * @return {{isArchived: boolean, isInHoistedSubTree: boolean, notePath: string[], isHidden: boolean}[]}+ * @return {Array<{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array<string>, isHidden: boolean}>}*/getSortedNotePathRecords(hoistedNoteId = 'root') {const isHoistedRoot = hoistedNoteId === 'root';diff --git a/src/public/app/entities/fnote.js b/src/public/app/entities/fnote.jsindex eff96df819..d73f14de2c 100644--- a/src/public/app/entities/fnote.js+++ b/src/public/app/entities/fnote.js@@ -332,7 +332,7 @@ class FNote {/*** @param {string} [hoistedNoteId='root']- * @return {{isArchived: boolean, isInHoistedSubTree: boolean, notePath: string[], isHidden: boolean}[]}+ * @return {Array<{isArchived: boolean, isInHoistedSubTree: boolean, notePath: Array<string>, isHidden: boolean}>}*/getSortedNotePathRecords(hoistedNoteId = 'root') {const isHoistedRoot = hoistedNoteId === 'root';