rename API .createNote() to .createNewNote() to allow future backwards compatibility

This commit is contained in:
zadam 2019-11-28 22:35:55 +01:00
parent 2953f1bdb8
commit 6c561b5764
5 changed files with 204 additions and 203 deletions

View file

@ -543,7 +543,7 @@ the backend.
<div class="description">
Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
JSON MIME type. See also createNote() for more options.
JSON MIME type. See also createNewNote() for more options.
</div>
@ -736,7 +736,7 @@ JSON MIME type. See also createNote() for more options.
<h4 class="name" id="createNote"><span class="type-signature"></span>createNote<span class="signature">(params<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
<h4 class="name" id="createNewNote"><span class="type-signature"></span>createNewNote<span class="signature">(params<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;{note: <a href="Note.html">Note</a>, branch: <a href="Branch.html">Branch</a>}>}</span></h4>
@ -784,7 +784,7 @@ JSON MIME type. See also createNote() for more options.
<td class="type">
<span class="param-type"><a href="global.html#CreateNoteParams">CreateNoteParams</a></span>
<span class="param-type"><a href="global.html#CreateNewNoteParams">CreateNewNoteParams</a></span>
@ -911,7 +911,7 @@ JSON MIME type. See also createNote() for more options.
<div class="description">
Create text note. See also createNote() for more options.
Create text note. See also createNewNote() for more options.
</div>

View file

@ -141,6 +141,7 @@ class Attribute extends Entity {
// cannot be static!
updatePojo(pojo) {
delete pojo.isOwned;
delete pojo.__note;
}
}

View file

@ -102,195 +102,7 @@
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">attribute type - label, relation etc.</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">attribute name</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">attribute value</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#line173">line 173</a>
</li></ul></dd>
</dl>
<h4 class="name" id="CreateNoteParams">CreateNoteParams</h4>
<h4 class="name" id="CreateNewNoteParams">CreateNewNoteParams</h4>
@ -596,6 +408,194 @@
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">object</span>
</li>
</ul>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">attribute type - label, relation etc.</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last">attribute name</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">attribute value</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#line173">line 173</a>
</li></ul></dd>
</dl>

View file

@ -206,7 +206,7 @@ function BackendScriptApi(currentNote, apiParams) {
*/
/**
* Create text note. See also createNote() for more options.
* Create text note. See also createNewNote() for more options.
*
* @param {string} parentNoteId
* @param {string} title
@ -222,7 +222,7 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
* JSON MIME type. See also createNote() for more options.
* JSON MIME type. See also createNewNote() for more options.
*
* @param {string} parentNoteId
* @param {string} title
@ -238,7 +238,7 @@ function BackendScriptApi(currentNote, apiParams) {
});
/**
* @typedef {object} CreateNoteParams
* @typedef {object} CreateNewNoteParams
* @property {string} parentNoteId - MANDATORY
* @property {string} title - MANDATORY
* @property {string|buffer} content - MANDATORY
@ -253,10 +253,10 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
*
* @param {CreateNoteParams} [params]
* @param {CreateNewNoteParams} [params]
* @returns {Promise&lt;{note: Note, branch: Branch}>} object contains newly created entities note and branch
*/
this.createNote = noteService.createNewNote;
this.createNewNote = noteService.createNewNote;
/**
* Log given message to trilium logs.

View file

@ -178,7 +178,7 @@ function BackendScriptApi(currentNote, apiParams) {
*/
/**
* Create text note. See also createNote() for more options.
* Create text note. See also createNewNote() for more options.
*
* @param {string} parentNoteId
* @param {string} title
@ -194,7 +194,7 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
* JSON MIME type. See also createNote() for more options.
* JSON MIME type. See also createNewNote() for more options.
*
* @param {string} parentNoteId
* @param {string} title
@ -210,7 +210,7 @@ function BackendScriptApi(currentNote, apiParams) {
});
/**
* @typedef {object} CreateNoteParams
* @typedef {object} CreateNewNoteParams
* @property {string} parentNoteId - MANDATORY
* @property {string} title - MANDATORY
* @property {string|buffer} content - MANDATORY
@ -225,10 +225,10 @@ function BackendScriptApi(currentNote, apiParams) {
/**
* @method
*
* @param {CreateNoteParams} [params]
* @param {CreateNewNoteParams} [params]
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
*/
this.createNote = noteService.createNewNote;
this.createNewNote = noteService.createNewNote;
/**
* Log given message to trilium logs.