mirror of
https://github.com/zadam/trilium.git
synced 2025-03-03 18:49:27 +08:00
rename API .createNote() to .createNewNote() to allow future backwards compatibility
This commit is contained in:
parent
2953f1bdb8
commit
6c561b5764
5 changed files with 204 additions and 203 deletions
|
@ -543,7 +543,7 @@ the backend.
|
||||||
|
|
||||||
<div class="description">
|
<div class="description">
|
||||||
Create data note - data in this context means object serializable to JSON. Created note will be of type 'code' and
|
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>
|
</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"> → {Promise.<{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"> → {Promise.<{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">
|
<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">
|
<div class="description">
|
||||||
Create text note. See also createNote() for more options.
|
Create text note. See also createNewNote() for more options.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,7 @@ class Attribute extends Entity {
|
||||||
// cannot be static!
|
// cannot be static!
|
||||||
updatePojo(pojo) {
|
updatePojo(pojo) {
|
||||||
delete pojo.isOwned;
|
delete pojo.isOwned;
|
||||||
|
delete pojo.__note;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,195 +102,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h4 class="name" id="CreateNoteAttribute">CreateNoteAttribute</h4>
|
<h4 class="name" id="CreateNewNoteParams">CreateNewNoteParams</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">
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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">
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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} parentNoteId
|
||||||
* @param {string} title
|
* @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
|
* 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} parentNoteId
|
||||||
* @param {string} title
|
* @param {string} title
|
||||||
|
@ -238,7 +238,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} CreateNoteParams
|
* @typedef {object} CreateNewNoteParams
|
||||||
* @property {string} parentNoteId - MANDATORY
|
* @property {string} parentNoteId - MANDATORY
|
||||||
* @property {string} title - MANDATORY
|
* @property {string} title - MANDATORY
|
||||||
* @property {string|buffer} content - MANDATORY
|
* @property {string|buffer} content - MANDATORY
|
||||||
|
@ -253,10 +253,10 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
*
|
*
|
||||||
* @param {CreateNoteParams} [params]
|
* @param {CreateNewNoteParams} [params]
|
||||||
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
|
* @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.
|
* Log given message to trilium logs.
|
||||||
|
|
|
@ -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} parentNoteId
|
||||||
* @param {string} title
|
* @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
|
* 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} parentNoteId
|
||||||
* @param {string} title
|
* @param {string} title
|
||||||
|
@ -210,7 +210,7 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {object} CreateNoteParams
|
* @typedef {object} CreateNewNoteParams
|
||||||
* @property {string} parentNoteId - MANDATORY
|
* @property {string} parentNoteId - MANDATORY
|
||||||
* @property {string} title - MANDATORY
|
* @property {string} title - MANDATORY
|
||||||
* @property {string|buffer} content - MANDATORY
|
* @property {string|buffer} content - MANDATORY
|
||||||
|
@ -225,10 +225,10 @@ function BackendScriptApi(currentNote, apiParams) {
|
||||||
/**
|
/**
|
||||||
* @method
|
* @method
|
||||||
*
|
*
|
||||||
* @param {CreateNoteParams} [params]
|
* @param {CreateNewNoteParams} [params]
|
||||||
* @returns {Promise<{note: Note, branch: Branch}>} object contains newly created entities note and branch
|
* @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.
|
* Log given message to trilium logs.
|
||||||
|
|
Loading…
Reference in a new issue