Merge branch 'm38'

# Conflicts:
#	docs/backend_api/Note.html
#	docs/frontend_api/NoteShort.html
#	src/services/import/enex.js
This commit is contained in:
zadam
2019-11-18 23:26:29 +01:00
55 changed files with 4304 additions and 874 deletions

View File

@@ -396,7 +396,7 @@ the backend.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line313">line 313</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line291">line 291</a>
</li></ul></dd>
@@ -534,7 +534,7 @@ the backend.
<h4 class="name" id="createNote"><span class="type-signature"></span>createNote<span class="signature">(parentNoteId, title, content<span class="signature-attributes">opt</span>, extraOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
<h4 class="name" id="createNote"><span class="type-signature"></span>createNote<span class="signature">(extraOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
@@ -576,115 +576,6 @@ the backend.
<tbody>
<tr>
<td class="name"><code>parentNoteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">create new note under this parent</td>
</tr>
<tr>
<td class="name"><code>title</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>content</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
""
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>extraOptions</code></td>
@@ -693,7 +584,7 @@ the backend.
<td class="type">
<span class="param-type"><a href="global.html#CreateNoteExtraOptions">CreateNoteExtraOptions</a></span>
<span class="param-type"><a href="global.html#CreateNoteParams">CreateNoteParams</a></span>
@@ -760,295 +651,7 @@ the backend.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line198">line 198</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
object contains newly created entities note and branch
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}></span>
</dd>
</dl>
<h4 class="name" id="createNoteAndRefresh"><span class="type-signature"></span>createNoteAndRefresh<span class="signature">(parentNoteId, title, content<span class="signature-attributes">opt</span>, extraOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
<div class="description">
Creates new note according to given params and force all connected clients to refresh their tree.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>parentNoteId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last">create new note under this parent</td>
</tr>
<tr>
<td class="name"><code>title</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="default">
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>content</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
""
</td>
<td class="description last"></td>
</tr>
<tr>
<td class="name"><code>extraOptions</code></td>
<td class="type">
<span class="param-type"><a href="global.html#CreateNoteExtraOptions">CreateNoteExtraOptions</a></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
{}
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line211">line 211</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line195">line 195</a>
</li></ul></dd>
@@ -1533,7 +1136,7 @@ the backend.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line318">line 318</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line296">line 296</a>
</li></ul></dd>
@@ -1997,7 +1600,7 @@ the backend.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line241">line 241</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line219">line 219</a>
</li></ul></dd>
@@ -2765,7 +2368,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line260">line 260</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line238">line 238</a>
</li></ul></dd>
@@ -3418,7 +3021,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line232">line 232</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line210">line 210</a>
</li></ul></dd>
@@ -3596,7 +3199,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line251">line 251</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line229">line 229</a>
</li></ul></dd>
@@ -3751,7 +3354,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line269">line 269</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line247">line 247</a>
</li></ul></dd>
@@ -3901,7 +3504,7 @@ if some action needs to happen on only one specific instance.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line224">line 224</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line202">line 202</a>
</li></ul></dd>
@@ -4404,7 +4007,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line290">line 290</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line268">line 268</a>
</li></ul></dd>
@@ -4537,7 +4140,7 @@ This method looks similar to toggleNoteInParent() but differs because we're look
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line276">line 276</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line254">line 254</a>
</li></ul></dd>
@@ -4912,7 +4515,7 @@ transactional by default.
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line303">line 303</a>
<a href="services_backend_script_api.js.html">services/backend_script_api.js</a>, <a href="services_backend_script_api.js.html#line281">line 281</a>
</li></ul></dd>

View File

@@ -509,7 +509,7 @@
<h4 class="name" id="getAllNotePaths"><span class="type-signature">(async) </span>getAllNotePaths<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;Array.&lt;string>>>}</span></h4>
<h4 class="name" id="addAttribute"><span class="type-signature">(async) </span>addAttribute<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Attribute.html">Attribute</a>>}</span></h4>
@@ -557,7 +557,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line734">line 734</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line482">line 482</a>
</li></ul></dd>
@@ -585,10 +585,6 @@
<h5>Returns:</h5>
<div class="param-desc">
- array of notePaths (each represented by array of noteIds constituting the particular note path)
</div>
<dl>
@@ -597,7 +593,7 @@
</dt>
<dd>
<span class="param-type">Promise.&lt;Array.&lt;Array.&lt;string>>></span>
<span class="param-type">Promise.&lt;<a href="Attribute.html">Attribute</a>></span>
</dd>
@@ -735,7 +731,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#line385">line 385</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line389">line 389</a>
</li></ul></dd>
@@ -902,7 +898,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#line239">line 239</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line243">line 243</a>
</li></ul></dd>
@@ -1080,7 +1076,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#line396">line 396</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line400">line 400</a>
</li></ul></dd>
@@ -1186,7 +1182,7 @@
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line680">line 680</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line710">line 710</a>
</li></ul></dd>
@@ -1288,7 +1284,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#line708">line 708</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line738">line 738</a>
</li></ul></dd>
@@ -1394,7 +1390,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#line694">line 694</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line724">line 724</a>
</li></ul></dd>
@@ -1602,7 +1598,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#line580">line 580</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line610">line 610</a>
</li></ul></dd>
@@ -1835,7 +1831,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#line603">line 603</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line633">line 633</a>
</li></ul></dd>
@@ -2033,7 +2029,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#line641">line 641</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line671">line 671</a>
</li></ul></dd>
@@ -2231,7 +2227,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#line650">line 650</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line680">line 680</a>
</li></ul></dd>
@@ -2484,7 +2480,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#line491">line 491</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line521">line 521</a>
</li></ul></dd>
@@ -2651,7 +2647,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#line264">line 264</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line268">line 268</a>
</li></ul></dd>
@@ -2818,7 +2814,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#line256">line 256</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line260">line 260</a>
</li></ul></dd>
@@ -2973,7 +2969,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#line503">line 503</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line533">line 533</a>
</li></ul></dd>
@@ -3085,7 +3081,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#line667">line 667</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line697">line 697</a>
</li></ul></dd>
@@ -3187,7 +3183,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#line222">line 222</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line226">line 226</a>
</li></ul></dd>
@@ -3295,7 +3291,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#line200">line 200</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line204">line 204</a>
</li></ul></dd>
@@ -3403,7 +3399,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#line720">line 720</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line750">line 750</a>
</li></ul></dd>
@@ -3558,7 +3554,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#line497">line 497</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line527">line 527</a>
</li></ul></dd>
@@ -3725,7 +3721,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#line295">line 295</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line299">line 299</a>
</li></ul></dd>
@@ -3892,7 +3888,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#line272">line 272</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line276">line 276</a>
</li></ul></dd>
@@ -4047,7 +4043,7 @@ This method can be significantly faster than the getAttributes()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line515">line 515</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line545">line 545</a>
</li></ul></dd>
@@ -4217,7 +4213,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#line280">line 280</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line284">line 284</a>
</li></ul></dd>
@@ -4368,7 +4364,7 @@ This method can be significantly faster than the getAttributes()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line509">line 509</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line539">line 539</a>
</li></ul></dd>
@@ -4478,7 +4474,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#line657">line 657</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line687">line 687</a>
</li></ul></dd>
@@ -4580,7 +4576,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#line179">line 179</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line183">line 183</a>
</li></ul></dd>
@@ -4686,7 +4682,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#line231">line 231</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line235">line 235</a>
</li></ul></dd>
@@ -4864,7 +4860,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#line376">line 376</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line380">line 380</a>
</li></ul></dd>
@@ -4970,7 +4966,7 @@ This method can be significantly faster than the getAttributes()
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line687">line 687</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line717">line 717</a>
</li></ul></dd>
@@ -5125,7 +5121,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#line479">line 479</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line509">line 509</a>
</li></ul></dd>
@@ -5280,7 +5276,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#line485">line 485</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line515">line 515</a>
</li></ul></dd>
@@ -5391,7 +5387,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#line303">line 303</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line307">line 307</a>
</li></ul></dd>
@@ -5475,7 +5471,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#line169">line 169</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line173">line 173</a>
</li></ul></dd>
@@ -5581,7 +5577,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#line161">line 161</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line165">line 165</a>
</li></ul></dd>
@@ -5687,7 +5683,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#line160">line 160</a>
</li></ul></dd>
@@ -5793,7 +5789,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#line155">line 155</a>
</li></ul></dd>
@@ -5899,7 +5895,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#line174">line 174</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line178">line 178</a>
</li></ul></dd>
@@ -6005,7 +6001,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#line308">line 308</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line312">line 312</a>
</li></ul></dd>
@@ -6234,7 +6230,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#line462">line 462</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line466">line 466</a>
</li></ul></dd>
@@ -6432,7 +6428,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#line566">line 566</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line596">line 596</a>
</li></ul></dd>
@@ -6630,7 +6626,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#line575">line 575</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line605">line 605</a>
</li></ul></dd>
@@ -6859,7 +6855,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#line428">line 428</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line432">line 432</a>
</li></ul></dd>
@@ -7063,7 +7059,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#line146">line 146</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line150">line 150</a>
</li></ul></dd>
@@ -7261,7 +7257,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#line548">line 548</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line578">line 578</a>
</li></ul></dd>
@@ -7459,7 +7455,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#line557">line 557</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line587">line 587</a>
</li></ul></dd>
@@ -7719,7 +7715,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#line411">line 411</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line415">line 415</a>
</li></ul></dd>
@@ -7948,7 +7944,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#line529">line 529</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line559">line 559</a>
</li></ul></dd>
@@ -8177,7 +8173,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#line539">line 539</a>
<a href="entities_note.js.html">entities/note.js</a>, <a href="entities_note.js.html#line569">line 569</a>
</li></ul></dd>

View File

@@ -107,6 +107,10 @@ class Attribute extends Entity {
async beforeSaving() {
if (!this.value) {
if (this.type === 'relation') {
throw new Error(`Cannot save relation ${this.name} since it does not target any note.`);
}
// null value isn't allowed
this.value = "";
}

View File

@@ -142,6 +142,10 @@ class Note extends Entity {
/** @returns {Promise} */
async setContent(content) {
if (content === null || content === undefined) {
throw new Error(`Cannot set null content to note ${this.noteId}`);
}
// force updating note itself so that dateModified is represented correctly even for the content
this.forcedChange = true;
this.contentLength = content.length;
@@ -500,6 +504,32 @@ class Note extends Entity {
}
}
/**
* @return {Promise&lt;Attribute>}
*/
async addAttribute(type, name, value = "") {
const attr = new Attribute({
noteId: this.noteId,
type: type,
name: name,
value: value
});
await attr.save();
this.invalidateAttributeCache();
return attr;
}
async addLabel(name, value = "") {
return await this.addAttribute(LABEL, name, value);
}
async addRelation(name, targetNoteId) {
return await this.addAttribute(RELATION, name, targetNoteId);
}
/**
* @param {string} name - label name
* @returns {Promise&lt;boolean>} true if label exists (including inherited)

View File

@@ -290,7 +290,7 @@
<h4 class="name" id="CreateNoteExtraOptions">CreateNoteExtraOptions</h4>
<h4 class="name" id="CreateNoteParams">CreateNoteParams</h4>

View File

@@ -206,7 +206,7 @@ function BackendScriptApi(currentNote, apiParams) {
*/
/**
* @typedef {object} CreateNoteExtraOptions
* @typedef {object} CreateNoteParams
* @property {boolean} [json=false] - should the note be JSON
* @property {boolean} [isProtected=false] - should the note be protected
* @property {string} [type='text'] - note type
@@ -217,32 +217,10 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
*
* @param {string} parentNoteId - create new note under this parent
* @param {string} title
* @param {string} [content=""]
* @param {CreateNoteExtraOptions} [extraOptions={}]
* @param {CreateNoteParams} [extraOptions={}]
* @returns {Promise&lt;{note: Note, branch: Branch}>} object contains newly created entities note and branch
*/
this.createNote = noteService.createNote;
/**
* Creates new note according to given params and force all connected clients to refresh their tree.
*
* @method
*
* @param {string} parentNoteId - create new note under this parent
* @param {string} title
* @param {string} [content=""]
* @param {CreateNoteExtraOptions} [extraOptions={}]
* @returns {Promise&lt;{note: Note, branch: Branch}>} object contains newly created entities note and branch
*/
this.createNoteAndRefresh = async function(parentNoteId, title, content, extraOptions) {
const ret = await noteService.createNote(parentNoteId, title, content, extraOptions);
ws.refreshTree();
return ret;
};
this.createNote = noteService.createNewNote;
/**
* Log given message to trilium logs.