display mirror relations correctly on relation map

This commit is contained in:
azivner
2018-11-13 12:50:08 +01:00
parent 144e814b02
commit 0b85f87cb2
36 changed files with 843 additions and 115 deletions

View File

@@ -288,7 +288,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -406,6 +406,310 @@
<h3 class="subsection-title">Methods</h3>
<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>
<dl class="details">
<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#line46">line 46</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
</dd>
</dl>
<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>
<dl class="details">
<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#line57">line 57</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;(<a href="Note.html">Note</a>|null)></span>
</dd>
</dl>
<h4 class="name" id="isDefinition"><span class="type-signature"></span>isDefinition<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_attribute.js.html">entities/attribute.js</a>, <a href="entities_attribute.js.html#line76">line 76</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
@@ -426,7 +730,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -3814,7 +3814,7 @@ transactional by default.
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -511,7 +511,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/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -216,7 +216,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -358,7 +358,7 @@ this is different concept than attribute/relation.</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -373,7 +373,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line27">line 27</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line29">line 29</a>
</li></ul></dd>
@@ -613,7 +613,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#line425">line 425</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line443">line 443</a>
</li></ul></dd>
@@ -809,7 +809,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#line463">line 463</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line481">line 481</a>
</li></ul></dd>
@@ -1005,7 +1005,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#line472">line 472</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line490">line 490</a>
</li></ul></dd>
@@ -1177,7 +1177,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#line233">line 233</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line251">line 251</a>
</li></ul></dd>
@@ -1342,7 +1342,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#line118">line 118</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line120">line 120</a>
</li></ul></dd>
@@ -1518,7 +1518,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#line244">line 244</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line262">line 262</a>
</li></ul></dd>
@@ -1622,7 +1622,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#line502">line 502</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line520">line 520</a>
</li></ul></dd>
@@ -1722,7 +1722,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#line530">line 530</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line548">line 548</a>
</li></ul></dd>
@@ -1826,7 +1826,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#line516">line 516</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line534">line 534</a>
</li></ul></dd>
@@ -1979,7 +1979,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#line331">line 331</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line349">line 349</a>
</li></ul></dd>
@@ -2035,6 +2035,171 @@
<h4 class="name" id="getLabelDefinitions"><span class="type-signature">(async) </span>getLabelDefinitions<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">label name to filter</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line145">line 145</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
all note's label definitions, including inherited ones
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
</dd>
</dl>
<h4 class="name" id="getLabels"><span class="type-signature">(async) </span>getLabels<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
@@ -2144,7 +2309,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#line135">line 135</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line137">line 137</a>
</li></ul></dd>
@@ -2297,7 +2462,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line343">line 343</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line361">line 361</a>
</li></ul></dd>
@@ -2401,7 +2566,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line486">line 486</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line504">line 504</a>
</li></ul></dd>
@@ -2505,7 +2670,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#line495">line 495</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line513">line 513</a>
</li></ul></dd>
@@ -2605,7 +2770,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#line103">line 103</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line105">line 105</a>
</li></ul></dd>
@@ -2709,7 +2874,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#line542">line 542</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line560">line 560</a>
</li></ul></dd>
@@ -2862,7 +3027,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line337">line 337</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line355">line 355</a>
</li></ul></dd>
@@ -2918,6 +3083,171 @@
<h4 class="name" id="getRelationDefinitions"><span class="type-signature">(async) </span>getRelationDefinitions<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">relation name to filter</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line161">line 161</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
all note's relation definitions including inherited ones
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>></span>
</dd>
</dl>
<h4 class="name" id="getRelations"><span class="type-signature">(async) </span>getRelations<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;<a href="Attribute.html">Attribute</a>>>}</span></h4>
@@ -3027,7 +3357,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#line143">line 143</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line153">line 153</a>
</li></ul></dd>
@@ -3180,7 +3510,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#line411">line 411</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line429">line 429</a>
</li></ul></dd>
@@ -3336,7 +3666,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line349">line 349</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line367">line 367</a>
</li></ul></dd>
@@ -3444,7 +3774,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line479">line 479</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line497">line 497</a>
</li></ul></dd>
@@ -3544,7 +3874,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#line84">line 84</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line86">line 86</a>
</li></ul></dd>
@@ -3648,7 +3978,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#line110">line 110</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line112">line 112</a>
</li></ul></dd>
@@ -3824,7 +4154,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#line224">line 224</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line242">line 242</a>
</li></ul></dd>
@@ -3928,7 +4258,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#line509">line 509</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line527">line 527</a>
</li></ul></dd>
@@ -4081,7 +4411,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#line319">line 319</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line337">line 337</a>
</li></ul></dd>
@@ -4234,7 +4564,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#line325">line 325</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line343">line 343</a>
</li></ul></dd>
@@ -4343,7 +4673,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#line151">line 151</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line169">line 169</a>
</li></ul></dd>
@@ -4425,7 +4755,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#line79">line 79</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line81">line 81</a>
</li></ul></dd>
@@ -4529,7 +4859,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#line73">line 73</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line75">line 75</a>
</li></ul></dd>
@@ -4633,7 +4963,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#line68">line 68</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line70">line 70</a>
</li></ul></dd>
@@ -4737,7 +5067,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#line63">line 63</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line65">line 65</a>
</li></ul></dd>
@@ -4841,7 +5171,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#line156">line 156</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line174">line 174</a>
</li></ul></dd>
@@ -5068,7 +5398,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#line302">line 302</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line320">line 320</a>
</li></ul></dd>
@@ -5264,7 +5594,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line396">line 396</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line414">line 414</a>
</li></ul></dd>
@@ -5460,7 +5790,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line405">line 405</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line423">line 423</a>
</li></ul></dd>
@@ -5687,7 +6017,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#line276">line 276</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line294">line 294</a>
</li></ul></dd>
@@ -5883,7 +6213,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#line378">line 378</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line396">line 396</a>
</li></ul></dd>
@@ -6079,7 +6409,7 @@ Cache is note instance scoped.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line387">line 387</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line405">line 405</a>
</li></ul></dd>
@@ -6337,7 +6667,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#line259">line 259</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line277">line 277</a>
</li></ul></dd>
@@ -6564,7 +6894,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#line359">line 359</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line377">line 377</a>
</li></ul></dd>
@@ -6791,7 +7121,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#line369">line 369</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line387">line 387</a>
</li></ul></dd>
@@ -6859,7 +7189,7 @@ Cache is note instance scoped.
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -403,7 +403,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -311,7 +311,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -288,7 +288,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -75,7 +75,7 @@ module.exports = ApiToken;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -68,10 +68,20 @@ class Attribute extends Entity {
}
}
/**
* @returns {Promise&lt;Note|null>}
*/
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
if (!this.__note) {
this.__note = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
}
return this.__note;
}
/**
* @returns {Promise&lt;Note|null>}
*/
async getTargetNote() {
if (this.type !== 'relation') {
throw new Error(`Attribute ${this.attributeId} is not relation`);
@@ -81,9 +91,16 @@ class Attribute extends Entity {
return null;
}
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]);
if (!this.__targetNote) {
this.__targetNote = await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.value]);
}
return this.__targetNote;
}
/**
* @return {boolean}
*/
isDefinition() {
return this.type === 'label-definition' || this.type === 'relation-definition';
}
@@ -134,7 +151,7 @@ module.exports = Attribute;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -105,7 +105,7 @@ module.exports = Branch;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -93,7 +93,7 @@ module.exports = Entity;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -92,7 +92,7 @@ module.exports = Link;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -35,7 +35,9 @@ const repository = require('../services/repository');
const dateUtils = require('../services/date_utils');
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.
@@ -164,6 +166,14 @@ class Note extends Entity {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL);
}
/**
* @param {string} [name] - label name to filter
* @returns {Promise&lt;Attribute[]>} all note's label definitions, including inherited ones
*/
async getLabelDefinitions(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === LABEL_DEFINITION);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Attribute[]>} all note's relations (attributes with type relation), including inherited ones
@@ -172,6 +182,14 @@ class Note extends Entity {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION);
}
/**
* @param {string} [name] - relation name to filter
* @returns {Promise&lt;Attribute[]>} all note's relation definitions including inherited ones
*/
async getRelationDefinitions(name) {
return (await this.getAttributes(name)).filter(attr => attr.type === RELATION_DEFINITION);
}
/**
* Clear note's attributes cache to force fresh reload for next attribute request.
* Cache is note instance scoped.
@@ -622,7 +640,7 @@ module.exports = Note;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -91,7 +91,7 @@ module.exports = NoteRevision;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -78,7 +78,7 @@ module.exports = Option;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -75,7 +75,7 @@ module.exports = RecentNote;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -594,7 +594,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -56,7 +56,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>

View File

@@ -278,7 +278,7 @@ module.exports = BackendScriptApi;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 09 2018 14:44:33 GMT+0100 (Central European Standard Time)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Nov 13 2018 12:12:03 GMT+0100 (Central European Standard Time)
</footer>
<script> prettyPrint(); </script>