mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	added getAllNotePaths, fixes #708
This commit is contained in:
		| @@ -28,7 +28,7 @@ | ||||
|  | ||||
| <header> | ||||
|      | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>ApiToken<span class="signature">(apiTokenId, token, isDeleted, utcDateCreated)</span><span class="type-signature"></span></h2> | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>ApiToken<span class="signature">()</span><span class="type-signature"></span></h2> | ||||
|          | ||||
|             <div class="class-description">ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.</div> | ||||
|          | ||||
| @@ -45,7 +45,7 @@ | ||||
|      | ||||
|  | ||||
|      | ||||
|     <h4 class="name" id="ApiToken"><span class="type-signature"></span>new ApiToken<span class="signature">(apiTokenId, token, isDeleted, utcDateCreated)</span><span class="type-signature"></span></h4> | ||||
|     <h4 class="name" id="ApiToken"><span class="type-signature"></span>new ApiToken<span class="signature">()</span><span class="type-signature"></span></h4> | ||||
|      | ||||
|  | ||||
|      | ||||
| @@ -60,10 +60,15 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|     <h5>Parameters:</h5> | ||||
|  | ||||
|  | ||||
| <table class="params"> | ||||
|  | ||||
|  | ||||
|     <h5 class="subsection-title">Properties:</h5> | ||||
|  | ||||
|      | ||||
|  | ||||
| <table class="props"> | ||||
|     <thead> | ||||
|     <tr> | ||||
|          | ||||
| @@ -180,8 +185,6 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| <dl class="details"> | ||||
|  | ||||
|      | ||||
|   | ||||
| @@ -28,7 +28,7 @@ | ||||
|  | ||||
| <header> | ||||
|      | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>Attribute<span class="signature">(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, utcDateCreated, utcDateModified)</span><span class="type-signature"></span></h2> | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>Attribute<span class="signature">()</span><span class="type-signature"></span></h2> | ||||
|          | ||||
|             <div class="class-description">Attribute is key value pair owned by a note.</div> | ||||
|          | ||||
| @@ -45,7 +45,7 @@ | ||||
|      | ||||
|  | ||||
|      | ||||
|     <h4 class="name" id="Attribute"><span class="type-signature"></span>new Attribute<span class="signature">(attributeId, noteId, type, name, value, position, isInheritable, isDeleted, utcDateCreated, utcDateModified)</span><span class="type-signature"></span></h4> | ||||
|     <h4 class="name" id="Attribute"><span class="type-signature"></span>new Attribute<span class="signature">()</span><span class="type-signature"></span></h4> | ||||
|      | ||||
|  | ||||
|      | ||||
| @@ -60,10 +60,15 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|     <h5>Parameters:</h5> | ||||
|  | ||||
|  | ||||
| <table class="params"> | ||||
|  | ||||
|  | ||||
|     <h5 class="subsection-title">Properties:</h5> | ||||
|  | ||||
|      | ||||
|  | ||||
| <table class="props"> | ||||
|     <thead> | ||||
|     <tr> | ||||
|          | ||||
| @@ -318,8 +323,6 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| <dl class="details"> | ||||
|  | ||||
|      | ||||
|   | ||||
| @@ -28,7 +28,7 @@ | ||||
|  | ||||
| <header> | ||||
|      | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>Branch<span class="signature">(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h2> | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>Branch<span class="signature">()</span><span class="type-signature"></span></h2> | ||||
|          | ||||
|             <div class="class-description">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.</div> | ||||
| @@ -46,7 +46,7 @@ Each note can have multiple (at least one) branches, meaning it can be placed in | ||||
|      | ||||
|  | ||||
|      | ||||
|     <h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">(branchId, noteId, parentNoteId, notePosition, prefix, isExpanded, isDeleted, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h4> | ||||
|     <h4 class="name" id="Branch"><span class="type-signature"></span>new Branch<span class="signature">()</span><span class="type-signature"></span></h4> | ||||
|      | ||||
|  | ||||
|      | ||||
| @@ -61,10 +61,15 @@ Each note can have multiple (at least one) branches, meaning it can be placed in | ||||
|  | ||||
|  | ||||
|  | ||||
|     <h5>Parameters:</h5> | ||||
|  | ||||
|  | ||||
| <table class="params"> | ||||
|  | ||||
|  | ||||
|     <h5 class="subsection-title">Properties:</h5> | ||||
|  | ||||
|      | ||||
|  | ||||
| <table class="props"> | ||||
|     <thead> | ||||
|     <tr> | ||||
|          | ||||
| @@ -296,8 +301,6 @@ Each note can have multiple (at least one) branches, meaning it can be placed in | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| <dl class="details"> | ||||
|  | ||||
|      | ||||
|   | ||||
| @@ -224,6 +224,29 @@ | ||||
|  | ||||
|      | ||||
|  | ||||
|         <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> | ||||
| @@ -419,7 +442,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#line42">line 42</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line43">line 43</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -486,6 +509,112 @@ | ||||
|      | ||||
|  | ||||
|      | ||||
|     <h4 class="name" id="getAllNotePaths"><span class="type-signature">(async) </span>getAllNotePaths<span class="signature">()</span><span class="type-signature"> → {Promise.<Array.<Array.<string>>>}</span></h4> | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| <dl class="details"> | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line734">line 734</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
| </dl> | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| <h5>Returns:</h5> | ||||
|  | ||||
|          | ||||
| <div class="param-desc"> | ||||
|     - array of notePaths (each represented by array of noteIds constituting the particular note path) | ||||
| </div> | ||||
|  | ||||
|  | ||||
|  | ||||
| <dl> | ||||
|     <dt> | ||||
|         Type | ||||
|     </dt> | ||||
|     <dd> | ||||
|          | ||||
| <span class="param-type">Promise.<Array.<Array.<string>>></span> | ||||
|  | ||||
|  | ||||
|     </dd> | ||||
| </dl> | ||||
|  | ||||
|      | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|          | ||||
|              | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|     <h4 class="name" id="getAttribute"><span class="type-signature">(async) </span>getAttribute<span class="signature">(type, name)</span><span class="type-signature"> → {Promise.<<a href="Attribute.html">Attribute</a>>}</span></h4> | ||||
|      | ||||
|  | ||||
| @@ -606,7 +735,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#line383">line 383</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line385">line 385</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -773,7 +902,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#line237">line 237</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line239">line 239</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -951,7 +1080,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#line394">line 394</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line396">line 396</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1057,7 +1186,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#line678">line 678</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line680">line 680</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1159,7 +1288,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#line706">line 706</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line708">line 708</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1265,7 +1394,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#line692">line 692</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line694">line 694</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1371,7 +1500,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#line73">line 73</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line74">line 74</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1473,7 +1602,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#line578">line 578</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line580">line 580</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1706,7 +1835,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#line601">line 601</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line603">line 603</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1904,7 +2033,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#line639">line 639</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line641">line 641</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2102,7 +2231,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#line648">line 648</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line650">line 650</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2204,7 +2333,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#line108">line 108</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line109">line 109</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2355,7 +2484,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#line489">line 489</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line491">line 491</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2522,7 +2651,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#line264">line 264</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2689,7 +2818,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#line254">line 254</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line256">line 256</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2844,7 +2973,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#line501">line 501</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line503">line 503</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2956,7 +3085,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#line665">line 665</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line667">line 667</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3058,7 +3187,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#line220">line 220</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line222">line 222</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3166,7 +3295,7 @@ This method can be significantly faster than the getAttribute() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line198">line 198</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line200">line 200</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3274,7 +3403,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line718">line 718</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line720">line 720</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3429,7 +3558,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line495">line 495</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line497">line 497</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3596,7 +3725,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line293">line 293</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line295">line 295</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3763,7 +3892,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line270">line 270</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line272">line 272</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3918,7 +4047,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line513">line 513</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line515">line 515</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4088,7 +4217,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line278">line 278</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line280">line 280</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4239,7 +4368,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line507">line 507</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line509">line 509</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4349,7 +4478,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line655">line 655</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line657">line 657</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4451,7 +4580,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line177">line 177</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line179">line 179</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4557,7 +4686,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line229">line 229</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line231">line 231</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4735,7 +4864,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line374">line 374</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line376">line 376</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4841,7 +4970,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line685">line 685</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line687">line 687</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4996,7 +5125,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line477">line 477</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line479">line 479</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -5151,7 +5280,7 @@ This method can be significantly faster than the getAttributes() | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line483">line 483</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line485">line 485</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -5262,7 +5391,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#line301">line 301</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line303">line 303</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -5346,7 +5475,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#line167">line 167</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line169">line 169</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -5452,7 +5581,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#line159">line 159</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line161">line 161</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -5558,7 +5687,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#line154">line 154</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line156">line 156</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -5664,7 +5793,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#line149">line 149</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line151">line 151</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -5770,7 +5899,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#line172">line 172</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line174">line 174</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -5876,7 +6005,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#line306">line 306</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line308">line 308</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -6105,7 +6234,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#line460">line 460</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line462">line 462</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -6303,7 +6432,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#line564">line 564</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line566">line 566</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -6501,7 +6630,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#line573">line 573</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line575">line 575</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -6730,7 +6859,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#line426">line 426</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line428">line 428</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -6832,7 +6961,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#line115">line 115</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line116">line 116</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -6934,7 +7063,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#line144">line 144</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line146">line 146</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -7132,7 +7261,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#line546">line 546</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line548">line 548</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -7330,7 +7459,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#line555">line 555</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line557">line 557</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -7590,7 +7719,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#line409">line 409</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line411">line 411</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -7819,7 +7948,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#line527">line 527</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line529">line 529</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -8048,7 +8177,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#line537">line 537</a> | ||||
|         <a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line539">line 539</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -28,7 +28,7 @@ | ||||
|  | ||||
| <header> | ||||
|      | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>NoteRevision<span class="signature">(noteRevisionId, noteId, type, mime, title, isProtected, dateLastEdited, dateCreated, utcDateLastEdited, utcDateCreated, utcDateModified)</span><span class="type-signature"></span></h2> | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>NoteRevision<span class="signature">()</span><span class="type-signature"></span></h2> | ||||
|          | ||||
|             <div class="class-description">NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning.</div> | ||||
|          | ||||
| @@ -45,7 +45,7 @@ | ||||
|      | ||||
|  | ||||
|      | ||||
|     <h4 class="name" id="NoteRevision"><span class="type-signature"></span>new NoteRevision<span class="signature">(noteRevisionId, noteId, type, mime, title, isProtected, dateLastEdited, dateCreated, utcDateLastEdited, utcDateCreated, utcDateModified)</span><span class="type-signature"></span></h4> | ||||
|     <h4 class="name" id="NoteRevision"><span class="type-signature"></span>new NoteRevision<span class="signature">()</span><span class="type-signature"></span></h4> | ||||
|      | ||||
|  | ||||
|      | ||||
| @@ -60,10 +60,15 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|     <h5>Parameters:</h5> | ||||
|  | ||||
|  | ||||
| <table class="params"> | ||||
|  | ||||
|  | ||||
|     <h5 class="subsection-title">Properties:</h5> | ||||
|  | ||||
|      | ||||
|  | ||||
| <table class="props"> | ||||
|     <thead> | ||||
|     <tr> | ||||
|          | ||||
| @@ -193,6 +198,52 @@ | ||||
|  | ||||
|              | ||||
|  | ||||
|             <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> | ||||
|  | ||||
|      | ||||
|  | ||||
|         <tr> | ||||
|              | ||||
|                 <td class="name"><code>isErased</code></td> | ||||
|              | ||||
|  | ||||
|             <td class="type"> | ||||
|              | ||||
|                  | ||||
| <span class="param-type">boolean</span> | ||||
|  | ||||
|  | ||||
|              | ||||
|             </td> | ||||
|  | ||||
|              | ||||
|  | ||||
|              | ||||
|  | ||||
|             <td class="description last"></td> | ||||
|         </tr> | ||||
|  | ||||
| @@ -206,7 +257,7 @@ | ||||
|             <td class="type"> | ||||
|              | ||||
|                  | ||||
| <span class="param-type">string</span> | ||||
| <span class="param-type">boolean</span> | ||||
|  | ||||
|  | ||||
|              | ||||
| @@ -341,8 +392,6 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| <dl class="details"> | ||||
|  | ||||
|      | ||||
| @@ -372,7 +421,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#line33">line 33</a> | ||||
|         <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line35">line 35</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -487,7 +536,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#line67">line 67</a> | ||||
|         <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line69">line 69</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -589,7 +638,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#line53">line 53</a> | ||||
|         <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line55">line 55</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -695,7 +744,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#line102">line 102</a> | ||||
|         <a href="entities_note_revision.js.html">entities/note_revision.js</a>, <a href="entities_note_revision.js.html#line104">line 104</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -28,7 +28,7 @@ | ||||
|  | ||||
| <header> | ||||
|      | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>Option<span class="signature">(name, value, isSynced, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h2> | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>Option<span class="signature">()</span><span class="type-signature"></span></h2> | ||||
|          | ||||
|             <div class="class-description">Option represents name-value pair, either directly configurable by the user or some system property.</div> | ||||
|          | ||||
| @@ -45,7 +45,7 @@ | ||||
|      | ||||
|  | ||||
|      | ||||
|     <h4 class="name" id="Option"><span class="type-signature"></span>new Option<span class="signature">(name, value, isSynced, utcDateModified, utcDateCreated)</span><span class="type-signature"></span></h4> | ||||
|     <h4 class="name" id="Option"><span class="type-signature"></span>new Option<span class="signature">()</span><span class="type-signature"></span></h4> | ||||
|      | ||||
|  | ||||
|      | ||||
| @@ -60,10 +60,15 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|     <h5>Parameters:</h5> | ||||
|  | ||||
|  | ||||
| <table class="params"> | ||||
|  | ||||
|  | ||||
|     <h5 class="subsection-title">Properties:</h5> | ||||
|  | ||||
|      | ||||
|  | ||||
| <table class="props"> | ||||
|     <thead> | ||||
|     <tr> | ||||
|          | ||||
| @@ -203,8 +208,6 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| <dl class="details"> | ||||
|  | ||||
|      | ||||
|   | ||||
| @@ -28,7 +28,7 @@ | ||||
|  | ||||
| <header> | ||||
|      | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">(noteId, notePath, isDeleted, utcDateModified)</span><span class="type-signature"></span></h2> | ||||
|         <h2><span class="attribs"><span class="type-signature"></span></span>RecentNote<span class="signature">()</span><span class="type-signature"></span></h2> | ||||
|          | ||||
|             <div class="class-description">RecentNote represents recently visited note.</div> | ||||
|          | ||||
| @@ -45,7 +45,7 @@ | ||||
|      | ||||
|  | ||||
|      | ||||
|     <h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">(noteId, notePath, isDeleted, utcDateModified)</span><span class="type-signature"></span></h4> | ||||
|     <h4 class="name" id="RecentNote"><span class="type-signature"></span>new RecentNote<span class="signature">()</span><span class="type-signature"></span></h4> | ||||
|      | ||||
|  | ||||
|      | ||||
| @@ -60,10 +60,15 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|     <h5>Parameters:</h5> | ||||
|  | ||||
|  | ||||
| <table class="params"> | ||||
|  | ||||
|  | ||||
|     <h5 class="subsection-title">Properties:</h5> | ||||
|  | ||||
|      | ||||
|  | ||||
| <table class="props"> | ||||
|     <thead> | ||||
|     <tr> | ||||
|          | ||||
| @@ -180,8 +185,6 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| <dl class="details"> | ||||
|  | ||||
|      | ||||
|   | ||||
| @@ -34,10 +34,10 @@ const dateUtils = require('../services/date_utils'); | ||||
| /** | ||||
|  * ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender. | ||||
|  * | ||||
|  * @param {string} apiTokenId - primary key | ||||
|  * @param {string} token | ||||
|  * @param {boolean} isDeleted - true if API token is deleted | ||||
|  * @param {string} utcDateCreated | ||||
|  * @property {string} apiTokenId - primary key | ||||
|  * @property {string} token | ||||
|  * @property {boolean} isDeleted - true if API token is deleted | ||||
|  * @property {string} utcDateCreated | ||||
|  * | ||||
|  * @extends Entity | ||||
|  */ | ||||
|   | ||||
| @@ -36,16 +36,16 @@ const sql = require('../services/sql'); | ||||
| /** | ||||
|  * Attribute is key value pair owned by a note. | ||||
|  * | ||||
|  * @param {string} attributeId | ||||
|  * @param {string} noteId | ||||
|  * @param {string} type | ||||
|  * @param {string} name | ||||
|  * @param {string} value | ||||
|  * @param {int} position | ||||
|  * @param {boolean} isInheritable | ||||
|  * @param {boolean} isDeleted | ||||
|  * @param {string} utcDateCreated | ||||
|  * @param {string} utcDateModified | ||||
|  * @property {string} attributeId | ||||
|  * @property {string} noteId | ||||
|  * @property {string} type | ||||
|  * @property {string} name | ||||
|  * @property {string} value | ||||
|  * @property {int} position | ||||
|  * @property {boolean} isInheritable | ||||
|  * @property {boolean} isDeleted | ||||
|  * @property {string} utcDateCreated | ||||
|  * @property {string} utcDateModified | ||||
|  * | ||||
|  * @extends Entity | ||||
|  */ | ||||
|   | ||||
| @@ -37,15 +37,15 @@ 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. | ||||
|  * | ||||
|  * @param {string} branchId - primary key | ||||
|  * @param {string} noteId | ||||
|  * @param {string} parentNoteId | ||||
|  * @param {int} notePosition | ||||
|  * @param {string} prefix | ||||
|  * @param {boolean} isExpanded | ||||
|  * @param {boolean} isDeleted | ||||
|  * @param {string} utcDateModified | ||||
|  * @param {string} utcDateCreated | ||||
|  * @property {string} branchId - primary key | ||||
|  * @property {string} noteId | ||||
|  * @property {string} parentNoteId | ||||
|  * @property {int} notePosition | ||||
|  * @property {string} prefix | ||||
|  * @property {boolean} isExpanded | ||||
|  * @property {boolean} isDeleted | ||||
|  * @property {string} utcDateModified | ||||
|  * @property {string} utcDateCreated | ||||
|  * | ||||
|  * @extends Entity | ||||
|  */ | ||||
|   | ||||
| @@ -49,6 +49,7 @@ 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 {boolean} isErased - true if note's content is erased after it has been deleted | ||||
| @@ -143,6 +144,7 @@ class Note extends Entity { | ||||
|     async setContent(content) { | ||||
|         // force updating note itself so that dateModified is represented correctly even for the content | ||||
|         this.forcedChange = true; | ||||
|         this.contentLength = content.length; | ||||
|         await this.save(); | ||||
|  | ||||
|         this.content = content; | ||||
| @@ -754,6 +756,26 @@ class Note extends Entity { | ||||
|                 AND parent_notes.isDeleted = 0`, [this.noteId]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @return {Promise<string[][]>} - array of notePaths (each represented by array of noteIds constituting the particular note path) | ||||
|      */ | ||||
|     async getAllNotePaths() { | ||||
|         if (this.noteId === 'root') { | ||||
|             return [['root']]; | ||||
|         } | ||||
|  | ||||
|         const notePaths = []; | ||||
|  | ||||
|         for (const parentNote of await this.getParentNotes()) { | ||||
|             for (const parentPath of await parentNote.getAllNotePaths()) { | ||||
|                 parentPath.push(this.noteId); | ||||
|                 notePaths.push(parentPath); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return notePaths; | ||||
|     } | ||||
|  | ||||
|     beforeSaving() { | ||||
|         if (!this.isDeleted) { | ||||
|             this.isDeleted = false; | ||||
| @@ -767,6 +789,10 @@ class Note extends Entity { | ||||
|             this.utcDateCreated = dateUtils.utcNowDateTime(); | ||||
|         } | ||||
|  | ||||
|         if (this.contentLength === undefined) { | ||||
|             this.contentLength = -1; | ||||
|         } | ||||
|  | ||||
|         super.beforeSaving(); | ||||
|  | ||||
|         if (this.isChanged) { | ||||
|   | ||||
| @@ -39,24 +39,26 @@ const syncTableService = require('../services/sync_table'); | ||||
| /** | ||||
|  * NoteRevision represents snapshot of note's title and content at some point in the past. It's used for seamless note versioning. | ||||
|  * | ||||
|  * @param {string} noteRevisionId | ||||
|  * @param {string} noteId | ||||
|  * @param {string} type | ||||
|  * @param {string} mime | ||||
|  * @param {string} title | ||||
|  * @param {string} isProtected | ||||
|  * @param {string} dateLastEdited | ||||
|  * @param {string} dateCreated | ||||
|  * @param {string} utcDateLastEdited | ||||
|  * @param {string} utcDateCreated | ||||
|  * @param {string} utcDateModified | ||||
|  * @property {string} noteRevisionId | ||||
|  * @property {string} noteId | ||||
|  * @property {string} type | ||||
|  * @property {string} mime | ||||
|  * @property {string} title | ||||
|  * @property {int} contentLength | ||||
|  * @property {boolean} isErased | ||||
|  * @property {boolean} isProtected | ||||
|  * @property {string} dateLastEdited | ||||
|  * @property {string} dateCreated | ||||
|  * @property {string} utcDateLastEdited | ||||
|  * @property {string} utcDateCreated | ||||
|  * @property {string} utcDateModified | ||||
|  * | ||||
|  * @extends Entity | ||||
|  */ | ||||
| class NoteRevision extends Entity { | ||||
|     static get entityName() { return "note_revisions"; } | ||||
|     static get primaryKeyName() { return "noteRevisionId"; } | ||||
|     static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "contentLength", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; } | ||||
|     static get hashedProperties() { return ["noteRevisionId", "noteId", "title", "contentLength", "isErased", "isProtected", "dateLastEdited", "dateCreated", "utcDateLastEdited", "utcDateCreated", "utcDateModified"]; } | ||||
|  | ||||
|     constructor(row) { | ||||
|         super(row); | ||||
| @@ -130,7 +132,7 @@ class NoteRevision extends Entity { | ||||
|     async setContent(content) { | ||||
|         // force updating note itself so that utcDateModified is represented correctly even for the content | ||||
|         this.forcedChange = true; | ||||
|         this.contentLength = content.length; | ||||
|         this.contentLength = content === null ? 0 : content.length; | ||||
|         await this.save(); | ||||
|  | ||||
|         this.content = content; | ||||
| @@ -156,6 +158,14 @@ class NoteRevision extends Entity { | ||||
|         await syncTableService.addNoteRevisionContentSync(this.noteRevisionId); | ||||
|     } | ||||
|  | ||||
|     beforeSaving() { | ||||
|         super.beforeSaving(); | ||||
|  | ||||
|         if (this.isChanged) { | ||||
|             this.utcDateModified = dateUtils.utcNowDateTime(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // cannot be static! | ||||
|     updatePojo(pojo) { | ||||
|         if (pojo.isProtected) { | ||||
|   | ||||
| @@ -34,11 +34,11 @@ const dateUtils = require('../services/date_utils'); | ||||
| /** | ||||
|  * Option represents name-value pair, either directly configurable by the user or some system property. | ||||
|  * | ||||
|  * @param {string} name | ||||
|  * @param {string} value | ||||
|  * @param {boolean} isSynced | ||||
|  * @param {string} utcDateModified | ||||
|  * @param {string} utcDateCreated | ||||
|  * @property {string} name | ||||
|  * @property {string} value | ||||
|  * @property {boolean} isSynced | ||||
|  * @property {string} utcDateModified | ||||
|  * @property {string} utcDateCreated | ||||
|  * | ||||
|  * @extends Entity | ||||
|  */ | ||||
|   | ||||
| @@ -34,10 +34,10 @@ const dateUtils = require('../services/date_utils'); | ||||
| /** | ||||
|  * RecentNote represents recently visited note. | ||||
|  * | ||||
|  * @param {string} noteId | ||||
|  * @param {string} notePath | ||||
|  * @param {boolean} isDeleted | ||||
|  * @param {string} utcDateModified | ||||
|  * @property {string} noteId | ||||
|  * @property {string} notePath | ||||
|  * @property {boolean} isDeleted | ||||
|  * @property {string} utcDateModified | ||||
|  * | ||||
|  * @extends Entity | ||||
|  */ | ||||
|   | ||||
| @@ -278,7 +278,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#line33">line 33</a> | ||||
|         <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> | ||||
|      | ||||
|  | ||||
| @@ -346,7 +346,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#line40">line 40</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line44">line 44</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -414,7 +414,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#line46">line 46</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line50">line 50</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -432,123 +432,7 @@ | ||||
|  | ||||
|          | ||||
|              | ||||
| <h4 class="name" id="cssClass"><span class="type-signature"></span>cssClass<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#line35">line 35</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
| </dl> | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|          | ||||
|              | ||||
| <h4 class="name" id="isDeleted"><span class="type-signature"></span>isDeleted<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#line31">line 31</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
| </dl> | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|          | ||||
|              | ||||
| <h4 class="name" id="isProtected"><span class="type-signature"></span>isProtected<span class="type-signature"></span></h4> | ||||
| <h4 class="name" id="contentLength"><span class="type-signature"></span>contentLength<span class="type-signature"></span></h4> | ||||
|  | ||||
|  | ||||
|  | ||||
| @@ -606,6 +490,238 @@ | ||||
|  | ||||
|          | ||||
|              | ||||
| <h4 class="name" id="cssClass"><span class="type-signature"></span>cssClass<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#line37">line 37</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
| </dl> | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|          | ||||
|              | ||||
| <h4 class="name" id="iconClass"><span class="type-signature"></span>iconClass<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#line39">line 39</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
| </dl> | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|          | ||||
|              | ||||
| <h4 class="name" id="isDeleted"><span class="type-signature"></span>isDeleted<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#line33">line 33</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
| </dl> | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|          | ||||
|              | ||||
| <h4 class="name" id="isProtected"><span class="type-signature"></span>isProtected<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#line27">line 27</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
|  | ||||
|      | ||||
| </dl> | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|          | ||||
|              | ||||
| <h4 class="name" id="mime"><span class="type-signature"></span>mime<span class="type-signature"></span></h4> | ||||
|  | ||||
|  | ||||
| @@ -646,7 +762,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#line31">line 31</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -772,7 +888,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#line38">line 38</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line42">line 42</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -840,7 +956,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#line43">line 43</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> | ||||
|      | ||||
|  | ||||
| @@ -956,7 +1072,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#line29">line 29</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1104,7 +1220,7 @@ | ||||
|      | ||||
|     <dt class="tag-source">Source:</dt> | ||||
|     <dd class="tag-source"><ul class="dummy"><li> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line216">line 216</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line220">line 220</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1271,7 +1387,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#line160">line 160</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1445,7 +1561,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#line227">line 227</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line231">line 231</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1551,7 +1667,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#line113">line 113</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line117">line 117</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1653,7 +1769,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#line125">line 125</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line129">line 129</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1755,7 +1871,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#line143">line 143</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line147">line 147</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -1857,7 +1973,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#line148">line 148</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line152">line 152</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2008,7 +2124,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#line249">line 249</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> | ||||
|      | ||||
|  | ||||
| @@ -2175,7 +2291,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#line182">line 182</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line186">line 186</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2342,7 +2458,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#line174">line 174</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line178">line 178</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2497,7 +2613,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#line261">line 261</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line265">line 265</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2603,7 +2719,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#line133">line 133</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line137">line 137</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2705,7 +2821,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#line138">line 138</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line142">line 142</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -2856,7 +2972,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#line255">line 255</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line259">line 259</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3023,7 +3139,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#line198">line 198</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line202">line 202</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3190,7 +3306,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#line190">line 190</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line194">line 194</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3345,7 +3461,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#line273">line 273</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line277">line 277</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3515,7 +3631,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#line283">line 283</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> | ||||
|      | ||||
|  | ||||
| @@ -3666,7 +3782,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#line267">line 267</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line271">line 271</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3776,7 +3892,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#line307">line 307</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line311">line 311</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -3950,7 +4066,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#line207">line 207</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line211">line 211</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4056,7 +4172,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#line120">line 120</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line124">line 124</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4207,7 +4323,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#line237">line 237</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line241">line 241</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4362,7 +4478,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#line243">line 243</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line247">line 247</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4473,7 +4589,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#line298">line 298</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line302">line 302</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
| @@ -4557,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_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line88">line 88</a> | ||||
|         <a href="entities_note_short.js.html">entities/note_short.js</a>, <a href="entities_note_short.js.html#line92">line 92</a> | ||||
|     </li></ul></dd> | ||||
|      | ||||
|  | ||||
|   | ||||
| @@ -49,6 +49,8 @@ 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' */ | ||||
| @@ -61,6 +63,8 @@ class NoteShort { | ||||
|         this.archived = row.archived; | ||||
|         /** @param {string} */ | ||||
|         this.cssClass = row.cssClass; | ||||
|         /** @param {string} */ | ||||
|         this.iconClass = row.iconClass; | ||||
|  | ||||
|         /** @type {string[]} */ | ||||
|         this.parents = []; | ||||
|   | ||||
| @@ -115,7 +115,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte | ||||
|  | ||||
|         const button = $('<button>') | ||||
|             .addClass("btn btn-sm") | ||||
|             .click(opts.action); | ||||
|             .on('click', opts.action); | ||||
|  | ||||
|         if (opts.icon) { | ||||
|             button.append($("<span>").addClass("bx bx-" + opts.icon)) | ||||
|   | ||||
| @@ -728,6 +728,26 @@ class Note extends Entity { | ||||
|                 AND parent_notes.isDeleted = 0`, [this.noteId]); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @return {Promise<string[][]>} - array of notePaths (each represented by array of noteIds constituting the particular note path) | ||||
|      */ | ||||
|     async getAllNotePaths() { | ||||
|         if (this.noteId === 'root') { | ||||
|             return [['root']]; | ||||
|         } | ||||
|  | ||||
|         const notePaths = []; | ||||
|  | ||||
|         for (const parentNote of await this.getParentNotes()) { | ||||
|             for (const parentPath of await parentNote.getAllNotePaths()) { | ||||
|                 parentPath.push(this.noteId); | ||||
|                 notePaths.push(parentPath); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return notePaths; | ||||
|     } | ||||
|  | ||||
|     beforeSaving() { | ||||
|         if (!this.isDeleted) { | ||||
|             this.isDeleted = false; | ||||
|   | ||||
| @@ -4,7 +4,6 @@ import server from './server.js'; | ||||
| import ws from "./ws.js"; | ||||
| import treeCache from "./tree_cache.js"; | ||||
| import NoteFull from "../entities/note_full.js"; | ||||
| import bundleService from "./bundle.js"; | ||||
| import utils from "./utils.js"; | ||||
| import contextMenuService from "./context_menu.js"; | ||||
| import treeUtils from "./tree_utils.js"; | ||||
|   | ||||
| @@ -107,6 +107,10 @@ class TreeCache { | ||||
|             if (note.type === 'search') { | ||||
|                 const searchResults = await server.get('search-note/' + note.noteId); | ||||
|  | ||||
|                 if (!searchResults) { | ||||
|                     throw new Error(`Search note ${note.noteId} failed.`); | ||||
|                 } | ||||
|  | ||||
|                 // force to load all the notes at once instead of one by one | ||||
|                 await treeCache.getNotes(searchResults.map(res => res.noteId)); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user